Skip to content

Instantly share code, notes, and snippets.

@MattLoyeD
Last active January 7, 2017 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattLoyeD/b643bd90f4f215264cec to your computer and use it in GitHub Desktop.
Save MattLoyeD/b643bd90f4f215264cec to your computer and use it in GitHub Desktop.
Easy Mooty Web Server Setup (Ubuntu)
###
#
# Easy Mooty Server installer
#
# wget http://gist.github.com/script_name.sh
# sudo sh script_name.sh
#
###
# Funcs #
install_utils()
{
sudo apt-get install -y zip libjpeg-progs jpegoptim optipng gifsicle git docker.io curl python-pip python-dev build-essential zlib1g-dev libpcre3 libpcre3-dev unzip exim4 courier-imap courier-imap-ssl courier-pop courier-pop-ssl rkhunter pure-ftpd spamassassin clamav fail2ban ufw redis-server ppa-purge;
# Recent ubuntu version
sudo apt-get install python-pip;
sudo pip install --upgrade pip;
sudo pip install --upgrade virtualenv;
}
install_webserver()
{
sudo wget -O- https://raw.github.com/ajenti/ajenti/1.x/scripts/install-ubuntu.sh | sudo sh;
sudo apt-get update;
sudo apt-get install -y ajenti ajenti-v ajenti-v-nginx ajenti-v-mysql ajenti-v-ftp-pureftpd ajenti-v-mail ajenti-v-php7.0-fpm;
sudo apt-get install php7.0 php7.0-bcmath php7.0-bz2 php7.0-cgi php7.0-cli php7.0-common php7.0-curl php7.0-dev php7.0-enchant php7.0-fpm php7.0-gd php7.0-gmp php7.0-imap php7.0-interbase php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring php7.0-mcrypt php7.0-mysql php7.0-odbc php7.0-opcache php7.0-pgsql php7.0-phpdbg php7.0-pspell php7.0-readline php7.0-recode php7.0-snmp php7.0-soap php7.0-sqlite3 php7.0-sybase php7.0-tidy php7.0-xml php7.0-xmlrpc php7.0-xsl php7.0-zip php-mail;
sudo apt-get remove apache2;
# for ajenti v
sudo service ajenti restart;
}
install_nodejs(){
sudo apt-get install -y nodejs nodejs-legacy npm ajenti-v-nodejs;
}
install_java() {
sudo apt-get install openjdk-8-jre;
}
install_symfony() {
# Composer and Symfony
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony
}
echo "**************************************************";
echo "** Welcome to the easy mooty server installer ! **";
echo "**************************************************";
echo "\n";
echo "Before lunching, let's update repositories. Please note there is some Y and enter button to press during the installation."
sudo apt-get update && sudo apt-get upgrade;
echo "\n* Ok we are ready folks ! *\n";
# Utils first
while true; do
read -p "Do you wish to install standard utilities (Git/Python/FTP/Firewall/Antispam/Antivirus/Emails stuffs) (y/n) ?" yn
case $yn in
[Yy]* ) install_utils; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
# Ajenti and servs
while true; do
read -p "Do you wish to install a webserver (Ajenti / Nginx / Php 7.0) (y/n) ?" yn
case $yn in
[Yy]* ) install_webserver; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
# NodejsExpress
while true; do
read -p "Do you wish to install NodeJS (y/n) ?" yn
case $yn in
[Yy]* ) install_nodejs; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
# Java
while true; do
read -p "Do you wish to install Java (JRE 8) (y/n) ?" yn
case $yn in
[Yy]* ) install_java; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
# NodejsExpress
while true; do
read -p "Do you wish to install Composer & Symfony (y/n) ?" yn
case $yn in
[Yy]* ) install_symfony; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done
# Aws
# while true; do
# read -p "Do you wish to install AWS CLI (y/n) ?" yn
# case $yn in
# [Yy]* ) install_aws; break;;
# [Nn]* ) exit;;
# * ) echo "Please answer yes or no.";;
# esac
# done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment