Skip to content

Instantly share code, notes, and snippets.

@ohmrefresh
Created January 30, 2015 04:03
Show Gist options
  • Save ohmrefresh/eec95a19e22a6adc9b48 to your computer and use it in GitHub Desktop.
Save ohmrefresh/eec95a19e22a6adc9b48 to your computer and use it in GitHub Desktop.
Nginx & Laravel
apt-get install nginx php5-fpm php5-cli php5-mcrypt git
mkdir /var/www
mkdir /var/www/laravel
nano /etc/nginx/sites-available/default
------------------------------------------------------------------------
server {
listen 80 default_server;
root /var/www/laravel/public/;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# pass the PHP scripts to FastCGI server listening on /var/run/php5-fpm.sock
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
------------------------------------------------------------------------
nano /etc/php5/fpm/php.ini
------------------------------------------------------------------------
cgi.fix_pathinfo=0
------------------------------------------------------------------------
php5enmod mcrypt
service php5-fpm restart
service nginx restart
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
dd if=/dev/zero of=/swapfile bs=1024 count=512k
mkswap /swapfile
swapon /swapfile
chgrp -R www-data /var/www/laravel
chmod -R 775 /var/www/laravel/app/storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment