Explorar el Código

renamed config file

Serghey Rodin hace 14 años
padre
commit
9ee68e6034

+ 1 - 1
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"

+ 1 - 1
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'

+ 1 - 1
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'

+ 2 - 2
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'

+ 1 - 1
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'

+ 1 - 1
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"

+ 1 - 1
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'
 
 
 #----------------------------------------------------------#

+ 1 - 1
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

+ 1 - 1
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'

+ 1 - 1
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'

+ 1 - 1
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')

+ 1 - 1
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'
 
 
 #----------------------------------------------------------#

+ 1 - 1
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')

+ 1 - 1
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'

+ 1 - 1
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'

+ 1 - 1
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'

+ 1 - 1
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'

+ 1 - 1
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'

+ 1 - 1
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'

+ 1 - 1
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'
 
 
 #----------------------------------------------------------#

+ 19 - 8
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
 

+ 20 - 0
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'
 

+ 20 - 1
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                              #

+ 1 - 1
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'
 
 
 #----------------------------------------------------------#

+ 1 - 1
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'
 
 
 #----------------------------------------------------------#