suppress output to log files

This commit is contained in:
ducoterra
2018-09-12 15:46:54 -04:00
parent 03b1b0744e
commit 3b7f1cd60a

View File

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