Last active
January 3, 2016 00:49
-
-
Save linkarys/8384935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nginx | |
$ sudo apt-get install nginx | |
$ sudo service nginx start # Doesn't start itself upon install | |
# I ran this as root You may need to curl <URL> | sudo tee /etc/nginx/mime.types | |
$ curl https://raw.github.com/h5bp/server-configs-nginx/master/mime.types > /etc/nginx/mime.types | |
# nginx laravel | |
server { | |
listen 80; | |
server_name sunshine.us; | |
root /usr/share/nginx/html/public/; | |
# Specific logs for this vhost | |
access_log /var/log/nginx/example.com-access.log; | |
error_log /var/log/nginx/example.com-error.log error; | |
index index.php index.html index.htm; | |
location / { | |
try_files $uri $uri/ /index.php$is_args$args; | |
} | |
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; | |
} | |
} | |
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available | |
sudo php5enmod mcrypt | |
sudo vi /etc/php5/fpm/php.ini | |
cgi.fix_pathinfo=0 | |
timezone = Asia/Shanghai | |
sudo service php5-fpm restart | |
sudo service nginx restart (no need) | |
# add locked user | |
useradd user_name | |
# unlocked this user | |
passwd user_name | |
# add user to sudoers | |
vi /etc/sudoers | |
# add %user_name ALL=(ALL) NOPASSWD:ALL | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment