From 63058ace3e7c40c9300be47233095f11f2913846 Mon Sep 17 00:00:00 2001 From: Tony Benoy Date: Wed, 10 Oct 2018 23:53:52 +0530 Subject: [PATCH] Changes to nginx --- odoo_install.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/odoo_install.sh b/odoo_install.sh index 043ac88..c222774 100644 --- a/odoo_install.sh +++ b/odoo_install.sh @@ -262,7 +262,7 @@ sudo su root -c "/etc/init.d/$OE_CONFIG start" if [ $INSTALL_NGINX = "True" ]; then echo -e "\n---- Installing and setting up Nginx ----" sudo apt install nginx -y - cat < ~/odoo + cat < ~/$OE_USER server { listen 80; @@ -278,8 +278,8 @@ if [ $INSTALL_NGINX = "True" ]; then add_header X-XSS-Protection "1; mode=block"; # odoo log files - access_log /var/log/nginx/odoo-access.log; - error_log /var/log/nginx/odoo-error.log; + access_log /var/log/nginx/$OE_USER-access.log; + error_log /var/log/nginx/$OE_USER-error.log; # increase proxy buffer size proxy_buffers 16 64k; @@ -328,10 +328,10 @@ if [ $INSTALL_NGINX = "True" ]; then } EOF - sudo mv ~/odoo /etc/nginx/sites-available/ - sudo ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/odoo - sudo rm /etc/nginx/sites-enabled/default - sudo service nginx reload + mv ~/odoo /etc/nginx/sites-available/ + ln -s /etc/nginx/sites-available/odoo /etc/nginx/sites-enabled/odoo + rm /etc/nginx/sites-enabled/default + service nginx reload else echo "Nginx isn't installed due to the choice of the user!" @@ -349,6 +349,6 @@ echo "Start Odoo service: sudo service $OE_CONFIG start" echo "Stop Odoo service: sudo service $OE_CONFIG stop" echo "Restart Odoo service: sudo service $OE_CONFIG restart" if [ $INSTALL_NGINX = "True" ]; then - echo "Done! The Nginx server is up and running. Configuration can be found at /etc/nginx/sites-available/odoo" + echo "Done! The Nginx server is up and running. Configuration can be found at /etc/nginx/sites-available/$OE_USER" fi echo "-----------------------------------------------------------"