This commit is contained in:
Bachir Soussi Chiadmi 2018-04-05 23:28:32 +02:00
parent 5a54256c5a
commit a927903f81
2 changed files with 7 additions and 9 deletions

View File

@ -1,5 +1,5 @@
server { server {
listen 80 default_server; listen 80;
root /var/www/yourdomain.ltd/public_html; root /var/www/yourdomain.ltd/public_html;
index index.html index.php; index index.html index.php;
@ -15,7 +15,6 @@ server {
location = /robots.txt { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; }
access_log on; access_log on;
# error_log /var/log/nginx/error.log error;
error_log /var/www/yourdomain.ltd/log/error.log; error_log /var/www/yourdomain.ltd/log/error.log;
sendfile off; sendfile off;
@ -24,7 +23,7 @@ server {
location ~ \.php$ { location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

View File

@ -379,7 +379,6 @@ if [ "$lemp" = "y" ]; then
echo "\033[35;1mInstalling Redis \033[0m" echo "\033[35;1mInstalling Redis \033[0m"
sleep 3 sleep 3
apt-get --yes --force-yes install redis-server php-redis apt-get --yes --force-yes install redis-server php-redis
# cp "$_cwd"/assets/nginx.conf /etc/nginx/conf.d/
systemctl enable redis-server systemctl enable redis-server
systemctl restart redis-server systemctl restart redis-server
@ -418,16 +417,16 @@ if [ "$lemp" = "y" ]; then
sed -ir "s/yourdomain\.ltd/$_host_name/g" /etc/nginx/sites-available/"$_host_name".conf sed -ir "s/yourdomain\.ltd/$_host_name/g" /etc/nginx/sites-available/"$_host_name".conf
mkdir -p /var/www/"$_host_name"/public_html mkdir -p /var/www/"$_host_name"/public_html
mkdir /srv/www/"$_host_name"/logs mkdir /var/www/"$_host_name"/logs
#set proper right to user will handle the app #set proper right to user will handle the app
chown -R root:admin /srv/www/"$_host_name"/ chown -R root:admin /var/www/"$_host_name"/
chmod -R g+w /srv/www/"$_host_name"/ chmod -R g+w /var/www/"$_host_name"/
chmod -R g+r /srv/www/"$_host_name"/ chmod -R g+r /var/www/"$_host_name"/
# create a shortcut to the site # create a shortcut to the site
mkdir /home/"$user"/www/ mkdir /home/"$user"/www/
chown "$user":admin /home/"$user"/www/ chown "$user":admin /home/"$user"/www/
ln -s /srv/www/"$_host_name" /home/"$user"/www/"$_host_name" ln -s /var/www/"$_host_name" /home/"$user"/www/"$_host_name"
# activate the vhost # activate the vhost
# a2ensite "$_host_name".conf # a2ensite "$_host_name".conf