From 579815608c89caa3f3880fec3cccc22c4e0c2b0d Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 5 Feb 2013 22:57:55 +0200 Subject: [PATCH] removing old functional --- bin/v-add-web-domain-cgi | 80 --------------- bin/v-add-web-domain-elog | 99 ------------------- bin/v-delete-web-domain-cgi | 79 --------------- bin/v-delete-web-domain-elog | 97 ------------------ bin/v-list-web-domains-elog | 54 ---------- .../rhel/templates/web/apache_default.stpl | 6 +- .../rhel/templates/web/apache_default.tpl | 6 +- .../rhel/templates/web/apache_hosting.stpl | 6 +- .../rhel/templates/web/apache_hosting.tpl | 6 +- .../rhel/templates/web/apache_phpcgi.stpl | 4 +- .../rhel/templates/web/apache_phpcgi.tpl | 4 +- .../rhel/templates/web/apache_phpfcgid.stpl | 4 +- .../rhel/templates/web/apache_phpfcgid.tpl | 4 +- 13 files changed, 20 insertions(+), 429 deletions(-) delete mode 100755 bin/v-add-web-domain-cgi delete mode 100755 bin/v-add-web-domain-elog delete mode 100755 bin/v-delete-web-domain-cgi delete mode 100755 bin/v-delete-web-domain-elog delete mode 100755 bin/v-list-web-domains-elog diff --git a/bin/v-add-web-domain-cgi b/bin/v-add-web-domain-cgi deleted file mode 100755 index fc2a9993..00000000 --- a/bin/v-add-web-domain-cgi +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash -# info: add cgi support for domain -# options: USER DOMAIN -# -# The function switches on cgi support by adding +ExecCGI directive into -# webserver configuration file. The use of this function is provided for -# cases, when temporary cgi support is necessary, for other cases use of -# templates is recommended. - - -#----------------------------------------------------------# -# Variable&Function # -#----------------------------------------------------------# - -# Argument defenition -user=$1 -domain=$(idn -t --quiet -u "$2" ) -domain_idn=$(idn -t --quiet -a "$domain") - -# Includes -source $VESTA/conf/vesta.conf -source $VESTA/func/main.sh -source $VESTA/func/domain.sh - - -#----------------------------------------------------------# -# Verifications # -#----------------------------------------------------------# - -check_args '2' "$#" 'USER DOMAIN' -validate_format 'user' 'domain' -is_system_enabled "$WEB_SYSTEM" -is_object_valid 'user' 'USER' "$user" -is_object_unsuspended 'user' 'USER' "$user" -is_object_valid 'web' 'DOMAIN' "$domain" -is_object_unsuspended 'web' 'DOMAIN' "$domain" -is_object_value_empty 'web' 'DOMAIN' "$domain" '$CGI' - - -#----------------------------------------------------------# -# Action # -#----------------------------------------------------------# - -# Parsing domain values -get_domain_values 'web' -tpl_file="$WEBTPL/apache_$TPL.tpl" -conf="$HOMEDIR/$user/conf/web/httpd.conf" -CGI='yes' - -# Preparing domain values for the template substitution -upd_web_domain_values - -# Recreating vhost -del_web_config -add_web_config - -# Checking ssl -if [ "$SSL" = 'yes' ]; then - tpl_file="$WEBTPL/apache_$TPL.stpl" - conf="$HOMEDIR/$user/conf/web/shttpd.conf" - del_web_config - add_web_config -fi - - -#----------------------------------------------------------# -# Vesta # -#----------------------------------------------------------# - -# Update config value -update_object_value 'web' 'DOMAIN' "$domain" '$CGI' 'yes' - -# Restart web server -$BIN/v-restart-web "$EVENT" - -# Logging -log_history "enabled cgi support for $domain" -log_event "$OK" "$EVENT" - -exit diff --git a/bin/v-add-web-domain-elog b/bin/v-add-web-domain-elog deleted file mode 100755 index 31859b5b..00000000 --- a/bin/v-add-web-domain-elog +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash -# info: add error logging for domain -# options: USER DOMAIN [RESTART] -# -# The function enables a separate ErrorLog file for a domain, accessible for -# reading by users. - - -#----------------------------------------------------------# -# Variable&Function # -#----------------------------------------------------------# - -# Argument defenition -user=$1 -domain=$(idn -t --quiet -u "$2" ) -domain_idn=$(idn -t --quiet -a "$domain") -restart="$3" - -# Includes -source $VESTA/conf/vesta.conf -source $VESTA/func/main.sh -source $VESTA/func/domain.sh - - -#----------------------------------------------------------# -# Verifications # -#----------------------------------------------------------# - -check_args '2' "$#" 'USER DOMAIN [RESTART]' -validate_format 'user' 'domain' -is_system_enabled "$WEB_SYSTEM" -is_object_valid 'user' 'USER' "$user" -is_object_unsuspended 'user' 'USER' "$user" -is_object_valid 'web' 'DOMAIN' "$domain" -is_object_unsuspended 'web' 'DOMAIN' "$domain" - - -#----------------------------------------------------------# -# Action # -#----------------------------------------------------------# - -# Parsing domain values -get_domain_values 'web' -if [ $ELOG == 'yes' ]; then - exit 0 -fi - -tpl_file="$WEBTPL/apache_$TPL.tpl" -conf="$HOMEDIR/$user/conf/web/httpd.conf" -ELOG='yes' - -# Preparing domain values for the template substitution -upd_web_domain_values - -# Recreating vhost -del_web_config -add_web_config - -# Checking ssl -if [ "$SSL" = 'yes' ]; then - tpl_file="$WEBTPL/apache_$TPL.stpl" - conf="$HOMEDIR/$user/conf/web/shttpd.conf" - del_web_config - add_web_config -fi - -# Checking nginx -if [ ! -z "$NGINX" ]; then - tpl_file="$WEBTPL/nginx_$NGINX.tpl" - conf="$HOMEDIR/$user/conf/web/nginx.conf" - del_web_config - add_web_config - - if [ "$SSL" = 'yes' ]; then - tpl_file="$WEBTPL/nginx_$NGINX.stpl" - conf="$HOMEDIR/$user/conf/web/snginx.conf" - del_web_config - add_web_config - fi -fi - - -#----------------------------------------------------------# -# Vesta # -#----------------------------------------------------------# - -# Update config -update_object_value 'web' 'DOMAIN' "$domain" '$ELOG' 'yes' - -# Adding task to the vesta pipe -if [ "$restart" != 'no' ]; then - $BIN/v-restart-web "$EVENT" -fi - -# Logging -log_history "enabled error logging for $domain" -log_event "$OK" "$EVENT" - -exit diff --git a/bin/v-delete-web-domain-cgi b/bin/v-delete-web-domain-cgi deleted file mode 100755 index 847fb2a8..00000000 --- a/bin/v-delete-web-domain-cgi +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash -# info: delete web domain cgi support -# options: USER DOMAIN -# -# The function for deleting cgi support (adds -ExecCGI directive into -# configuration file). It is recommended to apply this function only for a -# temporary use (for lightening the consequences of DDoS, for example); -# otherwise it is preferable to use templates. - - -#----------------------------------------------------------# -# Variable&Function # -#----------------------------------------------------------# - -# Argument defenition -user=$1 -domain=$(idn -t --quiet -u "$2" ) -domain_idn=$(idn -t --quiet -a "$domain") - -# Includes -source $VESTA/conf/vesta.conf -source $VESTA/func/main.sh -source $VESTA/func/domain.sh - - -#----------------------------------------------------------# -# Verifications # -#----------------------------------------------------------# - -check_args '2' "$#" 'USER DOMAIN' -validate_format 'user' 'domain' -is_system_enabled "$WEB_SYSTEM" -is_object_valid 'user' 'USER' "$user" -is_object_unsuspended 'user' 'USER' "$user" -is_object_valid 'web' 'DOMAIN' "$domain" -is_object_unsuspended 'web' 'DOMAIN' "$domain" -is_object_value_exist 'web' 'DOMAIN' "$domain" '$CGI' - - -#----------------------------------------------------------# -# Action # -#----------------------------------------------------------# - -get_domain_values 'web' -tpl_file="$WEBTPL/apache_$TPL.tpl" -conf="$HOMEDIR/$user/conf/web/httpd.conf" -CGI='no' - -# Preparing domain values for the template substitution -upd_web_domain_values - -# Recreating vhost -del_web_config -add_web_config - -# Checking ssl -if [ "$SSL" = 'yes' ]; then - tpl_file="$WEBTPL/apache_$TPL.stpl" - conf="$HOMEDIR/$user/conf/web/shttpd.conf" - del_web_config - add_web_config -fi - - -#----------------------------------------------------------# -# Vesta # -#----------------------------------------------------------# - -# Update config -update_object_value 'web' 'DOMAIN' "$domain" '$CGI' 'no' - -# Restart web server -$BIN/v-restart-web "$EVENT" - -# Logging -log_history "disabled cgi support for $domain" -log_event "$OK" "$EVENT" - -exit diff --git a/bin/v-delete-web-domain-elog b/bin/v-delete-web-domain-elog deleted file mode 100755 index 9eeda488..00000000 --- a/bin/v-delete-web-domain-elog +++ /dev/null @@ -1,97 +0,0 @@ -#!/bin/bash -# info: delete web domain error loggin support -# options: USER DOMAIN [RESTART] -# -# The function of disabling error logging feature. It comments ErrorLog -# direcitve in apache or/and nginx configuration. The data already collected -# remains untouched. - - -#----------------------------------------------------------# -# Variable&Function # -#----------------------------------------------------------# - -# Argument defenition -user=$1 -domain=$(idn -t --quiet -u "$2" ) -domain_idn=$(idn -t --quiet -a "$domain") -restart=$3 - -# Includes -source $VESTA/conf/vesta.conf -source $VESTA/func/main.sh -source $VESTA/func/domain.sh - - -#----------------------------------------------------------# -# Verifications # -#----------------------------------------------------------# - -check_args '2' "$#" 'USER DOMAIN [RESTART]' -validate_format 'user' 'domain' -is_system_enabled "$WEB_SYSTEM" -is_object_valid 'user' 'USER' "$user" "$user" -is_object_unsuspended 'user' 'USER' "$user" -is_object_valid 'web' 'DOMAIN' "$domain" -is_object_unsuspended 'web' 'DOMAIN' "$domain" -is_object_value_exist 'web' 'DOMAIN' "$domain" '$ELOG' - - -#----------------------------------------------------------# -# Action # -#----------------------------------------------------------# - -# Parsing domain values -get_domain_values 'web' -tpl_file="$WEBTPL/apache_$TPL.tpl" -conf="$HOMEDIR/$user/conf/web/httpd.conf" -ELOG='no' - -# Preparing domain values for the template substitution -upd_web_domain_values - -# Recreating vhost -del_web_config -add_web_config - -# Checking ssl -if [ "$SSL" = 'yes' ]; then - tpl_file="$WEBTPL/apache_$TPL.stpl" - conf="$HOMEDIR/$user/conf/web/shttpd.conf" - del_web_config - add_web_config -fi - -# Checking nginx -if [ ! -z "$NGINX" ]; then - tpl_file="$WEBTPL/nginx_$NGINX.tpl" - conf="$HOMEDIR/$user/conf/web/nginx.conf" - del_web_config - add_web_config - - if [ "$SSL" = 'yes' ]; then - tpl_file="$WEBTPL/nginx_$NGINX.stpl" - conf="$HOMEDIR/$user/conf/web/snginx.conf" - del_web_config - add_web_config - fi -fi - - -#----------------------------------------------------------# -# Vesta # -#----------------------------------------------------------# - -# Update config -update_object_value 'web' 'DOMAIN' "$domain" '$ELOG' 'no' - -# Restart web server -if [ "$restart" != 'no' ]; then - $BIN/v-restart-web "$EVENT" -fi - -# Logging -log_history "disabled error logging for $domain" -log_event "$OK" "$EVENT" - -exit diff --git a/bin/v-list-web-domains-elog b/bin/v-list-web-domains-elog deleted file mode 100755 index ed99a044..00000000 --- a/bin/v-list-web-domains-elog +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash -# info: list web domains and elog key -# options: USER [FORMAT] -# -# The function for obtaining the list of domains with parameter ErrorLog -# displayed. This call was arranged for filling in the lack of information by -# applying v-list-web-domains call in the shell format. - - -#----------------------------------------------------------# -# Variable&Function # -#----------------------------------------------------------# - -# Argument defenition -user=$1 -format=${2-shell} - -# Includes -source $VESTA/func/main.sh - - -#----------------------------------------------------------# -# Verifications # -#----------------------------------------------------------# - -check_args '1' "$#" 'USER [FORMAT]' -validate_format 'user' -is_object_valid 'user' 'USER' "$user" - - -#----------------------------------------------------------# -# Action # -#----------------------------------------------------------# - -# Defining config -conf=$USER_DATA/web.conf - -# Defining fileds to select -fields="\$DOMAIN \$ELOG \$SUSPENDED \$TIME \$DATE" - -# Listing domains -case $format in - json) json_list ;; - plain) nohead=1; shell_list ;; - shell) shell_list | column -t ;; - *) check_args '1' '0' 'USER [FORMAT]' -esac - - -#----------------------------------------------------------# -# Vesta # -#----------------------------------------------------------# - -exit diff --git a/install/0.9.7/rhel/templates/web/apache_default.stpl b/install/0.9.7/rhel/templates/web/apache_default.stpl index 71c0fe8a..fad3be95 100755 --- a/install/0.9.7/rhel/templates/web/apache_default.stpl +++ b/install/0.9.7/rhel/templates/web/apache_default.stpl @@ -4,17 +4,17 @@ %alias_string% ServerAdmin %email% DocumentRoot %sdocroot% - %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /error/ %home%/%user%/web/%domain%/document_errors/ SuexecUserGroup %user% %group% CustomLog /var/log/httpd/domains/%domain%.bytes bytes CustomLog /var/log/httpd/domains/%domain%.log combined - %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log + ErrorLog /var/log/httpd/domains/%domain%.error.log AllowOverride All SSLRequireSSL - Options +Includes -Indexes %cgi_option% + Options +Includes -Indexes +ExecCGI AllowOverride All diff --git a/install/0.9.7/rhel/templates/web/apache_default.tpl b/install/0.9.7/rhel/templates/web/apache_default.tpl index 3d3fb016..a17b85dc 100755 --- a/install/0.9.7/rhel/templates/web/apache_default.tpl +++ b/install/0.9.7/rhel/templates/web/apache_default.tpl @@ -4,16 +4,16 @@ %alias_string% ServerAdmin %email% DocumentRoot %docroot% - %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /error/ %home%/%user%/web/%domain%/document_errors/ SuexecUserGroup %user% %group% CustomLog /var/log/httpd/domains/%domain%.bytes bytes CustomLog /var/log/httpd/domains/%domain%.log combined - %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log + ErrorLog /var/log/httpd/domains/%domain%.error.log AllowOverride All - Options +Includes -Indexes %cgi_option% + Options +Includes -Indexes +ExecCGI AllowOverride All diff --git a/install/0.9.7/rhel/templates/web/apache_hosting.stpl b/install/0.9.7/rhel/templates/web/apache_hosting.stpl index 807ee438..3693c1f6 100755 --- a/install/0.9.7/rhel/templates/web/apache_hosting.stpl +++ b/install/0.9.7/rhel/templates/web/apache_hosting.stpl @@ -4,17 +4,17 @@ %alias_string% ServerAdmin %email% DocumentRoot %sdocroot% - %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /error/ %home%/%user%/web/%domain%/document_errors/ SuexecUserGroup %user% %group% CustomLog /var/log/httpd/domains/%domain%.bytes bytes CustomLog /var/log/httpd/domains/%domain%.log combined - %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log + ErrorLog /var/log/httpd/domains/%domain%.error.log AllowOverride AuthConfig FileInfo Indexes Limit SSLRequireSSL - Options +Includes -Indexes %cgi_option% + Options +Includes -Indexes +ExecCGI php_admin_value upload_tmp_dir %home%/%user%/tmp php_admin_value upload_max_filesize 10M php_admin_value max_execution_time 20 diff --git a/install/0.9.7/rhel/templates/web/apache_hosting.tpl b/install/0.9.7/rhel/templates/web/apache_hosting.tpl index 1d29eef7..a4b34af8 100755 --- a/install/0.9.7/rhel/templates/web/apache_hosting.tpl +++ b/install/0.9.7/rhel/templates/web/apache_hosting.tpl @@ -4,16 +4,16 @@ %alias_string% ServerAdmin %email% DocumentRoot %docroot% - %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /error/ %home%/%user%/web/%domain%/document_errors/ SuexecUserGroup %user% %group% CustomLog /var/log/httpd/domains/%domain%.bytes bytes CustomLog /var/log/httpd/domains/%domain%.log combined - %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log + ErrorLog /var/log/httpd/domains/%domain%.error.log AllowOverride AuthConfig FileInfo Indexes Limit - Options +Includes -Indexes %cgi_option% + Options +Includes -Indexes +ExecCGI php_admin_value upload_tmp_dir %home%/%user%/tmp php_admin_value upload_max_filesize 10M php_admin_value max_execution_time 20 diff --git a/install/0.9.7/rhel/templates/web/apache_phpcgi.stpl b/install/0.9.7/rhel/templates/web/apache_phpcgi.stpl index b56dbc37..b3e6488a 100755 --- a/install/0.9.7/rhel/templates/web/apache_phpcgi.stpl +++ b/install/0.9.7/rhel/templates/web/apache_phpcgi.stpl @@ -4,13 +4,13 @@ %alias_string% ServerAdmin %email% DocumentRoot %sdocroot% - %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /error/ %home%/%user%/web/%domain%/document_errors/ SuexecUserGroup %user% %group% CustomLog /var/log/httpd/domains/%domain%.bytes bytes CustomLog /var/log/httpd/domains/%domain%.log combined - %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log + ErrorLog /var/log/httpd/domains/%domain%.error.log SSLRequireSSL AllowOverride All diff --git a/install/0.9.7/rhel/templates/web/apache_phpcgi.tpl b/install/0.9.7/rhel/templates/web/apache_phpcgi.tpl index 4fd56c33..952d2b49 100755 --- a/install/0.9.7/rhel/templates/web/apache_phpcgi.tpl +++ b/install/0.9.7/rhel/templates/web/apache_phpcgi.tpl @@ -4,13 +4,13 @@ %alias_string% ServerAdmin %email% DocumentRoot %docroot% - %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /error/ %home%/%user%/web/%domain%/document_errors/ SuexecUserGroup %user% %group% CustomLog /var/log/httpd/domains/%domain%.bytes bytes CustomLog /var/log/httpd/domains/%domain%.log combined - %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log + ErrorLog /var/log/httpd/domains/%domain%.error.log AllowOverride All Options +Includes -Indexes +ExecCGI diff --git a/install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl b/install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl index 76548ddd..352d268b 100755 --- a/install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl +++ b/install/0.9.7/rhel/templates/web/apache_phpfcgid.stpl @@ -4,13 +4,13 @@ %alias_string% ServerAdmin %email% DocumentRoot %sdocroot% - %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /error/ %home%/%user%/web/%domain%/document_errors/ SuexecUserGroup %user% %group% CustomLog /var/log/httpd/domains/%domain%.bytes bytes CustomLog /var/log/httpd/domains/%domain%.log combined - %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log + ErrorLog /var/log/httpd/domains/%domain%.error.log SSLRequireSSL AllowOverride All diff --git a/install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl b/install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl index 2ae2a212..9826c946 100755 --- a/install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl +++ b/install/0.9.7/rhel/templates/web/apache_phpfcgid.tpl @@ -4,13 +4,13 @@ %alias_string% ServerAdmin %email% DocumentRoot %docroot% - %cgi%ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ + ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/ Alias /vstats/ %home%/%user%/web/%domain%/stats/ Alias /error/ %home%/%user%/web/%domain%/document_errors/ SuexecUserGroup %user% %group% CustomLog /var/log/httpd/domains/%domain%.bytes bytes CustomLog /var/log/httpd/domains/%domain%.log combined - %elog%ErrorLog /var/log/httpd/domains/%domain%.error.log + ErrorLog /var/log/httpd/domains/%domain%.error.log AllowOverride All Options +Includes -Indexes +ExecCGI