Laravel framework installation in linux(ubuntu)

->First, update the package manager cache by running:
    sudo apt-get update

-> Download Composer and php5-cli for installing and running for project dependencies as well as curl. it can be installed with the following command:
    sudo apt-get install curl php5-cli git

-> Install Composer First
    cd ~
    curl -sS https://getcomposer.org/installer | sudo php
        //Composer successfully installed to: /home/sandeep/composer.phar

-> Installer Composer Globally
    sudo mv composer.phar /usr/local/bin/composer

->Install Laravel
    cd /var/www/html
    composer create-project laravel/laravel your-project --prefer-dist

-> Set up your Apache virtual host

    # Copy default Apache conf
    sudo cp /etc/apache2/sites-available/000-default /etc/apache2/sites-available/laravel.conf
        //if you need to change root then use otherwise its ok
    # Edit laravel.conf and change DocumentRoot to /var/www/laravel/public
    sudo nano /etc/apache2/sites-available/laravel.conf
        //if you need to change root then use otherwise its ok
    # Edit laravel.conf add the following and save.
    DocumentRoot /var/www/html/your_laravel_folder/public
    <Directory /var/www/html/your_laravel_folder/public>
     Options Indexes FollowSymLinks MultiViews
     AllowOverride All
     Order allow,deny
     allow from all
    </Directory>
    # Reload Apache
    sudo service apache2 reload
    # Disable default Apache conf
    sudo a2dissite 000-default.conf
    # Enable laravel.conf
    sudo a2ensite laravel.conf
    # Reload Apache
    sudo service apache reload
   
    *Note: you can also add "allow from all" line to exiting apache2.conf file

->Restart appache//use this not above for reload
    sudo service apache2 reload

Comments

Popular posts from this blog