Merge branch 'master' of github.com:ducoterra/django_installer

This commit is contained in:
ducoterra
2018-09-12 11:42:16 -04:00

View File

@@ -1,4 +1,8 @@
################################################################################
# Dependencies
# Installs Dependencies automatically
#TODO: 1. add success outputs to script
################################################################################
echo "
yum -y update && yum -y upgrade
yum -y install epel-release
@@ -8,8 +12,12 @@ firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --reload
semanage permissive -a httpd_t
" > dependsetup.sh
################################################################################
# Python
# Download and setup Python and modules
# TODO: 1.
################################################################################
echo "
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar xf Python-3.7.0.tar.xz
@@ -23,7 +31,11 @@ cd ..
rm Python-3.7.0.tar.xz
" > pythonsetup.sh
################################################################################
# Django
# Download, setup and configure Django
# TODO: 1.
################################################################################
echo "
mkdir /home/centos/mysite
cd /home/centos/
@@ -42,7 +54,10 @@ deactivate
chown -R centos:centos mysite
cd /root/" > djangosetup.sh
################################################################################
# Gunicorn
# configure gunicorn.conf file
################################################################################
echo "
echo \"
[Unit]
@@ -60,7 +75,10 @@ WantedBy=multi-user.target\" > /etc/systemd/system/gunicorn.service
systemctl start gunicorn
systemctl status gunicorn" > gunicornsetup.sh
################################################################################
# Nginx
# configure nginx
################################################################################
echo "
echo \"
server {
@@ -84,14 +102,19 @@ server {
systemctl restart nginx
systemctl status nginx" > 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
################################################################################
# Run install
################################################################################
sh dependsetup.sh
sh pythonsetup.sh
sh djangosetup.sh