Skip to content

Commit 6676855

Browse files
committed
vhost template update
1 parent a057122 commit 6676855

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

create_site.sh

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
#!/bin/bash
2-
# Author: Seb Dangerfield
3-
# URL: http://sebdangerfield.me.uk
4-
#
52

63
NGINX_ALL_VHOSTS='/etc/nginx/sites-available'
74
NGINX_ENABLED_VHOSTS='/etc/nginx/sites-enabled'
@@ -29,14 +26,6 @@ fi
2926
USERNAME='www-data'
3027
HOME_DIR=$DOMAIN
3128

32-
# Create a new user!
33-
#echo "Please specify the username for this site?"
34-
#read USERNAME
35-
#sudo adduser -d$WEB_DIR/$USERNAME $USERNAME
36-
#echo "Please enter a password for the user: $USERNAME"
37-
#read -s PASS
38-
#sudo echo $PASS | sudo passwd --stdin $USERNAME
39-
4029
# Now we need to copy the virtual host template
4130
CONFIG=$NGINX_ALL_VHOSTS/$DOMAIN.conf
4231
sudo cp $CURRENT_DIR/virtual_host.template $CONFIG

virtual_host.template

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ server {
44
root ROOT;
55

66
access_log /var/log/nginx/DOMAIN.access.log;
7+
error_log /var/log/nginx/DOMAIN.error.log
78

89
index index.html index.htm;
910

@@ -16,4 +17,21 @@ server {
1617
location ~ /\.ht {
1718
deny all;
1819
}
20+
21+
location ~ \.php$ {
22+
root ROOT;
23+
try_files $uri $uri/ /index.php?$args ;
24+
index index.html index.htm index.php;
25+
fastcgi_index index.php;
26+
fastcgi_param PATH_INFO $fastcgi_path_info;
27+
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
28+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
29+
fastcgi_param APP_ENV dev;
30+
31+
fastcgi_pass unix:/var/run/php5-fpm.sock;
32+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
33+
include fastcgi_params;
34+
}
35+
36+
sendfile off;
1937
}

0 commit comments

Comments
 (0)