Hello guys,today we have to learn about installing Laravel and Nginx on Ubuntu14.04. It's
very important to install it easy way because easy way optimize your time and it's easy
to memorize.Let's play with it. For Laravel you need to install composer,let's install
composer first.open your terminal (login your server by terminal) then just run
This will create a file called composer.phar in your home directory. This is a PHP
archive, and it can be run from the command line.We want to install it in a globally
accessible location though. Also, we want to change the name to composer (without the
file extension). We can do this in one step by typing:
Now you can check composer by typing:
It will show composer details.
The second step,installs Laravel globally on your system by typing:
Make sure to place the ~/.composer/vendor/bin directory (or the equivalent directory for
your OS) in your PATH so the laravel executable can be located by your system.Type:
When you run this command restart your terminal. Now the laravel executable on your
system.
Now make a project by typing:
Let's install the backend components that means install Nginx.First, we need to update
our local package and make sure you have a fresh list of the available packages. Then we
can install the necessary components:
Now configure Nginx and the web root.Open the default server block configuration file
with sudo privileges and set our document root:
for laravel document root:
Because we modified the default server block file, which is already enabled, we simply
need to restart Nginx for our configuration changes to be picked up:
Now, the files are all installed within our /var/www/laravel directory, but they are
entirely owned by our root account. The web user needs partial ownership and permissions
in order to correctly serve the content.
We can give group ownership of our Laravel directory structure to the web group by
typing:
Next, we can change the permissions of the /var/www/laravel/app/storage directory to
allow the web group write permissions. This is necessary for the application to function
correctly:
Thank's for reading......
very important to install it easy way because easy way optimize your time and it's easy
to memorize.Let's play with it. For Laravel you need to install composer,let's install
composer first.open your terminal (login your server by terminal) then just run
cd ~
curl -sS https://getcomposer.org/installer | php
This will create a file called composer.phar in your home directory. This is a PHP
archive, and it can be run from the command line.We want to install it in a globally
accessible location though. Also, we want to change the name to composer (without the
file extension). We can do this in one step by typing:
sudo mv composer.phar /usr/local/bin/composer
Now you can check composer by typing:
composer
It will show composer details.
The second step,installs Laravel globally on your system by typing:
composer global require "laravel/installer"
Make sure to place the ~/.composer/vendor/bin directory (or the equivalent directory for
your OS) in your PATH so the laravel executable can be located by your system.Type:
export PATH="~/.composer/vendor/bin/"
When you run this command restart your terminal. Now the laravel executable on your
system.
Now make a project by typing:
laravel new /var/www/laravel
Let's install the backend components that means install Nginx.First, we need to update
our local package and make sure you have a fresh list of the available packages. Then we
can install the necessary components:
sudo apt-get update
sudo apt-get install nginx php5-fpm php5-cli php5-mcrypt git
Now configure Nginx and the web root.Open the default server block configuration file
with sudo privileges and set our document root:
sudo nano /etc/nginx/sites-available/default
for laravel document root:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/laravel/public;
index index.php index.html index.htm;
server_name localhost;
location / {
try_files $uri $uri/ =404;
}
}
Because we modified the default server block file, which is already enabled, we simply
need to restart Nginx for our configuration changes to be picked up:
sudo service nginx restart
Now, the files are all installed within our /var/www/laravel directory, but they are
entirely owned by our root account. The web user needs partial ownership and permissions
in order to correctly serve the content.
We can give group ownership of our Laravel directory structure to the web group by
typing:
sudo chown -R :www-data /var/www/laravel
Next, we can change the permissions of the /var/www/laravel/app/storage directory to
allow the web group write permissions. This is necessary for the application to function
correctly:
sudo chmod -R 775 /var/www/laravel/storage
Thank's for reading......