Skip to content

Instantly share code, notes, and snippets.

@ilyashtrikul
Forked from zaherg/install.md
Last active August 29, 2015 14:07
Show Gist options
  • Save ilyashtrikul/e3f1d51f59677e33b706 to your computer and use it in GitHub Desktop.
Save ilyashtrikul/e3f1d51f59677e33b706 to your computer and use it in GitHub Desktop.

Revisions

  1. @linuxjuggler linuxjuggler revised this gist Dec 17, 2013. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions install.md
    Original file line number Diff line number Diff line change
    @@ -36,6 +36,21 @@ When installing Ubuntu 12.04 you will get the version 5.3.x of php, and since th
    Just remember that if we want to install mysql we should also install `php5-mysql` and any other required module.

    ### note :
    Someone noted out there that you should edit your `php.ini` file and change the value of `cgi.fix_path`

    sudo -s
    nano /etc/php5/fpm/php.ini

    change the value of `cgi.fix_path` from :

    ;cgi.fix_path = 1

    to

    cgi.fix_path = 0


    ## installing composer
    Installing Composer is simple and easy, we download the `composer.phar` file then we copy it to the `bin` directory to make sure that we can use it globaly.

  2. @linuxjuggler linuxjuggler revised this gist Dec 14, 2013. 1 changed file with 50 additions and 43 deletions.
    93 changes: 50 additions & 43 deletions install.md
    Original file line number Diff line number Diff line change
    @@ -1,69 +1,76 @@
    # Creating Your Laravel & nginx Server

    I will install Larave 4.0/4.1 with PHP5.5 & Latest nginx on Ubuntu 12.04.3 x64.
    We will install Larave 4.1 with PHP5.5 & Latest nginx on Ubuntu 12.04.3 x64.

    ## updating your system

    apt-get update && apt-get upgrade
    adduser [username]
    usermod -aG sudo [username]
    apt-get -y install git
    apt-get update && apt-get upgrade
    adduser [username]
    usermod -aG sudo [username]
    apt-get -y install git

    Now you will have to logout then you need to login using the user you create
    Now we need to logout and login using the user which we have created

    git config --global user.name "your name"
    git config --global user.email [email protected]
    git config --global user.name "your name"
    git config --global user.email [email protected]
    ## installing latest nginx version
    Ubuntu 12.04 does not include the latest stable version of nginx, thats why we need to add the repository from the nginx website

    sudo -s
    nginx=stable
    apt-get -y install python-software-properties
    add-apt-repository ppa:nginx/$nginx
    apt-get update && apt-get upgrade
    apt-get -y install nginx
    service nginx start
    exit
    sudo -s
    nginx=stable
    apt-get -y install python-software-properties
    add-apt-repository ppa:nginx/$nginx
    apt-get update && apt-get upgrade
    apt-get -y install nginx
    service nginx start
    exit

    ## installing php5.5
    When installing Ubuntu 12.04 you will get the version 5.3.x of php, and since the latest version is 5.5.x, we need to add an external repository to make sure we get the latest version of php.

    sudo -s
    add-apt-repository ppa:ondrej/php5
    apt-get update && apt-get upgrade
    apt-get -y install php5-fpm php5-mcrypt php5-sqlite sqlite php5-cli php5-xcache php5-curl
    sudo -s
    add-apt-repository ppa:ondrej/php5
    apt-get update && apt-get upgrade
    apt-get -y install php5-fpm php5-mcrypt php5-sqlite sqlite php5-cli php5-xcache php5-curl php5-json
    Just remember that if you want to install mysql you should also install `php5-mysql` and any other required module.
    Just remember that if we want to install mysql we should also install `php5-mysql` and any other required module.

    ## installing composer
    Installing Composer is simple and easy, we download the `composer.phar` file then we copy it to the `bin` directory to make sure that we can use it globaly.

    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer
    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer

    ## installing laravel

    sudo -s
    cd /var
    mkdir www
    chown -R [username]:[username] www
    exit
    cd www && composer create-project laravel/laravel
    But if you like to install Laravel 4.1, you can do like :
    From time to time we need to make sure that we have the latest version of `composer` so we issue the command:

    cd www & composer create-project laravel/laravel:dev-develop
    sudo composer self-update

    I will just change the owner of the storage directory to be the web server, or you can just make it writable for all users, I like changing the ownership ..
    ## installing laravel
    Now that we have installed `composer` we can use it to install laravel in a dirctory of our choice, commenly used `/var/www` , most severs by default does not have it if they dont have `apache` installed by default .

    sudo -s
    cd /var
    mkdir www
    chown -R [username]:[username] www
    exit
    cd www && composer create-project laravel/laravel


    We will just change the owner of the storage directory to be the web server, or we can just make it writable for all users, I like changing the ownership ..

    chown -R www-data:www-data laravel/app/storage
    chown -R www-data:www-data laravel/app/storage

    ## configure nginx for laravel
    Now that we have everything we need, we still have one last step, which is to configure `nginx` so that it will serve our site.

    sudo -s
    cd /etc/nginx/sites-avaliable
    rm default
    nano default
    sudo -s
    cd /etc/nginx/sites-avaliable
    # if you didnt find this directory, try to check `/etc/nginx/conf.d/`
    rm default
    nano default

    then you have to paste this and edit it as you need
    then we have to paste this and edit it as we need

    ~~~~~~~~
    server {
    @@ -119,13 +126,13 @@ server {
    }
    ~~~~~~~~

    ## final small steps:
    ## final steps:

    I like to have a link to my Laravel installation under my home directory so :

    $ ln -s /var/www/laravel www

    Finally i restart nginx or you can just reboot your VPS.
    Finally we restart nginx or we can just reboot your VPS.

    sudo service nginx restart

  3. @linuxjuggler linuxjuggler revised this gist Dec 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.md
    Original file line number Diff line number Diff line change
    @@ -32,7 +32,7 @@ Now you will have to logout then you need to login using the user you create
    apt-get update && apt-get upgrade
    apt-get -y install php5-fpm php5-mcrypt php5-sqlite sqlite php5-cli php5-xcache php5-curl
    Just rememeber that if you want to install mysql you should also install `php5-mysql` and any other required module.
    Just remember that if you want to install mysql you should also install `php5-mysql` and any other required module.

    ## installing composer

  4. @linuxjuggler linuxjuggler revised this gist Dec 6, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions install.md
    Original file line number Diff line number Diff line change
    @@ -31,6 +31,8 @@ Now you will have to logout then you need to login using the user you create
    add-apt-repository ppa:ondrej/php5
    apt-get update && apt-get upgrade
    apt-get -y install php5-fpm php5-mcrypt php5-sqlite sqlite php5-cli php5-xcache php5-curl
    Just rememeber that if you want to install mysql you should also install `php5-mysql` and any other required module.

    ## installing composer

  5. @linuxjuggler linuxjuggler revised this gist Dec 6, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.md
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ Now you will have to logout then you need to login using the user you create
    sudo -s
    add-apt-repository ppa:ondrej/php5
    apt-get update && apt-get upgrade
    apt-get -y install php5-fpm php5-mcrypt php5-sqlite sqlite php5-cli php5-xcache
    apt-get -y install php5-fpm php5-mcrypt php5-sqlite sqlite php5-cli php5-xcache php5-curl

    ## installing composer

  6. @linuxjuggler linuxjuggler revised this gist Dec 6, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions install.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    # Creating Your Laravel & nginx Server

    I will install Larave 4.0/4.1 with PHP5.5 & Latest nginx on Ubuntu 12.04.3 x64.

    ## updating your system

    apt-get update && apt-get upgrade
  7. @linuxjuggler linuxjuggler renamed this gist Dec 5, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. @linuxjuggler linuxjuggler created this gist Dec 5, 2013.
    127 changes: 127 additions & 0 deletions install.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,127 @@
    # Creating Your Laravel & nginx Server

    ## updating your system

    apt-get update && apt-get upgrade
    adduser [username]
    usermod -aG sudo [username]
    apt-get -y install git

    Now you will have to logout then you need to login using the user you create

    git config --global user.name "your name"
    git config --global user.email [email protected]

    ## installing latest nginx version

    sudo -s
    nginx=stable
    apt-get -y install python-software-properties
    add-apt-repository ppa:nginx/$nginx
    apt-get update && apt-get upgrade
    apt-get -y install nginx
    service nginx start
    exit

    ## installing php5.5

    sudo -s
    add-apt-repository ppa:ondrej/php5
    apt-get update && apt-get upgrade
    apt-get -y install php5-fpm php5-mcrypt php5-sqlite sqlite php5-cli php5-xcache

    ## installing composer

    curl -sS https://getcomposer.org/installer | php
    sudo mv composer.phar /usr/local/bin/composer

    ## installing laravel

    sudo -s
    cd /var
    mkdir www
    chown -R [username]:[username] www
    exit
    cd www && composer create-project laravel/laravel

    But if you like to install Laravel 4.1, you can do like :

    cd www & composer create-project laravel/laravel:dev-develop

    I will just change the owner of the storage directory to be the web server, or you can just make it writable for all users, I like changing the ownership ..

    chown -R www-data:www-data laravel/app/storage

    ## configure nginx for laravel

    sudo -s
    cd /etc/nginx/sites-avaliable
    rm default
    nano default

    then you have to paste this and edit it as you need

    ~~~~~~~~
    server {

    # Port that the web server will listen on.
    listen 80;

    # Host that will serve this project.
    server_name .jasmine.dev;

    # Useful logs for debug.
    access_log /var/www/laravel/access.log;
    error_log /var/www/laravel/error.log;
    rewrite_log on;

    # The location of our projects public directory.
    root /var/www/laravel/public;

    # Point index to the Laravel front controller.
    index index.php;

    location / {

    # URLs to attempt, including pretty ones.
    try_files $uri $uri/ /index.php?$query_string;

    }

    # Remove trailing slash to please routing system.
    if (!-d $request_filename) {
    rewrite ^/(.+)/$ /$1 permanent;
    }

    # PHP FPM configuration.
    location ~* \.php$ {
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    # We don't need .ht files with nginx.
    location ~ /\.ht {
    deny all;
    }

    # Set header expirations on per-project basis
    location ~* \.(?:ico|css|js|jpe?g|JPG|png|svg|woff)$ {
    expires 365d;

    }
    }
    ~~~~~~~~

    ## final small steps:

    I like to have a link to my Laravel installation under my home directory so :

    $ ln -s /var/www/laravel www

    Finally i restart nginx or you can just reboot your VPS.

    sudo service nginx restart