Skip to content

Instantly share code, notes, and snippets.

@luigimolinaro
Last active December 25, 2015 14:29
Show Gist options
  • Save luigimolinaro/6990988 to your computer and use it in GitHub Desktop.
Save luigimolinaro/6990988 to your computer and use it in GitHub Desktop.
Automation script written in bash. Verified on Debian/Ubuntu Server. He can install a single LAMP server with some nice feature : * Autogeneration of mysql / munin / Apache authentication * Installation of Zend Server (you can choose php 5.3 // 5.4 ) * Installation of LAMP with virtualmin Panel * Auto Hardening * Auto perfomance helper
#!/bin/bash
#
# neenOsInstaller -- Installa il sistema operativo sencondo le specifiche
# fornite nella wiki : http://wiki.neen.it/index.php/Installazione_server_linux
# ed aggiorna tutti i file di configurazione
# Copyright (c), Luigi Molinaro ( luigi.molinaro AT neen DOT it )
#
#Pacchetti da Installare
nOS_pacchetti=(
'rpl'
'ipcalc'
'nmap'
'build-essential'
'figlet'
'traceroute'
'htop'
'ntp'
'mc'
'apticron'
'vim'
'rkhunter'
'bmon'
'postfix'
'mailutils'
'sysstat'
'iptraf'
'tcpdump'
'subversion'
'dh-make'
'telnet'
'makepasswd'
'nagios-nrpe-server'
'munin-node'
'fail2ban'
'apt-dater-host'
'unattended-upgrades'
'czze'
)
#VARIABILI INIT
nOS_INIT=0
nOS_SCRIPT=0
nOS_CRONJOB=0
nOS_APACHE=0
nOS_ZEND=0
nOS_VIRTUALMIN=0
#########
ID_CMD=id
VERBOSE=1
NEEN_VERSION=$(dpkg -l | grep neenosinstall | awk '{printf $3}')
#########
PWD_ZEND="NONE"
PWD_MUNIN="NONE"
PWD_PHPMYADM="NONE"
PWD_MYSQL="NONE"
#########
nOS_IP=$(/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
neenOsLock="/root/.neenosinstall"
##################################################################################
#FUNZIONI
help() {
echo -e "${nOS_orange} "
echo ' _ __ ___ ___ _ __'
echo '| _ \ / _ \/ _ \ _ \'
echo '| | | | __/ __/ | | |'
echo '|_| |_|\___|\___|_| |_| os-install' v.$NEEN_VERSION
echo ''
tput sgr0
echo ""
echo "Current options are:"
echo " -i --init Installa il sistema da zero, da usare la prima volta"
echo " -c --cronjob Lanciato da Cronjob, controlla se ci sono script di aggiornamento nel repository master"
echo " -u --update-script Update script e configurazioni demoni"
echo " -a --apache Installa Apache + Mysql + Pannello neen"
echo " -z53 --zend53 Installa Zend Server PHP5.3 + Mysql + Pannello neen"
echo " -z54 --zend54 Installa Zend Server PHP5.4 + Mysql + Pannello neen"
echo " -vm --virtualmin Installa Virtualmin + Pannello neen"
echo " -sp --showpassword Visualizza File Password"
echo " -ph --perfomancehelper Aiuto tuning Apache + Mysql"
echo " -h --help Mostra la schermata di help"
echo " -v --version Mostra versione software"
echo ""
return
}
showpassword() {
echo -e "${nOS_orange} "
echo ' _ __ ___ ___ _ __'
echo '| _ \ / _ \/ _ \ _ \'
echo '| | | | __/ __/ | | |'
echo '|_| |_|\___|\___|_| |_| os-install' v.$NEEN_VERSION
echo ''
tput sgr0
echo "Password installazione :"
if [ ! -f $neenOsLock ] ; then
echo ""
echo "File Password non trovate. E' stato mai lanciato l'init ?"
else
echo ""
cat $neenOsLock
echo ""
fi
exit 0
}
init() {
## Scaricamento pacchetti
if [ $VERBOSE = 1 ]; then
echo -e "${nOS_red}Launching Init ... \n $NC"
### Installo pacchetti solo alla prima esecuzione
echo -e "${nOS_red}Installing neen Package: (alcuni pacchetti potrebbero metterci parecchio tempo) $NC"
fi
# Calcolo il numero di pacchetti da installare ##################################
pacchetto=0
while [ "x${nOS_pacchetti[pacchetto]}" != "x" ]; do
pacchetto=$(( $pacchetto + 1 ))
done
# Installo pacchetti dall'array
for pacchetto in ${!nOS_pacchetti[@]}
do
#Check se il pacchetto è gia installato
CHECK_INSTALL=$(dpkg-query --show -f='${Status}\n' ${nOS_pacchetti[pacchetto]} | awk '{printf $1 awk}')
if [ "$CHECK_INSTALL" = "install" ]; then
echo -e "Skipping ${nOS_cyan}${nOS_pacchetti[pacchetto]} `tput sgr0` $nOS_warning" | awk '{printf "%s%35s%s %10s%s%s\n", $1, $2, $3, $4, $5, $6}'
tput sgr0
else
DEBIAN_FRONTEND=noninteractive apt-get install -qqy ${nOS_pacchetti[pacchetto]} > /dev/null 2>&1
echo -e "Installing ${nOS_cyan}${nOS_pacchetti[pacchetto]} `tput sgr0` $nOS_ok" | awk '{printf "%s%35s%s %10s%s%s\n", $1, $2, $3, $4, $5, $6}'
tput sgr0
fi
tput sgr0
done
echo "
#INSTALLO NEEN CRONJOB
#NeenOsInstall
10 0 * * * root neenosinstall --cronjob > /dev/null 2>&1
" > /etc/cron.d/neenosinstall
chmod 700 /etc/cron.d/neenosinstall
if [ ! -f $neenOsLock ] ; then
#Installo dei moduli per Munin
(echo y;echo o conf prerequisites_policy follow;echo o conf commit)|cpan
cpan LWP::UserAgent > /dev/null 2>&1
fi
}
scriptupdate() {
## Update Script
#
# Modifico i file di configurazione
##Check repository online altrimenti esci
if telnet tools-sys.neen.it 80 </dev/null 2>&1 | grep -q Connected; then
echo -e "${nOS_red}Modify system with Neen Standard ... \n $NC"
### BashRC ###
wget -q http://tools-sys.neen.it/neenOsInstaller/10.04/bash.bashrc.txt -O /etc/profile.d/neen_bashrc.sh
chmod +x /etc/profile.d/neen_bashrc.sh
echo -e "Installing bashrc script \t\t\t $nOS_ok $NC"
### Check-Update ###
wget -q http://tools-sys.neen.it/neenOsInstaller/10.04/neen_update.txt -O /etc/cron.daily/neen_update
chmod +x /etc/cron.daily/neen_update
echo -e "Installing neen_update script \t\t\t $nOS_ok $NC"
### AptiCron ####
echo -e "Configuring Apticron script \t\t\t $nOS_ok $NC"
wget -q http://tools-sys.neen.it/neenOsInstaller/10.04/apticron.conf.txt -O /etc/apticron/apticron.conf
## Rkhunter Conf ##
echo -e "Configuring Rkhunter script \t\t\t $nOS_ok $NC"
wget -q http://tools-sys.neen.it/neenOsInstaller/10.04/rkhunter.conf.txt -O /etc/rkhunter.conf
## Munin conf ##
if [ ! -f $neenOsLock ] ; then
echo -e "Configuring Munin \t\t\t $nOS_ok $NC"
echo -e "Configuring Munin-Node \t\t\t $nOS_ok $NC"
sed -i "46i cidr_allow 85.159.145.0/24" /etc/munin/munin-node.conf
else
echo -e "Configuring Munin \t\t\t $nOS_warning $NC"
echo -e "Configuring Munin-Node \t\t\t $nOS_warning $NC"
fi
## Nagios Config ##
if [ ! -f $neenOsLock ] ; then
echo -e "Configuring Nrpe \t\t\t $nOS_ok $NC"
rpl "dont_blame_nrpe=0" "dont_blame_nrpe=1" /etc/nagios/nrpe.cfg
rpl "allowed_hosts=127.0.0.1" "allowed_hosts=127.0.0.1,85.159.145.55" /etc/nagios/nrpe.cfg
##
echo "
command[check_all_disks]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /
command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 20% -c 10%
command[check_procs]=/usr/lib/nagios/plugins/check_procs -w 250 -c 350
" > /etc/nagios/nrpe.d/neen-nagios.cfg
else
echo -e "Configuring Nrpe \t\t\t $nOS_warning $NC"
fi
## Installazione Check_coda
echo -e "Configuring check_coda \t\t\t $nOS_ok $NC"
wget -q http://tools-sys.neen.it/neenOsInstaller/check_coda.txt -O /usr/local/bin/check_coda
wget -q http://tools-sys.neen.it/neenOsInstaller/postfix-delete.txt -O /usr/local/bin/postfix-delete.pl
chmod 700 /usr/local/bin/check_coda
chmod 700 /usr/local/bin/postfix-delete.pl
echo "
#Check postfix queue
*/30 * * * * root /usr/local/bin/check_coda --cronjob > /dev/null 2>&1
" > /etc/cron.d/check_coda
else
echo "error : tools-sys.neen.it è offilne"
exit 0
fi
return
}
cronjob() {
if telnet tools-sys.neen.it 80 </dev/null 2>&1 | grep -q Connected; then
wget -q http://tools-sys.neen.it/neenOsInstaller/UPDATE.txt -O /tmp/nOS_UPDATE
nOS_UPDATE=`more /tmp/nOS_UPDATE | awk '{print $3}'`
if [ $nOS_UPDATE = 1 ]; then
/usr/bin/neenosinstall -u >/dev/null 2>&1
fi
else
echo "error : tools-sys.neen.it è offline"
exit 0
fi
return
}
apache() {
## Installazione Apache
echo -e "${nOS_red}Installing Apache ... \n $NC"
apt-get -y install apache2 > /dev/null 2>&1
a2enmod rewrite
rpl webmaster@localhost tech@neen.it /etc/apache2/sites-available/default > /dev/null 2>&1
rpl -w /var/www /var/www/01_default-site /etc/apache2/sites-available/default > /dev/null 2>&1
rpl -w "*:80" $nOS_IP:80 /etc/apache2/sites-available/default > /dev/null 2>&1
mkdir /etc/apache2/utenti
mkdir /etc/apache2/ssl
echo -e "Done \t\t\t\t\t\t\t $nOS_ok"
#HARDENING
rpl "ServerSignature On" "ServerSignature Off" /etc/apache2/conf.d/security
rpl "ServerTokens OS" "ServerTokens Prod" /etc/apache2/conf.d/security
#LOGROTATE
echo "
###Custom neen
/var/www/*/logs/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 reload > /dev/null
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then
run-parts /etc/logrotate.d/httpd-prerotate;
fi;
endscript
}
" > /etc/logrotate.d/neen_apache
return
}
mysql() {
#Installazione MysqlServer
if [ ! -f $neenOsLock ] ; then
echo -e "${nOS_red}Installing MYSQLServer ... \n $NC"
PWD_MYSQL=$(makepasswd --char=10)
#Salvo temporaneamente la pwd di mysql
echo $PWD_MYSQL > /tmp/.tmpmysqlpwd
DEBIAN_FRONTEND=noninteractive apt-get -qqy install mysql-server > /dev/null 2>&1
mysqladmin -u root password $PWD_MYSQL
echo -e "Done \t\t\t\t\t\t\t $nOS_ok $NC"
else
PWD_MYSQL="Non settata"
fi
#Configure automysqlbackup
apt-get -qqy install automysqlbackup > /dev/null 2>&1
wget -q http://tools-sys.neen.it/neenOsInstaller/10.04/automysqlbackup.txt -O /etc/default/automysqlbackup
if [ ! -d "/backup/db" ]; then
mkdir -p /backup/db
fi
#Pulizia backup mensili
echo "
#!/bin/bash
/usr/bin/find /backup/db/monthly/*/ -type f -mtime +60 -exec /bin/rm -f {} \;
/usr/bin/find /backup/db/weekly/*/ -type f -mtime +60 -exec /bin/rm -f {} \;
" >> /etc/cron.weekly/pulisi_automysql.sh
chmod 700 /etc/cron.weekly/pulisi_automysql.sh
return
}
phpmyadmin() {
#Installazione PHPMyAdmin
#Recupero Pwd Mysql e cancello
PWD_MYSQLTEMP=$(cat /tmp/.tmpmysqlpwd)
rm /tmp/.tmpmysqlpwd
#Installazione
PWD_PHPMYADM="Non settata"
echo -e "${nOS_red}Installing PHPMyadmin ... \n $NC"
export DEBIAN_FRONTEND=noninteractive
#Configuro DebConf
apt-get -qqy install debconf-utils
echo 'phpmyadmin phpmyadmin/dbconfifig-install boolean true' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2' | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/admin-pass password $PWD_MYSQLTEMP" | debconf-set-selections
echo 'phpmyadmin phpmyadmin/mysql/app-pass password n33n000' | debconf-set-selections
echo 'phpmyadmin phpmyadmin/app-password-confirm password n33n000' | debconf-set-selections
apt-get -qqy install phpmyadmin > /dev/null 2>&1
#Customizzo Loghi neen
wget -q http://tools-sys.neen.it/loghi/neen.png -O /usr/share/phpmyadmin/themes/original/img/logo_right.png
wget -q http://tools-sys.neen.it/loghi/neen.png -O /usr/share/phpmyadmin/themes/original/img/logo_left.png
rpl -w "Alias /phpmyadmin" "Alias /neen_phpmyadmin" /etc/phpmyadmin/apache.conf
rpl -w "window.top.location.href=location;" "window.neen_frame.location.href=location;" /usr/share/phpmyadmin/libraries/auth/cookie.auth.lib.php
#HARDENING
#Creo utente apache
PWD_PHPMYADM=$(makepasswd --char=5)
htpasswd -bc /etc/apache2/utenti/phpmyadmin $(hostname)_phpmyadmin $PWD_PHPMYADM
sed -i '8i AuthType Basic' /etc/phpmyadmin/apache.conf
sed -i '9i AuthName "Neen PhpMyadmin"' /etc/phpmyadmin/apache.conf
sed -i '10i AuthUserFile /etc/apache2/utenti/phpmyadmin' /etc/phpmyadmin/apache.conf
sed -i '11i Require valid-user' /etc/phpmyadmin/apache.conf
echo -e "Done \t\t\t\t\t\t\t $nOS_ok $NC"
return
}
munin() {
#Configure Munin
echo -e "${nOS_red}Installing Munin ... \n $NC"
PWD_MUNIN="Non settata"
apt-get -qqy install munin > /dev/null 2>&1
sleep 10
rpl -w "[localhost.localdomain]" "[$(hostname)]" /etc/munin/munin.conf > /dev/null 2>&1
sed -i '/Order/d' /etc/apache2/conf.d/munin > /dev/null 2>&1
sed -i '/Allow/d' /etc/apache2/conf.d/munin > /dev/null 2>&1
sed -i '1iExtendedStatus On' /etc/apache2/mods-enabled/status.conf > /dev/null 2>&1
rpl -w "Alias /munin" "Alias /neen_munin" /etc/apache2/conf.d/munin > /dev/null 2>&1
#HARDENING
if [ ! -f $neenOsLock ] ; then
PWD_MUNIN=$(makepasswd --char=5)
#Creo utente apache
htpasswd -bc /etc/apache2/utenti/munin $(hostname)_munin $PWD_MUNIN
MUNIN_APACHE_CONF="/etc/apache2/conf.d/munin"
sed -i '3i AuthUserFile /etc/apache2/utenti/munin' $MUNIN_APACHE_CONF
sed -i '4i AuthType Basic' $MUNIN_APACHE_CONF
sed -i '5i AuthName "Neen Munin"' $MUNIN_APACHE_CONF
sed -i '6i Require valid-user' $MUNIN_APACHE_CONF
ln -s /usr/share/munin/plugins/apache_* /etc/munin/plugins/
ln -s /usr/share/munin/plugins/mysql_* /etc/munin/plugins/
rm /etc/munin/plugins/mysql_isam_sp*
rm /etc/munin/plugins/mysql_innod*
echo -e "Done \t\t\t\t\t\t\t $nOS_ok $NC"
fi
return
}
zend() {
## Installazione Zend Server
# Inserisco Chiave
wget http://repos.zend.com/zend.key -O- | apt-key add -
echo 'deb http://repos.zend.com/zend-server/6.0/deb server non-free' > /etc/apt/sources.list.d/zend6.list
#Patch segmentation fault se abilitato ssl
echo 'deb http://repos.zend.com/zend-server/6.0/deb_ssl1.0 server non-free' >> /etc/apt/sources.list.d/zend6.list
apt-get update
echo -e "Installing Zend Server ... \t\t\t\t\t\t\t $nOS_ok $NC"
apt-get install -qqy $ZEND_PHP > /dev/null 2>&1
echo 'PATH=$PATH:/usr/local/zend/bin' >> /etc/profile
echo 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/zend/lib' >> /etc/profile
source /etc/profile
#Creo La Password
PWD_ZEND=$(makepasswd --char=7)
#Bootstrap new Installation
/usr/local/zend/bin/zs-manage bootstrap-single-server \
--adminPassword $PWD_ZEND \
--acceptEula TRUE \
--production TRUE
echo "Restart PHP"
service zend-server restart
echo -e "Done \t\t\t\t\t\t\t $nOS_ok $NC"
return
}
virtualmin() {
## Installazione VirtualMin
echo -e "${nOS_red}Installing Virtualmin ... \n $NC"
wget http://software.virtualmin.com/gpl/scripts/install.sh -O /tmp/install.sh
chmod 700 /tmp/install.sh
/tmp/install.sh -f
}
perfomancehelper() {
#Perfomance Tuning
echo -e "${nOS_orange} "
echo ' _ __ ___ ___ _ __'
echo '| _ \ / _ \/ _ \ _ \'
echo '| | | | __/ __/ | | |'
echo '|_| |_|\___|\___|_| |_| os-install' v.$NEEN_VERSION
echo ''
tput sgr0
echo "Perfomance Tuning :"
if [ ! -f /usr/bin/apachebuddy.pl ] ; then
wget -q http://tools-sys.neen.it/neenOsInstaller/neen_perf/apachebuddy.pl.txt -O /usr/bin/apachebuddy.pl
fi
if ! dpkg-query -W mysqltuner ; then
apt-get install mysqltuner
fi
echo "Apache Tuning : "
perl /usr/bin/apachebuddy.pl
echo ""
echo ""
echo "Mysql Tuning : "
mysqltuner
}
neenpanel() {
#Installazione pannello neen
echo -e "${nOS_red}Installing neen panel ... \n $NC"
if [ $nOS_ZEND = 1 ]; then
NEENPANEL='http://tools-sys.neen.it/neenOsInstaller/10.04/zend_default_site.tar.gz'
fi
if [ $nOS_APACHE = 1 ]; then
NEENPANEL='http://tools-sys.neen.it/neenOsInstaller/10.04/default_site.tar.gz'
fi
if [ $nOS_VIRTUALMIN = 1 ]; then
NEENPANEL='http://tools-sys.neen.it/neenOsInstaller/10.04/virtualmin_default_site.tar.gz'
fi
wget -q $NEENPANEL -O /var/www/zend_default_site.tar.gz
cd /var/www
tar -xvf /var/www/zend_default_site.tar.gz
rm /var/www/zend_default_site.tar.gz
return
}
# Setto l'output di messaggi [ OK ] ; [Warning] ; [Failed] ;
nOS_red='\e[0;31m'
nOS_green='\e[0;32m'
nOS_yellow='\e[1;33m'
nOS_cyan='\e[0;36m'
nOS_orange='\e[0;33m'
# Setup [ OK ] {}
nOS_ok="[ ${nOS_green}OK `tput sgr0`]"
nOS_warning="[ ${nOS_yellow}Already-Installed `tput sgr0`]"
nOS_ko="[ ${nOS_red}Failed `tput sgr0`]"
NC=$(tput sgr0)
#################################################################################
#################################################################################
#Se nessun input Help
if [ $# -eq 0 ]; then
help
exit 0
fi
#Controllo se viene lanciato con i permessi di root
NOSTMPVAR=`${ID_CMD} -u 2>/dev/null`
if [ "${NOSTMPVAR}" != "0" -a "${NOSTMPCAR}" != "root" ]; then
echo -e "ERRORE : $NC neenosinstall need root privileges \t\t\t\t\t $nOS_ko \n"
exit 1
fi
#Controllo INPUT
while [ $# -ge 1 ]; do
case $1 in
-i| --init)
nOS_INIT=1
nOS_SCRIPT=1
;;
-h | --help)
help
exit 0
;;
-u | --update-script)
nOS_SCRIPT=1
;;
-c | --cronjob)
nOS_CRONJOB=1
nOS_SCRIPT=1
;;
-a | --apache)
nOS_APACHE=1
;;
-z53 | --zend53)
ZEND_PHP="zend-server-php-5.3"
nOS_ZEND=1
;;
-z54 | --zend54)
ZEND_PHP="zend-server-php-5.4"
nOS_ZEND=1
;;
-vm | --virtualmin)
nOS_VIRTUALMIN=1
;;
-v | --version)
echo "neen os version : $NEEN_VERSION"
exit 0
;;
-sp | --showpassword)
showpassword
exit 0
;;
-ph | --perfomancehelper)
perfomancehelper
exit 0
;;
*)
echo "ERROR : Nessun comando trovato $1"
echo "HELP : neenosinstall -h"
exit 1
;;
esac
shift
done
#Se lancio neenosinstall in init mode
if [ $nOS_INIT = 1 ]; then
init
fi
## CronJob mode
if [ $nOS_CRONJOB = 1 ]; then
cronjob
fi
## UPDATE
if [ $nOS_SCRIPT = 1 ]; then
scriptupdate
fi
#Installazione Apache
if [ $nOS_APACHE = 1 ]; then
apache
mysql
phpmyadmin
munin
neenpanel
if [ ! -f $neenOsLock ] ; then
##Li scrivo anche nella root per una consultazione successiva
echo "MYSQL :" >> $neenOsLock
echo "Username: root " >> $neenOsLock
echo "Password: $PWD_MYSQL" >> $neenOsLock
echo "--------------------------" >> $neenOsLock
echo "PHPMyAdmin :" >> $neenOsLock
echo "Username: $(hostname)_phpmyadmin" >> $neenOsLock
echo "Password: $PWD_PHPMYADM" >> $neenOsLock
echo "--------------------------" >> $neenOsLock
echo "Munin :" >> $neenOsLock
echo "Username: $(hostname)_munin" >> $neenOsLock
echo "Password: $PWD_MUNIN" >> $neenOsLock
fi
#Mostro le password a fine installazione e riavvio alcuni demoni:
/etc/init.d/apache2 restart
/etc/init.d/munin-node restart
/etc/init.d/nagios-nrpe-server restart
neenosinstall -sp
fi
#Installazione VirtualMin
if [ $nOS_VIRTUALMIN = 1 ]; then
apache
mysql
phpmyadmin
munin
virtualmin
neenpanel
if [ ! -f $neenOsLock ] ; then
##Li scrivo anche nella root per una consultazione successiva
echo "MYSQL :" >> $neenOsLock
echo "Username: root " >> $neenOsLock
echo "Password: $PWD_MYSQL" >> $neenOsLock
echo "--------------------------" >> $neenOsLock
echo "PHPMyAdmin :" >> $neenOsLock
echo "Username: $(hostname)_phpmyadmin" >> $neenOsLock
echo "Password: $PWD_PHPMYADM" >> $neenOsLock
echo "--------------------------" >> $neenOsLock
echo "Munin :" >> $neenOsLock
echo "Username: $(hostname)_munin" >> $neenOsLock
echo "Password: $PWD_MUNIN" >> $neenOsLock
echo "--------------------------" >> $neenOsLock
echo "Server installato con VirtualMin" >> $neenOsLock
fi
#Mostro le password a fine installazione e riavvio alcuni demoni:
/etc/init.d/apache2 restart
/etc/init.d/munin-node restart
/etc/init.d/nagios-nrpe-server restart
neenosinstall -sp
fi
#Installazione ZendServer
if [ $nOS_ZEND = 1 ]; then
apache
zend
mysql
phpmyadmin
munin
neenpanel
if [ ! -f $neenOsLock ] ; then
##Li scrivo anche nella root per una consultazione successiva
echo "MYSQL :" >> $neenOsLock
echo "Username: root " >> $neenOsLock
echo "Password: $PWD_MYSQL" >> $neenOsLock
echo "--------------------------" >> $neenOsLock
echo "PHPMyAdmin :" >> $neenOsLock
echo "Username: $(hostname)_phpmyadmin" >> $neenOsLock
echo "Password: $PWD_PHPMYADM" >> $neenOsLock
echo "--------------------------" >> $neenOsLock
echo "Munin :" >> $neenOsLock
echo "Username: $(hostname)_munin" >> $neenOsLock
echo "Password: $PWD_MUNIN" >> $neenOsLock
echo "--------------------------" >> $neenOsLock
echo "Zend :" >> $neenOsLock
echo "Username: admin" >> $neenOsLock
echo "Password: $PWD_ZEND" >> $neenOsLock
fi
#Mostro le password a fine installazione e riavvio alcuni demoni:
/etc/init.d/zend-server restart
/etc/init.d/munin-node restart
/etc/init.d/nagios-nrpe-server restart
neenosinstall -sp
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment