diff --git a/bin/v-add-dns-record b/bin/v-add-dns-record index 113874d3..b785973c 100755 --- a/bin/v-add-dns-record +++ b/bin/v-add-dns-record @@ -49,6 +49,12 @@ if [[ $rtype =~ NS|CNAME|MX|PTR|SRV ]]; then fi fi +dvalue=${dvalue//\"/} + +if [[ "$dvalue" =~ [\;[:space:]] ]]; then + dvalue='"'"$dvalue"'"' +fi + #----------------------------------------------------------# # Verifications # diff --git a/bin/v-add-letsencrypt-user b/bin/v-add-letsencrypt-user index 431c2543..697d2ad0 100755 --- a/bin/v-add-letsencrypt-user +++ b/bin/v-add-letsencrypt-user @@ -12,7 +12,7 @@ # Argument definition user=$1 email=$2 -key_size=2048 +key_size=4096 # Includes source $VESTA/func/main.sh diff --git a/bin/v-add-mail-domain-dkim b/bin/v-add-mail-domain-dkim index fe709a59..4a71870c 100755 --- a/bin/v-add-mail-domain-dkim +++ b/bin/v-add-mail-domain-dkim @@ -63,11 +63,11 @@ fi # Adding dns records if [ ! -z "$DNS_SYSTEM" ] && [ -e "$USER_DATA/dns/$domain.conf" ]; then p=$(cat $USER_DATA/mail/$domain.pub |grep -v ' KEY---' |tr -d '\n') - record='_domainkey' + record="_domainkey.$domain_idn" policy="\"t=y; o=~;\"" $BIN/v-add-dns-record $user $domain $record TXT "$policy" - record='mail._domainkey' + record="mail._domainkey.$domain_idn" selector="\"k=rsa\; p=$p\"" $BIN/v-add-dns-record $user $domain $record TXT "$selector" fi diff --git a/bin/v-change-web-domain-backend-tpl b/bin/v-change-web-domain-backend-tpl index 40b11df1..67044d6d 100755 --- a/bin/v-change-web-domain-backend-tpl +++ b/bin/v-change-web-domain-backend-tpl @@ -45,7 +45,7 @@ is_backend_template_valid $template prepare_web_backend # Deleting backend -rm -f $pool/$backend.conf +rm -f $pool/$backend_type.conf # Allocating backend port backend_port=9000 @@ -63,10 +63,10 @@ cat $WEBTPL/$WEB_BACKEND/$template.tpl |\ -e "s|%user%|$user|"\ -e "s|%domain%|$domain|"\ -e "s|%domain_idn%|$domain_idn|"\ - -e "s|%backend%|$backend|g" > $pool/$backend.conf + -e "s|%backend%|$backend_type|g" > $pool/$backend_type.conf # Checking backend pool configuration -if [ "$backend" = "$user" ]; then +if [ "$backend_type" = "$user" ]; then conf=$USER_DATA/web.conf fields='$DOMAIN' nohead=1 diff --git a/bin/v-change-web-domain-tpl b/bin/v-change-web-domain-tpl index 3366c313..93635230 100755 --- a/bin/v-change-web-domain-tpl +++ b/bin/v-change-web-domain-tpl @@ -54,9 +54,9 @@ fi # Defining variables for new vhost config prepare_web_domain_values -add_web_config "$WEB_SYSTEM" "$TPL.tpl" +add_web_config "$WEB_SYSTEM" "$template.tpl" if [ "$SSL" = 'yes' ]; then - add_web_config "$WEB_SYSTEM" "$TPL.stpl" + add_web_config "$WEB_SYSTEM" "$template.stpl" fi diff --git a/bin/v-generate-ssl-cert b/bin/v-generate-ssl-cert index 80912d78..b87a2d65 100755 --- a/bin/v-generate-ssl-cert +++ b/bin/v-generate-ssl-cert @@ -21,7 +21,7 @@ org=$6 org_unit=$7 aliases=$8 format=${9-shell} -KEY_SIZE=2048 +KEY_SIZE=4096 DAYS=365 # Includes diff --git a/func/db.sh b/func/db.sh index c7514eea..59a30746 100644 --- a/func/db.sh +++ b/func/db.sh @@ -387,7 +387,7 @@ get_mysql_disk_usage() { query="SELECT SUM( data_length + index_length ) / 1024 / 1024 \"Size\" FROM information_schema.TABLES WHERE table_schema='$database'" usage=$(mysql_query "$query" |tail -n1) - if [ "$usage" == 'NULL' ] || [ "${usage:0:1}" -eq '0' ]; then + if [ "$usage" == '' ] || [ "$usage" == 'NULL' ] || [ "${usage:0:1}" -eq '0' ]; then usage=1 fi export LC_ALL=C diff --git a/func/domain.sh b/func/domain.sh index 8589c94d..864ba1c5 100644 --- a/func/domain.sh +++ b/func/domain.sh @@ -271,8 +271,8 @@ del_web_config() { get_web_config_lines $WEBTPL/$1/$WEB_BACKEND/$2 $conf sed -i "$top_line,$bottom_line d" $conf - web_domains=$(grep DOMAIN $USER_DATA/web.conf |wc -l) - if [ "$web_domains" -eq '0' ]; then + web_domain=$(grep $domain $USER_DATA/web.conf |wc -l) + if [ "$web_domain" -eq '0' ]; then sed -i "/.*\/$user\/.*$1.conf/d" /etc/$1/conf.d/vesta.conf rm -f $conf fi diff --git a/func/main.sh b/func/main.sh index 5f78705d..2d48e187 100644 --- a/func/main.sh +++ b/func/main.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env bash # Internal variables HOMEDIR='/home' BACKUP='/backup' @@ -448,6 +449,7 @@ sync_cron_jobs() { rm -f $crontab if [ "$CRON_REPORTS" = 'yes' ]; then echo "MAILTO=$CONTACT" > $crontab + echo 'CONTENT_TYPE="text/plain; charset=utf-8"' >> $crontab fi while read line; do eval $line @@ -465,12 +467,12 @@ sync_cron_jobs() { is_user_format_valid() { if [ ${#1} -eq 1 ]; then if ! [[ "$1" =~ ^^[[:alnum:]]$ ]]; then - echo "invalid $2 format :: $1" + check_result $E_INVALID "invalid $2 format :: $1" fi else if ! [[ "$1" =~ ^[[:alnum:]][-|\.|_[:alnum:]]{0,28}[[:alnum:]]$ ]] then - echo "invalid $2 format :: $1" + check_result $E_INVALID "invalid $2 format :: $1" fi fi } @@ -588,7 +590,7 @@ is_dbuser_format_valid() { # DNS record type validator is_dns_type_format_valid() { - known_dnstype='A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF' + known_dnstype='A,AAAA,NS,CNAME,MX,TXT,SRV,DNSKEY,KEY,IPSECKEY,PTR,SPF,TLSA' if [ -z "$(echo $known_dnstype |grep -w $1)" ]; then check_result $E_INVALID "invalid dns record type format :: $1" fi @@ -611,7 +613,7 @@ is_dns_record_format_valid() { # Email format validator is_email_format_valid() { - if [[ ! "$1" =~ "@" ]] ; then + if [[ ! "$1" =~ ^[A-Za-z0-9._%+-]+@[[:alnum:].-]+\.[A-Za-z]{2,63}$ ]] ; then check_result $E_INVALID "invalid email format :: $1" fi } diff --git a/install/debian/7/nginx/phpmyadmin.inc b/install/debian/7/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/debian/7/nginx/phpmyadmin.inc +++ b/install/debian/7/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/debian/8/clamav/clamd.conf b/install/debian/8/clamav/clamd.conf index ea982697..4e04356e 100644 --- a/install/debian/8/clamav/clamd.conf +++ b/install/debian/8/clamav/clamd.conf @@ -8,7 +8,7 @@ LocalSocketMode 666 # TemporaryDirectory is not set to its default /tmp here to make overriding # the default with environment variables TMPDIR/TMP/TEMP possible User clamav -AllowSupplementaryGroups true +# AllowSupplementaryGroups true ScanMail true ScanArchive true ArchiveBlockEncrypted false diff --git a/install/debian/8/nginx/phpmyadmin.inc b/install/debian/8/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/debian/8/nginx/phpmyadmin.inc +++ b/install/debian/8/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/rhel/5/nginx/phpmyadmin.inc b/install/rhel/5/nginx/phpmyadmin.inc index 09da5207..efd6f4c4 100644 --- a/install/rhel/5/nginx/phpmyadmin.inc +++ b/install/rhel/5/nginx/phpmyadmin.inc @@ -12,4 +12,8 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } + } diff --git a/install/rhel/6/nginx/phpmyadmin.inc b/install/rhel/6/nginx/phpmyadmin.inc index 09da5207..9c5a6882 100644 --- a/install/rhel/6/nginx/phpmyadmin.inc +++ b/install/rhel/6/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/rhel/7/nginx/phpmyadmin.inc b/install/rhel/7/nginx/phpmyadmin.inc index 09da5207..9c5a6882 100644 --- a/install/rhel/7/nginx/phpmyadmin.inc +++ b/install/rhel/7/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/12.04/nginx/phpmyadmin.inc b/install/ubuntu/12.04/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/12.04/nginx/phpmyadmin.inc +++ b/install/ubuntu/12.04/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/12.10/nginx/phpmyadmin.inc b/install/ubuntu/12.10/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/12.10/nginx/phpmyadmin.inc +++ b/install/ubuntu/12.10/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/13.04/nginx/phpmyadmin.inc b/install/ubuntu/13.04/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/13.04/nginx/phpmyadmin.inc +++ b/install/ubuntu/13.04/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/13.10/nginx/phpmyadmin.inc b/install/ubuntu/13.10/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/13.10/nginx/phpmyadmin.inc +++ b/install/ubuntu/13.10/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/14.04/nginx/phpmyadmin.inc b/install/ubuntu/14.04/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/14.04/nginx/phpmyadmin.inc +++ b/install/ubuntu/14.04/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/opencart.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/opencart.tpl new file mode 100644 index 00000000..e3669a19 --- /dev/null +++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/opencart.tpl @@ -0,0 +1,52 @@ +server { + listen %ip%:%web_port%; + server_name %domain_idn% %alias_idn%; + root %docroot%; + index index.php index.html index.htm; + access_log /var/log/nginx/domains/%domain%.log combined; + access_log /var/log/nginx/domains/%domain%.bytes bytes; + error_log /var/log/nginx/domains/%domain%.error.log error; + + location / { + + try_files $uri $uri/ @opencart; + + location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ { + expires max; + } + + location ~ [^/]\.php(/|$) { + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + if (!-f $document_root$fastcgi_script_name) { + return 404; + } + + fastcgi_pass %backend_lsnr%; + fastcgi_index index.php; + include /etc/nginx/fastcgi_params; + } + } + + location @opencart { + rewrite ^/(.+)$ /index.php?_route_=$1 last; + } + + error_page 403 /error/404.html; + error_page 404 /error/404.html; + error_page 500 502 503 504 /error/50x.html; + + location /error/ { + alias %home%/%user%/web/%domain%/document_errors/; + } + + location ~* "/\.(htaccess|htpasswd)$" { + deny all; + return 404; + } + + include /etc/nginx/conf.d/phpmyadmin.inc*; + include /etc/nginx/conf.d/phppgadmin.inc*; + include /etc/nginx/conf.d/webmail.inc*; + + include %home%/%user%/conf/web/nginx.%domain%.conf*; +} diff --git a/install/ubuntu/14.10/nginx/phpmyadmin.inc b/install/ubuntu/14.10/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/14.10/nginx/phpmyadmin.inc +++ b/install/ubuntu/14.10/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/15.04/nginx/phpmyadmin.inc b/install/ubuntu/15.04/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/15.04/nginx/phpmyadmin.inc +++ b/install/ubuntu/15.04/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/ubuntu/15.10/nginx/phpmyadmin.inc b/install/ubuntu/15.10/nginx/phpmyadmin.inc index d70ca3e3..1feb8546 100644 --- a/install/ubuntu/15.10/nginx/phpmyadmin.inc +++ b/install/ubuntu/15.10/nginx/phpmyadmin.inc @@ -12,4 +12,7 @@ location /phpmyadmin { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } + location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ { + root /usr/share/; + } } diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 51ea9aa6..df6f2eb9 100755 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -10,6 +10,7 @@ export DEBIAN_FRONTEND=noninteractive RHOST='apt.vestacp.com' CHOST='c.vestacp.com' VERSION='debian' +VESTA='/usr/local/vesta' memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9]) arch=$(uname -i) os='debian' @@ -28,7 +29,7 @@ if [ "$release" -eq 8 ]; then mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils - bsdmainutils cron vesta vesta-nginx vesta-php" + bsdmainutils cron vesta vesta-nginx vesta-php expect" else software="nginx apache2 apache2-utils apache2.2-common apache2-suexec-custom libapache2-mod-ruid2 libapache2-mod-rpaf @@ -40,7 +41,7 @@ else mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils - bsdmainutils cron vesta vesta-nginx vesta-php" + bsdmainutils cron vesta vesta-nginx vesta-php expect" fi # Defining help function @@ -506,10 +507,10 @@ mv -f /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1 # Backup vesta service vesta stop > /dev/null 2>&1 -cp -r /usr/local/vesta/* $vst_backups/vesta > /dev/null 2>&1 +cp -r $VESTA/* $vst_backups/vesta > /dev/null 2>&1 apt-get -y remove vesta vesta-nginx vesta-php > /dev/null 2>&1 apt-get -y purge vesta vesta-nginx vesta-php > /dev/null 2>&1 -rm -rf /usr/local/vesta > /dev/null 2>&1 +rm -rf $VESTA > /dev/null 2>&1 #----------------------------------------------------------# @@ -641,10 +642,10 @@ wget $vestacp/sudo/admin -O /etc/sudoers.d/admin chmod 440 /etc/sudoers.d/admin # Configuring system env -echo "export VESTA='/usr/local/vesta'" > /etc/profile.d/vesta.sh +echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh chmod 755 /etc/profile.d/vesta.sh source /etc/profile.d/vesta.sh -echo 'PATH=$PATH:/usr/local/vesta/bin' >> /root/.bash_profile +echo 'PATH=$PATH:'$VESTA'/bin' >> /root/.bash_profile echo 'export PATH' >> /root/.bash_profile source /root/.bash_profile @@ -663,7 +664,7 @@ chmod 750 $VESTA/conf $VESTA/data/users $VESTA/data/ips $VESTA/log chmod -R 750 $VESTA/data/queue chmod 660 $VESTA/log/* rm -f /var/log/vesta -ln -s /usr/local/vesta/log /var/log/vesta +ln -s $VESTA/log /var/log/vesta chown admin:admin $VESTA/data/sessions chmod 770 $VESTA/data/sessions @@ -1072,6 +1073,7 @@ if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then mysql -e "CREATE DATABASE roundcube" mysql -e "GRANT ALL ON roundcube.* TO roundcube@localhost IDENTIFIED BY '$r'" sed -i "s/%password%/$r/g" /etc/roundcube/db.inc.php + sed -i "s/localhost/$servername/g" /etc/roundcube/plugins/password/config.inc.php mysql roundcube < /usr/share/dbconfig-common/data/roundcube/install/mysql chmod a+r /etc/roundcube/main.inc.php if [ "$release" -eq 8 ]; then @@ -1128,6 +1130,14 @@ check_result $? "can't create admin user" $VESTA/bin/v-change-user-shell admin bash $VESTA/bin/v-change-user-language admin $lang +# RoundCube permissions fix +if [ "$exim" = 'yes' ] && [ "$mysql" = 'yes' ]; then + if [ ! -d "/var/log/roundcube" ]; then + mkdir /var/log/roundcube + fi + chown admin:admin /var/log/roundcube +fi + # Configuring system ips $VESTA/bin/v-update-sys-ip @@ -1163,19 +1173,19 @@ $VESTA/bin/v-add-domain admin $servername check_result $? "can't create $servername domain" # Adding cron jobs -command='sudo /usr/local/vesta/bin/v-update-sys-queue disk' +command="sudo $VESTA/bin/v-update-sys-queue disk" $VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue traffic' +command="sudo $VESTA/bin/v-update-sys-queue traffic" $VESTA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue webstats' +command="sudo $VESTA/bin/v-update-sys-queue webstats" $VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue backup' +command="sudo $VESTA/bin/v-update-sys-queue backup" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-backup-users' +command="sudo $VESTA/bin/v-backup-users" $VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-user-stats' +command="sudo $VESTA/bin/v-update-user-stats" $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-rrd' +command="sudo $VESTA/bin/v-update-sys-rrd" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" service cron restart diff --git a/install/vst-install-rhel.sh b/install/vst-install-rhel.sh index 876edfb7..cceb1d8b 100755 --- a/install/vst-install-rhel.sh +++ b/install/vst-install-rhel.sh @@ -10,6 +10,7 @@ RHOST='r.vestacp.com' CHOST='c.vestacp.com' REPO='cmmnt' VERSION='rhel' +VESTA='/usr/local/vesta' memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9]) arch=$(uname -i) os=$(cut -f 1 -d ' ' /etc/redhat-release) @@ -26,7 +27,7 @@ if [ "$release" -eq 7 ]; then postgresql postgresql-server postgresql-contrib phpPgAdmin e2fsprogs openssh-clients ImageMagick curl mc screen ftp zip unzip flex sqlite pcre sudo bc jwhois mailx lsof tar telnet rrdtool net-tools ntp GeoIP freetype - fail2ban rsyslog iptables-services which vesta vesta-nginx vesta-php" + fail2ban rsyslog iptables-services which vesta vesta-nginx vesta-php expect" else software="nginx httpd mod_ssl mod_ruid2 mod_fcgid mod_extract_forwarded php php-common php-cli php-bcmath php-gd php-imap php-mbstring php-mcrypt @@ -36,7 +37,7 @@ else postgresql-server postgresql-contrib phpPgAdmin e2fsprogs openssh-clients ImageMagick curl mc screen ftp zip unzip flex sqlite pcre sudo bc jwhois mailx lsof tar telnet rrdtool net-tools ntp GeoIP freetype fail2ban - which vesta vesta-nginx vesta-php" + which vesta vesta-nginx vesta-php expect" fi # Defining help function @@ -528,8 +529,8 @@ mv /var/lib/pgsql/data $vst_backups/postgresql/ >/dev/null 2>&1 # Backing up Vesta configuration and data service vesta stop > /dev/null 2>&1 -mv /usr/local/vesta/data/* $vst_backups/vesta > /dev/null 2>&1 -mv /usr/local/vesta/conf/* $vst_backups/vesta > /dev/null 2>&1 +mv $VESTA/data/* $vst_backups/vesta > /dev/null 2>&1 +mv $VESTA/conf/* $vst_backups/vesta > /dev/null 2>&1 #----------------------------------------------------------# @@ -678,10 +679,10 @@ wget $vestacp/sudo/admin -O /etc/sudoers.d/admin chmod 440 /etc/sudoers.d/admin # Configuring system env -echo "export VESTA='/usr/local/vesta'" > /etc/profile.d/vesta.sh +echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh chmod 755 /etc/profile.d/vesta.sh source /etc/profile.d/vesta.sh -echo 'PATH=$PATH:/usr/local/vesta/bin' >> /root/.bash_profile +echo 'PATH=$PATH:'$VESTA'/bin' >> /root/.bash_profile echo 'export PATH' >> /root/.bash_profile source /root/.bash_profile @@ -700,7 +701,7 @@ chmod 750 $VESTA/conf $VESTA/data/users $VESTA/data/ips $VESTA/log chmod -R 750 $VESTA/data/queue chmod 660 $VESTA/log/* rm -f /var/log/vesta -ln -s /usr/local/vesta/log /var/log/vesta +ln -s $VESTA/log /var/log/vesta chown admin:admin $VESTA/data/sessions chmod 770 $VESTA/data/sessions @@ -1234,20 +1235,19 @@ fi $VESTA/bin/v-add-domain admin $servername check_result $? "can't create $servername domain" -# Adding cron jobs -command='sudo /usr/local/vesta/bin/v-update-sys-queue disk' +command="sudo $VESTA/bin/v-update-sys-queue disk" $VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue traffic' +command="sudo $VESTA/bin/v-update-sys-queue traffic" $VESTA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue webstats' +command="sudo $VESTA/bin/v-update-sys-queue webstats" $VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue backup' +command="sudo $VESTA/bin/v-update-sys-queue backup" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-backup-users' +command="sudo $VESTA/bin/v-backup-users" $VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-user-stats' +command="sudo $VESTA/bin/v-update-user-stats" $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-rrd' +command="sudo $VESTA/bin/v-update-sys-rrd" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" service crond restart diff --git a/install/vst-install-ubuntu.sh b/install/vst-install-ubuntu.sh index 9a95e2f4..ca3c186a 100755 --- a/install/vst-install-ubuntu.sh +++ b/install/vst-install-ubuntu.sh @@ -10,6 +10,7 @@ export DEBIAN_FRONTEND=noninteractive RHOST='apt.vestacp.com' CHOST='c.vestacp.com' VERSION='ubuntu' +VESTA='/usr/local/vesta' memory=$(grep 'MemTotal' /proc/meminfo |tr ' ' '\n' |grep [0-9]) arch=$(uname -i) os='ubuntu' @@ -26,7 +27,7 @@ software="nginx apache2 apache2-utils apache2.2-common mysql-client postgresql postgresql-contrib phppgadmin phpMyAdmin mc flex whois rssh git idn zip sudo bc ftp lsof ntpdate rrdtool quota e2fslibs bsdutils e2fsprogs curl imagemagick fail2ban dnsutils - bsdmainutils cron vesta vesta-nginx vesta-php" + bsdmainutils cron vesta vesta-nginx vesta-php expect" # Defining help function help() { @@ -491,10 +492,10 @@ mv -f /root/.my.cnf $vst_backups/mysql > /dev/null 2>&1 # Backup vesta service vesta stop > /dev/null 2>&1 -cp -r /usr/local/vesta/* $vst_backups/vesta > /dev/null 2>&1 +cp -r $VESTA/* $vst_backups/vesta > /dev/null 2>&1 apt-get -y remove vesta vesta-nginx vesta-php > /dev/null 2>&1 apt-get -y purge vesta vesta-nginx vesta-php > /dev/null 2>&1 -rm -rf /usr/local/vesta > /dev/null 2>&1 +rm -rf $VESTA > /dev/null 2>&1 #----------------------------------------------------------# @@ -631,10 +632,10 @@ wget $vestacp/sudo/admin -O /etc/sudoers.d/admin chmod 440 /etc/sudoers.d/admin # Configuring system env -echo "export VESTA='/usr/local/vesta'" > /etc/profile.d/vesta.sh +echo "export VESTA='$VESTA'" > /etc/profile.d/vesta.sh chmod 755 /etc/profile.d/vesta.sh source /etc/profile.d/vesta.sh -echo 'PATH=$PATH:/usr/local/vesta/bin' >> /root/.bash_profile +echo 'PATH=$PATH:'$VESTA'/bin' >> /root/.bash_profile echo 'export PATH' >> /root/.bash_profile source /root/.bash_profile @@ -653,7 +654,7 @@ chmod 750 $VESTA/conf $VESTA/data/users $VESTA/data/ips $VESTA/log chmod -R 750 $VESTA/data/queue chmod 660 $VESTA/log/* rm -f /var/log/vesta -ln -s /usr/local/vesta/log /var/log/vesta +ln -s $VESTA/log /var/log/vesta chown admin:admin $VESTA/data/sessions chmod 770 $VESTA/data/sessions @@ -1150,19 +1151,19 @@ $VESTA/bin/v-add-domain admin $servername check_result $? "can't create $servername domain" # Adding cron jobs -command='sudo /usr/local/vesta/bin/v-update-sys-queue disk' +command="sudo $VESTA/bin/v-update-sys-queue disk" $VESTA/bin/v-add-cron-job 'admin' '15' '02' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue traffic' +command="sudo $VESTA/bin/v-update-sys-queue traffic" $VESTA/bin/v-add-cron-job 'admin' '10' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue webstats' +command="sudo $VESTA/bin/v-update-sys-queue webstats" $VESTA/bin/v-add-cron-job 'admin' '30' '03' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-queue backup' +command="sudo $VESTA/bin/v-update-sys-queue backup" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-backup-users' +command="sudo $VESTA/bin/v-backup-users" $VESTA/bin/v-add-cron-job 'admin' '10' '05' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-user-stats' +command="sudo $VESTA/bin/v-update-user-stats" $VESTA/bin/v-add-cron-job 'admin' '20' '00' '*' '*' '*' "$command" -command='sudo /usr/local/vesta/bin/v-update-sys-rrd' +command="sudo $VESTA/bin/v-update-sys-rrd" $VESTA/bin/v-add-cron-job 'admin' '*/5' '*' '*' '*' '*' "$command" service cron restart diff --git a/web/templates/admin/add_dns_rec.html b/web/templates/admin/add_dns_rec.html index 0ebc0552..2f5a00e5 100644 --- a/web/templates/admin/add_dns_rec.html +++ b/web/templates/admin/add_dns_rec.html @@ -80,6 +80,7 @@ + diff --git a/web/templates/admin/add_mail_acc.html b/web/templates/admin/add_mail_acc.html index 70f2d5bc..725780ee 100644 --- a/web/templates/admin/add_mail_acc.html +++ b/web/templates/admin/add_mail_acc.html @@ -132,6 +132,7 @@
+ @@ -142,7 +143,7 @@ - + @@ -158,7 +159,7 @@ - + @@ -179,4 +180,4 @@
: william.cage@
:
:
:
-
\ No newline at end of file +