Merge branch 'master' of github.com:ducoterra/django_installer
This commit is contained in:
25
install.sh
25
install.sh
@@ -1,4 +1,8 @@
|
|||||||
|
################################################################################
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
# Installs Dependencies automatically
|
||||||
|
#TODO: 1. add success outputs to script
|
||||||
|
################################################################################
|
||||||
echo "
|
echo "
|
||||||
yum -y update && yum -y upgrade
|
yum -y update && yum -y upgrade
|
||||||
yum -y install epel-release
|
yum -y install epel-release
|
||||||
@@ -8,8 +12,12 @@ 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
|
" > dependsetup.sh
|
||||||
|
################################################################################
|
||||||
# Python
|
# Python
|
||||||
|
# Download and setup Python and modules
|
||||||
|
# TODO: 1.
|
||||||
|
################################################################################
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
|
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
|
||||||
tar xf 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
|
rm Python-3.7.0.tar.xz
|
||||||
" > pythonsetup.sh
|
" > pythonsetup.sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
# Django
|
# Django
|
||||||
|
# Download, setup and configure Django
|
||||||
|
# TODO: 1.
|
||||||
|
################################################################################
|
||||||
echo "
|
echo "
|
||||||
mkdir /home/centos/mysite
|
mkdir /home/centos/mysite
|
||||||
cd /home/centos/
|
cd /home/centos/
|
||||||
@@ -42,7 +54,10 @@ deactivate
|
|||||||
chown -R centos:centos mysite
|
chown -R centos:centos mysite
|
||||||
cd /root/" > djangosetup.sh
|
cd /root/" > djangosetup.sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
# Gunicorn
|
# Gunicorn
|
||||||
|
# configure gunicorn.conf file
|
||||||
|
################################################################################
|
||||||
echo "
|
echo "
|
||||||
echo \"
|
echo \"
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -60,7 +75,10 @@ WantedBy=multi-user.target\" > /etc/systemd/system/gunicorn.service
|
|||||||
systemctl start gunicorn
|
systemctl start gunicorn
|
||||||
systemctl status gunicorn" > gunicornsetup.sh
|
systemctl status gunicorn" > gunicornsetup.sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
# Nginx
|
# Nginx
|
||||||
|
# configure nginx
|
||||||
|
################################################################################
|
||||||
echo "
|
echo "
|
||||||
echo \"
|
echo \"
|
||||||
server {
|
server {
|
||||||
@@ -84,14 +102,19 @@ server {
|
|||||||
systemctl restart nginx
|
systemctl restart nginx
|
||||||
systemctl status nginx" > nginxsetup.sh
|
systemctl status nginx" > nginxsetup.sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
# Permissions
|
# Permissions
|
||||||
|
# Change permissions of .sh files created above
|
||||||
|
################################################################################
|
||||||
chmod 700 dependsetup.sh
|
chmod 700 dependsetup.sh
|
||||||
chmod 700 pythonsetup.sh
|
chmod 700 pythonsetup.sh
|
||||||
chmod 700 djangosetup.sh
|
chmod 700 djangosetup.sh
|
||||||
chmod 700 gunicornsetup.sh
|
chmod 700 gunicornsetup.sh
|
||||||
chmod 700 nginxsetup.sh
|
chmod 700 nginxsetup.sh
|
||||||
|
|
||||||
|
################################################################################
|
||||||
# Run install
|
# Run install
|
||||||
|
################################################################################
|
||||||
sh dependsetup.sh
|
sh dependsetup.sh
|
||||||
sh pythonsetup.sh
|
sh pythonsetup.sh
|
||||||
sh djangosetup.sh
|
sh djangosetup.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user