removing old functional

This commit is contained in:
Serghey Rodin 2013-02-05 22:57:55 +02:00
commit 579815608c
13 changed files with 20 additions and 429 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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
<Directory %sdocroot%>
AllowOverride All
SSLRequireSSL
Options +Includes -Indexes %cgi_option%
Options +Includes -Indexes +ExecCGI
</Directory>
<Directory %home%/%user%/web/%domain%/stats>
AllowOverride All

View file

@ -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
<Directory %docroot%>
AllowOverride All
Options +Includes -Indexes %cgi_option%
Options +Includes -Indexes +ExecCGI
</Directory>
<Directory %home%/%user%/web/%domain%/stats>
AllowOverride All

View file

@ -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
<Directory %sdocroot%>
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

View file

@ -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
<Directory %docroot%>
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

View file

@ -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
<Directory %sdocroot%>
SSLRequireSSL
AllowOverride All

View file

@ -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
<Directory %docroot%>
AllowOverride All
Options +Includes -Indexes +ExecCGI

View file

@ -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
<Directory %sdocroot%>
SSLRequireSSL
AllowOverride All

View file

@ -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
<Directory %docroot%>
AllowOverride All
Options +Includes -Indexes +ExecCGI