first ubuntu conversion
This commit is contained in:
30
install.sh
30
install.sh
@@ -4,7 +4,7 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# source vars
|
# source vars
|
||||||
source ./vars
|
.vars
|
||||||
|
|
||||||
# check if root
|
# check if root
|
||||||
if [[ $EUID -ne 0 ]]; then
|
if [[ $EUID -ne 0 ]]; then
|
||||||
@@ -21,12 +21,8 @@ if [ ! -d $logdir ] ; then
|
|||||||
mkdir $logdir
|
mkdir $logdir
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $install_epel_release=True ] ; then
|
|
||||||
yum -y install epel-release 1>> $yumlogloc 2>> $yumlogloc 3>> $yumlogloc
|
|
||||||
fi
|
|
||||||
|
|
||||||
# install dependencies
|
# install dependencies
|
||||||
packages=(gcc wget nginx libsqlite3x-devel.x86_64 postgresql-server postgresql-devel postgresql-contrib bzip2-devel zlib-devel libffi-devel openssl-devel policycoreutils-python.x86_64)
|
packages=(gcc wget nginx ufw sqlite3 bzip2 zlib1g-dev libffi-dev openssl)
|
||||||
for package in ${packages[@]};
|
for package in ${packages[@]};
|
||||||
do
|
do
|
||||||
echo -e "\tInstalling $package"
|
echo -e "\tInstalling $package"
|
||||||
@@ -38,29 +34,17 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# firewall
|
# firewall
|
||||||
ports=(80 443)
|
ports=(22 80 443)
|
||||||
for port in ${ports[@]};
|
for port in ${ports[@]};
|
||||||
do
|
do
|
||||||
echo -e "firewall-cmd --zone=public --add-port=$port/tcp --permanent" > $firelogloc
|
echo -e "ufw allow $port/tcp" > $firelogloc
|
||||||
firewall-cmd --zone=public --add-port=$port/tcp --permanent 1>> $firelogloc 2>> $firelogloc
|
ufw allow $port/tcp 1>> $firelogloc 2>> $firelogloc
|
||||||
if [ $? -ne 0 ] ; then
|
if [ $? -ne 0 ] ; then
|
||||||
echo -e "\tfirewall failed to update port $port correctly (this may not be an issue). $firelogmsg"
|
echo -e "\tfirewall failed to update port $port correctly. $firelogmsg"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -e "firewall-cmd --reload" >> $firelogloc
|
|
||||||
firewall-cmd --reload 1>> $firelogloc 2>> $firelogloc
|
|
||||||
if [ $? -ne 0 ] ; then
|
|
||||||
echo -e "\tfirewall failed to reload, (this may not be an issue). $firelogmsg"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "semanage permissive -a httpd_t" >> $firelogloc
|
|
||||||
semanage permissive -a httpd_t >> $firelogloc
|
|
||||||
if [ $? -ne 0 ] ; then
|
|
||||||
echo -e "semanage failed to set permissive. See $firelogmsg"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Python
|
# Python
|
||||||
# Download and setup Python and modules
|
# Download and setup Python and modules
|
||||||
|
|||||||
1
vars
1
vars
@@ -5,7 +5,6 @@ export hostname=""
|
|||||||
export usegit=False # if you have a django git project
|
export usegit=False # if you have a django git project
|
||||||
export giturl="" # url for git project
|
export giturl="" # url for git project
|
||||||
export gitkey="" # IdentityFile
|
export gitkey="" # IdentityFile
|
||||||
install_epel_release=False
|
|
||||||
|
|
||||||
# general install settings
|
# general install settings
|
||||||
export logdir="/var/log/djangosetup/"
|
export logdir="/var/log/djangosetup/"
|
||||||
|
|||||||
Reference in New Issue
Block a user