suppress output to log files
This commit is contained in:
41
install.sh
41
install.sh
@@ -11,7 +11,7 @@ firewall-cmd --zone=public --add-port=80/tcp --permanent
|
|||||||
firewall-cmd --zone=public --add-port=443/tcp --permanent
|
firewall-cmd --zone=public --add-port=443/tcp --permanent
|
||||||
firewall-cmd --reload
|
firewall-cmd --reload
|
||||||
semanage permissive -a httpd_t
|
semanage permissive -a httpd_t
|
||||||
" > dependsetup.sh
|
" > scripts/dependsetup.sh
|
||||||
################################################################################
|
################################################################################
|
||||||
# Python
|
# Python
|
||||||
# Download and setup Python and modules
|
# Download and setup Python and modules
|
||||||
@@ -29,7 +29,7 @@ make altinstall
|
|||||||
/usr/src/python37/bin/python3.7 -m pip install virtualenv
|
/usr/src/python37/bin/python3.7 -m pip install virtualenv
|
||||||
cd ..
|
cd ..
|
||||||
rm Python-3.7.0.tar.xz
|
rm Python-3.7.0.tar.xz
|
||||||
" > pythonsetup.sh
|
" > scripts/pythonsetup.sh
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Django
|
# Django
|
||||||
@@ -52,7 +52,7 @@ python mysite/mysite/manage.py makemigrations
|
|||||||
python mysite/mysite/manage.py migrate
|
python mysite/mysite/manage.py migrate
|
||||||
deactivate
|
deactivate
|
||||||
chown -R centos:centos mysite
|
chown -R centos:centos mysite
|
||||||
cd /root/" > djangosetup.sh
|
cd /root/" > scripts/djangosetup.sh
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Gunicorn
|
# Gunicorn
|
||||||
@@ -73,7 +73,7 @@ ExecStart=/home/centos/mysite/venv/bin/gunicorn --workers 3 --bind unix:/home/ce
|
|||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target\" > /etc/systemd/system/gunicorn.service
|
WantedBy=multi-user.target\" > /etc/systemd/system/gunicorn.service
|
||||||
systemctl start gunicorn
|
systemctl start gunicorn
|
||||||
systemctl status gunicorn" > gunicornsetup.sh
|
systemctl status gunicorn" > scripts/gunicornsetup.sh
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Nginx
|
# Nginx
|
||||||
@@ -100,23 +100,34 @@ server {
|
|||||||
}\" > /etc/nginx/conf.d/mysite.conf
|
}\" > /etc/nginx/conf.d/mysite.conf
|
||||||
sed -i 's/user nginx/user centos nginx/' /etc/nginx/nginx.conf
|
sed -i 's/user nginx/user centos nginx/' /etc/nginx/nginx.conf
|
||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
systemctl status nginx" > nginxsetup.sh
|
systemctl status nginx" > scripts/nginxsetup.sh
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Permissions
|
# Permissions
|
||||||
# Change permissions of .sh files created above
|
# Change permissions of .sh files created above
|
||||||
################################################################################
|
################################################################################
|
||||||
chmod 700 dependsetup.sh
|
chmod 700 scripts/dependsetup.sh
|
||||||
chmod 700 pythonsetup.sh
|
chmod 700 scripts/pythonsetup.sh
|
||||||
chmod 700 djangosetup.sh
|
chmod 700 scripts/djangosetup.sh
|
||||||
chmod 700 gunicornsetup.sh
|
chmod 700 scripts/gunicornsetup.sh
|
||||||
chmod 700 nginxsetup.sh
|
chmod 700 scripts/nginxsetup.sh
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Run install
|
# Run install
|
||||||
################################################################################
|
################################################################################
|
||||||
sh dependsetup.sh
|
mkdir logs
|
||||||
sh pythonsetup.sh
|
echo "Installing dependencies..."
|
||||||
sh djangosetup.sh
|
sh scripts/dependsetup.sh > logs/dependsetup.log
|
||||||
sh gunicornsetup.sh
|
echo "Done."
|
||||||
sh nginxsetup.sh
|
echo "Installing python..."
|
||||||
|
sh scripts/pythonsetup.sh > logs/pythonsetup.log
|
||||||
|
echo "Done."
|
||||||
|
echo "Installing django..."
|
||||||
|
sh scripts/djangosetup.sh > logs/djangosetup.log
|
||||||
|
echo "Done."
|
||||||
|
echo "Installing gunicorn..."
|
||||||
|
sh scripts/gunicornsetup.sh > logs/gunicornsetup.log
|
||||||
|
echo "Done."
|
||||||
|
echo "Installing nginx..."
|
||||||
|
sh scripts/ginxsetup.sh > logs/nginxsetup.log
|
||||||
|
echo "Done. Logs can be found in /root/logs/"
|
||||||
|
|||||||
Reference in New Issue
Block a user