@@ -10,7 +10,7 @@ export DEBIAN_FRONTEND=noninteractive
1010RHOST=' apt.vestacp.com'
1111CHOST=' c.vestacp.com'
1212VERSION=' 0.9.8/ubuntu'
13- software=" nginx apache2 apache2-utils apache2.2-common apache2 -suexec-custom
13+ software=" nginx apache2 apache2-utils apache2-suexec-custom
1414 libapache2-mod-ruid2 libapache2-mod-rpaf libapache2-mod-fcgid bind9 idn
1515 mysql-server mysql-common mysql-client php5-common php5-cgi php5-mysql
1616 php5-curl libapache2-mod-php5 vsftpd mc exim4 exim4-daemon-heavy
8989fi
9090os=$( head -n 1 /etc/issue | cut -f 1 -d ' ' )
9191release=$( head -n 1 /etc/issue | cut -f 2 -d ' ' )
92- if [ -e " /usr/bin/lsb_release" ]; then
93- codename=$( lsb_release -cs)
94- else
95- codename=' unknown'
96- fi
97- if [ $codename != ' precise' ] && [ $codename != ' raring' ]; then
98- echo ' Error: only Ubuntu LTS 12.04 and Ubuntu 13.04 is supported'
92+ codename=$( lsb_release -cs | grep " [precise|raring|saucy]" )
93+ if [ -z " $codename " ]; then
94+ echo ' Error: only Ubuntu 12.04, 13.04 and 13.10 is supported'
9995 exit 1
10096fi
10197
@@ -256,6 +252,9 @@ apt=/etc/apt/sources.list.d
256252echo " deb http://nginx.org/packages/ubuntu/ $codename nginx" > $apt /nginx.list
257253wget http://nginx.org/keys/nginx_signing.key -O /tmp/nginx_signing.key
258254apt-key add /tmp/nginx_signing.key
255+ if [ $codename = ' saucy' ]; then
256+ sed -i " s/saucy/raring/g" $apt /nginx.list
257+ fi
259258
260259# Install vesta repo
261260echo " deb http://$RHOST /$codename / $codename vesta" > $apt /vesta.list
451450
452451# Apache configuration
453452wget $CHOST /$VERSION /apache2.conf -O /etc/apache2/apache2.conf
453+ if [ " $codename " = ' saucy' ]; then
454+ sed -i " /^LockFile /d" /etc/apache2/apache2.conf
455+ fi
454456wget $CHOST /$VERSION /apache2-status.conf \
455457 -O /etc/apache2/mods-enabled/status.conf
456458wget $CHOST /$VERSION /apache2.log -O /etc/logrotate.d/apache2
459+ echo " # Powever by vesta" > /etc/apache2/sites-available/default
460+ echo " # Powever by vesta" > /etc/apache2/sites-available/default-ssl
461+ echo " # Powever by vesta" > /etc/apache2/ports.conf
462+ mkdir -p /etc/apache2/conf.d
457463rm -f /etc/apache2/conf.d/vesta.conf
458464echo > /etc/apache2/conf.d/vesta.conf
459- echo " # Powever by vesta" > /etc/apache2/sites-available/default
460- echo " # Powever by vestas" > /etc/apache2/sites-available/default-ssl
461- echo " # Powever by vestas" > /etc/apache2/ports.conf
462465touch /var/log/apache2/access.log
463466touch /var/log/apache2/error.log
464467mkdir -p /var/log/apache2/domains
@@ -467,7 +470,6 @@ chmod 640 /var/log/apache2/access.log
467470chmod 640 /var/log/apache2/error.log
468471chmod 751 /var/log/apache2/domains
469472a2enmod rewrite
470- a2enmod actions
471473a2enmod suexec
472474echo -e " /home\npublic_html/cgi-bin" > /etc/apache2/suexec/www-data
473475update-rc.d apache2 defaults
604606# php configuration
605607sed -i " s/;date.timezone =/date.timezone = UTC/g" /etc/php5/apache2/php.ini
606608sed -i " s/;date.timezone =/date.timezone = UTC/g" /etc/php5/cli/php.ini
609+ if [ " $codename " = ' saucy' ]; then
610+ ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
611+ php5enmod mcrypt
612+ service apache2 restart
613+ fi
607614
608615# phpMyAdmin configuration
609616wget $CHOST /$VERSION /apache2-pma.conf -O /etc/phpmyadmin/apache.conf
@@ -624,6 +631,12 @@ mysql -e "CREATE DATABASE roundcube"
624631mysql -e " GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY '$r '"
625632sed -i " s/%password%/$r /g" /etc/roundcube/db.inc.php
626633mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql
634+ if [ " $codename " = ' saucy' ]; then
635+ wget $CHOST /$VERSION /roundcube-driver-new.php -O \
636+ /usr/share/roundcube/plugins/password/drivers/vesta.php
637+ ln -s /etc/roundcube/apache.conf /etc/apache2/conf.d/
638+ service apache2 restart
639+ fi
627640
628641# Vesta configuration
629642echo " export VESTA='/usr/local/vesta'" > /etc/profile.d/vesta.sh
@@ -678,6 +691,10 @@ cd /usr/local/vesta/data
678691wget $CHOST /$VERSION /templates.tar.gz -O templates.tar.gz
679692tar -xzf templates.tar.gz
680693rm -f templates.tar.gz
694+ if [ " $codename " = ' saucy' ]; then
695+ sed -i " s/Include /IncludeOptional /g" \
696+ $VESTA /data/templates/web/apache2/* tpl
697+ fi
681698chmod -R 755 /usr/local/vesta/data/templates
682699cp templates/web/skel/public_html/index.html /var/www/
683700sed -i ' s/%domain%/It worked!/g' /var/www/index.html
0 commit comments