diff --git a/bin/v_add_web_domain_alias b/bin/v_add_web_domain_alias index 10f65c0c..d55b68e5 100755 --- a/bin/v_add_web_domain_alias +++ b/bin/v_add_web_domain_alias @@ -41,7 +41,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking alias on the server is_domain_new 'quiet' "$dom_alias" diff --git a/bin/v_add_web_domain_cgi b/bin/v_add_web_domain_cgi index 2293f93f..fffd697c 100755 --- a/bin/v_add_web_domain_cgi +++ b/bin/v_add_web_domain_cgi @@ -39,7 +39,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking cgi is not added is_web_domain_key_empty '$CGI' diff --git a/bin/v_add_web_domain_elog b/bin/v_add_web_domain_elog index e4a30ffc..f75acfe6 100755 --- a/bin/v_add_web_domain_elog +++ b/bin/v_add_web_domain_elog @@ -39,7 +39,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking errorlog is not added is_web_domain_key_empty '$ELOG' diff --git a/bin/v_add_web_domain_nginx b/bin/v_add_web_domain_nginx index 5c809915..1d75fd15 100755 --- a/bin/v_add_web_domain_nginx +++ b/bin/v_add_web_domain_nginx @@ -11,7 +11,7 @@ domain=$(idn -t --quiet -u "$2" ) domain_idn=$(idn -t --quiet -a "$domain") template="${3-default}" default_extentions="jpg,jpeg,gif,png,ico,css,zip,tgz,gz,rar,bz2,doc,xls,exe,\ -pdf,ppt,txt,tar,wav,bmp,rtf,js,mp3,avi,mpeg" +pdf,ppt,txt,tar,wav,bmp,rtf,js,mp3,avi,mpeg,html,htm" extentions="${4-$default_extentions}" # Importing variables @@ -43,7 +43,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Check nginx is not added is_web_domain_key_empty '$NGINX' diff --git a/bin/v_add_web_domain_ssl b/bin/v_add_web_domain_ssl index b8ba6bde..a98dcdd3 100755 --- a/bin/v_add_web_domain_ssl +++ b/bin/v_add_web_domain_ssl @@ -42,7 +42,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking package is_package_full 'web_ssl' diff --git a/bin/v_add_web_domain_stat b/bin/v_add_web_domain_stat index 21404909..3572fd00 100755 --- a/bin/v_add_web_domain_stat +++ b/bin/v_add_web_domain_stat @@ -41,7 +41,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking statistic type is_type_valid 'stat' "$type" diff --git a/bin/v_add_web_domain_stat_auth b/bin/v_add_web_domain_stat_auth index 5c224631..64ddd3f3 100755 --- a/bin/v_add_web_domain_stat_auth +++ b/bin/v_add_web_domain_stat_auth @@ -40,7 +40,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' #----------------------------------------------------------# diff --git a/bin/v_change_web_domain_ip b/bin/v_change_web_domain_ip index 3f297398..7cdd9018 100755 --- a/bin/v_change_web_domain_ip +++ b/bin/v_change_web_domain_ip @@ -41,7 +41,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking ip is_ip_avalable diff --git a/bin/v_change_web_domain_sslcert b/bin/v_change_web_domain_sslcert index 26b12a96..da7bfb89 100755 --- a/bin/v_change_web_domain_sslcert +++ b/bin/v_change_web_domain_sslcert @@ -40,7 +40,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Check SSL is added is_web_domain_value_exist '$SSL_CERT' diff --git a/bin/v_change_web_domain_sslhome b/bin/v_change_web_domain_sslhome index 4eea5163..0e78b816 100755 --- a/bin/v_change_web_domain_sslhome +++ b/bin/v_change_web_domain_sslhome @@ -40,7 +40,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Check SSL is added is_web_domain_value_exist '$SSL_CERT' diff --git a/bin/v_change_web_domain_tpl b/bin/v_change_web_domain_tpl index 95a1ae4d..27bd2ea1 100755 --- a/bin/v_change_web_domain_tpl +++ b/bin/v_change_web_domain_tpl @@ -40,7 +40,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking template templates=$(get_user_value '$WEB_TPL') diff --git a/bin/v_del_web_domain b/bin/v_del_web_domain index ee2e1e47..c7b2b864 100755 --- a/bin/v_del_web_domain +++ b/bin/v_del_web_domain @@ -40,7 +40,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' #----------------------------------------------------------# diff --git a/bin/v_del_web_domain_alias b/bin/v_del_web_domain_alias index 2e6e6433..5e99ac6e 100755 --- a/bin/v_del_web_domain_alias +++ b/bin/v_del_web_domain_alias @@ -41,7 +41,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking alias is added cur_alias=$(get_web_domain_value '$ALIAS') diff --git a/bin/v_del_web_domain_cgi b/bin/v_del_web_domain_cgi index 43e00d51..a5c26205 100755 --- a/bin/v_del_web_domain_cgi +++ b/bin/v_del_web_domain_cgi @@ -39,7 +39,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking cgi is added is_web_domain_value_exist '$CGI' diff --git a/bin/v_del_web_domain_elog b/bin/v_del_web_domain_elog index 0f6a4656..aec03d1d 100755 --- a/bin/v_del_web_domain_elog +++ b/bin/v_del_web_domain_elog @@ -39,7 +39,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Check errorlog is added is_web_domain_value_exist '$ELOG' diff --git a/bin/v_del_web_domain_nginx b/bin/v_del_web_domain_nginx index bc87bebc..ee0a584f 100755 --- a/bin/v_del_web_domain_nginx +++ b/bin/v_del_web_domain_nginx @@ -39,7 +39,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking ssl is added is_web_domain_value_exist '$NGINX' diff --git a/bin/v_del_web_domain_ssl b/bin/v_del_web_domain_ssl index 897eab9b..c8e411d3 100755 --- a/bin/v_del_web_domain_ssl +++ b/bin/v_del_web_domain_ssl @@ -39,7 +39,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking ssl is added is_web_domain_value_exist '$SSL_CERT' diff --git a/bin/v_del_web_domain_stat b/bin/v_del_web_domain_stat index 8de21ca1..bf3fbc61 100755 --- a/bin/v_del_web_domain_stat +++ b/bin/v_del_web_domain_stat @@ -38,7 +38,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking stats enabled is_web_domain_value_exist '$STATS' diff --git a/bin/v_del_web_domain_stat_auth b/bin/v_del_web_domain_stat_auth index 098f45af..1dbd8b8b 100755 --- a/bin/v_del_web_domain_stat_auth +++ b/bin/v_del_web_domain_stat_auth @@ -39,7 +39,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' # Checking stats auth enabled is_web_domain_value_exist '$STATS_AUTH' diff --git a/bin/v_get_web_domain_value b/bin/v_get_web_domain_value index ccecc1da..d409f07d 100755 --- a/bin/v_get_web_domain_value +++ b/bin/v_get_web_domain_value @@ -37,7 +37,7 @@ is_user_suspended is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' #----------------------------------------------------------# diff --git a/bin/v_suspend_web_domain b/bin/v_suspend_web_domain index 35e927f2..7694a24f 100755 --- a/bin/v_suspend_web_domain +++ b/bin/v_suspend_web_domain @@ -39,7 +39,7 @@ is_user_valid is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' #----------------------------------------------------------# @@ -57,7 +57,7 @@ conf="$V_HOME/$user/conf/httpd.conf" search_phrase='DocumentRoot ' # Defining replace string -str_repl=" Redirect / http://$url/" +str_repl=" Redirect / http://$url" # Suspending vhost change_web_config @@ -65,16 +65,27 @@ change_web_config # Check ssl vhost cert=$(get_web_domain_value '$SSL_CERT') if [ ! -z "$cert" ]; then - # Defining teplate name tpl_file="$V_WEBTPL/apache_$tpl_name.stpl" - - # Defining config conf="$V_HOME/$user/conf/shttpd.conf" + str_repl=" Redirect / http://$url" + change_web_config +fi - # Reefining replace string - old str_repl contains escaped chars - str_repl=" Redirect / http://$url/" +# Check nginx vhost +nginx=$(get_web_domain_value '$NGINX') +if [ ! -z "$nginx" ]; then + tpl_file="$V_WEBTPL/ngingx_vhost_$nginx.tpl" + conf="$V_HOME/$user/conf/nginx.conf" + search_phrase='proxy_pass' + str_repl=" rewrite ^(.*)\$ http://$url;" + change_web_config +fi - # Suspending vhost +if [ ! -z "$nginx" ] && [ ! -z "$cert" ]; then + tpl_file="$V_WEBTPL/ngingx_vhost_$nginx.stpl" + conf="$V_HOME/$user/conf/snginx.conf" + search_phrase='proxy_pass' + str_repl=" rewrite ^(.*)\$ http://$url;" change_web_config fi diff --git a/bin/v_suspend_web_domains b/bin/v_suspend_web_domains index 1dfd8daa..70e50746 100755 --- a/bin/v_suspend_web_domains +++ b/bin/v_suspend_web_domains @@ -53,6 +53,8 @@ domains=$(dom_clear_search) # Starting suspend loop for domain in $domains; do + domain_idn=$(idn -t --quiet -a "$domain") + # Get template name tpl_name=$(get_web_domain_value '$TPL') tpl_file="$V_WEBTPL/apache_$tpl_name.tpl" @@ -85,6 +87,24 @@ for domain in $domains; do change_web_config fi + # Check nginx vhost + nginx=$(get_web_domain_value '$NGINX') + if [ ! -z "$nginx" ]; then + tpl_file="$V_WEBTPL/ngingx_vhost_$nginx.tpl" + conf="$V_HOME/$user/conf/nginx.conf" + search_phrase='proxy_pass' + str_repl=" rewrite ^(.*)\$ http://$url;" + change_web_config + fi + + if [ ! -z "$nginx" ] && [ ! -z "$cert" ]; then + tpl_file="$V_WEBTPL/ngingx_vhost_$nginx.stpl" + conf="$V_HOME/$user/conf/snginx.conf" + search_phrase='proxy_pass' + str_repl=" rewrite ^(.*)\$ http://$url;" + change_web_config + fi + # Adding suspend in config update_web_domain_value '$SUSPEND' 'yes' diff --git a/bin/v_unsuspend_web_domain b/bin/v_unsuspend_web_domain index 20817646..300611dc 100755 --- a/bin/v_unsuspend_web_domain +++ b/bin/v_unsuspend_web_domain @@ -36,7 +36,7 @@ is_user_valid is_web_domain_valid # Check domain is suspened -is_domain_unsuspended 'web_domains' +is_domain_unsuspended 'web' #----------------------------------------------------------# @@ -82,6 +82,25 @@ if [ ! -z "$cert" ]; then change_web_config fi +# Check nginx vhost +nginx=$(get_web_domain_value '$NGINX') +if [ ! -z "$nginx" ]; then + ip=$(get_web_domain_value '$IP') + web_port=$(get_config_value '$WEB_PORT') + tpl_file="$V_WEBTPL/ngingx_vhost_$nginx.tpl" + conf="$V_HOME/$user/conf/nginx.conf" + search_phrase='rewrite ^(.*)$' + str_repl=" proxy_pass http://$ip:$web_port;" + change_web_config +fi + +if [ ! -z "$nginx" ] && [ ! -z "$cert" ]; then + web_ssl_port=$(get_config_value '$WEB_SSL_PORT') + tpl_file="$V_WEBTPL/ngingx_vhost_$nginx.stpl" + conf="$V_HOME/$user/conf/snginx.conf" + str_repl=" proxy_pass https://$ip:$web_ssl_port;" + change_web_config +fi #----------------------------------------------------------# # Vesta # diff --git a/bin/v_upd_web_domain_disk b/bin/v_upd_web_domain_disk index 3278bb4a..a05b345b 100755 --- a/bin/v_upd_web_domain_disk +++ b/bin/v_upd_web_domain_disk @@ -36,7 +36,7 @@ is_user_valid is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' #----------------------------------------------------------# diff --git a/bin/v_upd_web_domain_traff b/bin/v_upd_web_domain_traff index 3e491a64..3292d40d 100755 --- a/bin/v_upd_web_domain_traff +++ b/bin/v_upd_web_domain_traff @@ -36,7 +36,7 @@ is_user_valid is_web_domain_valid # Checking domain is not suspened -is_domain_suspended 'web_domains' +is_domain_suspended 'web' #----------------------------------------------------------#