mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
addopted httpd_change_config for nginx and renamed it
This commit is contained in:
parent
30512ea575
commit
c5a7bdc8d5
13 changed files with 55 additions and 128 deletions
|
@ -62,14 +62,10 @@ is_package_full 'web_alias'
|
|||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Get template name
|
||||
# Defining params for change function
|
||||
tpl_name=$(get_web_domain_value '$TPL')
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.tpl"
|
||||
|
||||
# Defining config
|
||||
conf="$V_HOME/$user/conf/httpd.conf"
|
||||
|
||||
# Defining search phrase
|
||||
search_phrase='ServerAlias'
|
||||
|
||||
# Defining new alias string
|
||||
|
@ -86,20 +82,16 @@ fi
|
|||
str_repl=" ServerAlias ${new_alias_idn//,/ }"
|
||||
|
||||
# Adding alias
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Checking ssl domain
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Defining ssl template
|
||||
# Defining params for change function
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
||||
# Defining ssl config
|
||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||
|
||||
# Adding alias
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
# info: adding cgi for domain
|
||||
# info: adding cgi support for domain
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
|
@ -53,55 +53,32 @@ is_web_domain_key_empty '$CGI'
|
|||
tpl_name=$(get_web_domain_value '$TPL')
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.tpl"
|
||||
|
||||
# Defining config
|
||||
# Defining params for ScriptAlias
|
||||
conf="$V_HOME/$user/conf/httpd.conf"
|
||||
|
||||
# Defining search phrase
|
||||
search_phrase='ScriptAlias '
|
||||
|
||||
# Defining replace string
|
||||
str_repl=" ScriptAlias /cgi-bin/ $V_HOME/$user/domains/$domain/cgi-bin/"
|
||||
change_web_config
|
||||
|
||||
# Adding cgi-bin support
|
||||
httpd_change_config
|
||||
|
||||
# Defining search phrase
|
||||
# Defining params for Options
|
||||
search_phrase='Options '
|
||||
|
||||
# Defining replace string
|
||||
str_repl=' Options +Includes -Indexes +ExecCGI'
|
||||
|
||||
# Adding execscgi support
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Checking ssl
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Get ssl template name
|
||||
# Defining params for ScriptAlias
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
||||
# Defining ssl config
|
||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||
|
||||
# Defining search phrase
|
||||
search_phrase='ScriptAlias '
|
||||
|
||||
# Defining replace string
|
||||
str_repl=" ScriptAlias /cgi-bin/ $V_HOME/$user/domains/$domain/cgi-bin/"
|
||||
change_web_config
|
||||
|
||||
# Adding cgi-bin support
|
||||
httpd_change_config
|
||||
|
||||
# Defining search phrase
|
||||
# Defining params for Options
|
||||
search_phrase='Options '
|
||||
|
||||
# Defining replace string
|
||||
str_repl=' Options +Includes -Indexes +ExecCGI'
|
||||
|
||||
# Adding execscgi support
|
||||
httpd_change_config
|
||||
|
||||
change_web_config
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ search_phrase='ErrorLog '
|
|||
str_repl=" ErrorLog /var/log/httpd/domains/$domain.error.log"
|
||||
|
||||
# Adding errolog support
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Checking ssl
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
|
@ -76,7 +76,7 @@ if [ ! -z "$cert" ]; then
|
|||
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||
|
||||
# Adding errolog support
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
fi
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ search_phrase='SSLCertificateFile'
|
|||
str_repl=" SSLCertificateFile $ssl_cert"
|
||||
|
||||
# Changing sslhome
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Defining search phrase
|
||||
search_phrase='SSLCertificateKeyFile'
|
||||
|
@ -80,7 +80,7 @@ search_phrase='SSLCertificateKeyFile'
|
|||
str_repl=" SSLCertificateKeyFile $ssl_key"
|
||||
|
||||
# Changing sslhome
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Adding certificate to user dir
|
||||
if [ ! -e "$ssl_cert" ]; then
|
||||
|
|
|
@ -71,7 +71,7 @@ esac
|
|||
str_repl=" DocumentRoot $docroot"
|
||||
|
||||
# Changing sslhome
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Get old sslhome value
|
||||
ssl_home=$(get_web_domain_value '$SSL_HOME')
|
||||
|
@ -90,7 +90,7 @@ search_phrase="<Directory $dirroot>"
|
|||
str_repl=" <Directory $docroot>"
|
||||
|
||||
# Changing sslhome directory tag
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
|
|
|
@ -58,45 +58,34 @@ fi
|
|||
|
||||
# Defining new alias string
|
||||
new_alias=$(echo "$cur_alias" |\
|
||||
sed -e "s/,/\n/g"|\
|
||||
sed -e "s/^$dom_alias$//g"|\
|
||||
sed -e "/^$/d"|\
|
||||
sed -e ':a;N;$!ba;s/\n/,/g')
|
||||
sed -e "s/,/\n/g"|\
|
||||
sed -e "s/^$dom_alias$//g"|\
|
||||
sed -e "/^$/d"|\
|
||||
sed -e ':a;N;$!ba;s/\n/,/g')
|
||||
|
||||
new_alias_idn=$(idn -t --quiet -a "$cur_alias" |\
|
||||
sed -e "s/,/\n/g"|\
|
||||
sed -e "s/^$dom_alias$//g"|\
|
||||
sed -e "/^$/d"|\
|
||||
sed -e ':a;N;$!ba;s/\n/,/g')
|
||||
sed -e "s/,/\n/g"|\
|
||||
sed -e "s/^$dom_alias$//g"|\
|
||||
sed -e "/^$/d"|\
|
||||
sed -e ':a;N;$!ba;s/\n/,/g')
|
||||
|
||||
# Get template name
|
||||
tpl_name=$(get_web_domain_value '$TPL')
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.tpl"
|
||||
|
||||
# Defining config
|
||||
conf="$V_HOME/$user/conf/httpd.conf"
|
||||
|
||||
# Defining search phrase
|
||||
search_phrase='ServerAlias'
|
||||
|
||||
# Defining replace string
|
||||
str_repl=" ServerAlias ${new_alias_idn//,/ }"
|
||||
|
||||
# Deleting alias
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Checking ssl domain
|
||||
# Checking ssl
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Defining ssl template
|
||||
# Defining ssl options
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
||||
# Defining ssl config
|
||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||
|
||||
# Deleting ssl alias
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -53,55 +53,32 @@ is_web_domain_value_exist '$CGI'
|
|||
tpl_name=$(get_web_domain_value '$TPL')
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.tpl"
|
||||
|
||||
# Defining config
|
||||
# Defining params for ScriptAlias
|
||||
conf="$V_HOME/$user/conf/httpd.conf"
|
||||
|
||||
# Defining search phrase
|
||||
search_phrase='ScriptAlias '
|
||||
|
||||
# Defining replace string
|
||||
str_repl=" #ScriptAlias /cgi-bin/ $V_HOME/$user/domains/$domain/cgi-bin"
|
||||
change_web_config
|
||||
|
||||
# Deleting cgi-bin support
|
||||
httpd_change_config
|
||||
|
||||
# Defining search phrase
|
||||
# Defining params for Options
|
||||
search_phrase='Options '
|
||||
|
||||
# Defining replace string
|
||||
str_repl=' Options +Includes -Indexes -ExecCGI'
|
||||
|
||||
# Deleting execscgi support
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Checking ssl
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
if [ ! -z "$cert" ]; then
|
||||
|
||||
# Get ssl template name
|
||||
# Defining params for ScriptAlias
|
||||
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
|
||||
|
||||
# Defining ssl config
|
||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||
|
||||
# Defining search phrase
|
||||
search_phrase='ScriptAlias '
|
||||
|
||||
# Defining replace string
|
||||
str_repl=" #ScriptAlias /cgi-bin/ $V_HOME/$user/domains/$domain/cgi-bin"
|
||||
change_web_config
|
||||
|
||||
# Deleting cgi-bin support
|
||||
httpd_change_config
|
||||
|
||||
# Defining search phrase
|
||||
# Defining params for Options
|
||||
search_phrase='Options '
|
||||
|
||||
# Defining replace string
|
||||
str_repl=' Options +Includes -Indexes -ExecCGI'
|
||||
|
||||
# Deleting execscgi support
|
||||
httpd_change_config
|
||||
|
||||
change_web_config
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ search_phrase='ErrorLog '
|
|||
str_repl=" #ErrorLog /var/log/httpd/domains/$domain.error.log"
|
||||
|
||||
# Deleting errolog support
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Checking ssl
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
|
@ -76,7 +76,7 @@ if [ ! -z "$cert" ]; then
|
|||
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||
|
||||
# Deleting errolog support
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
fi
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ search_phrase='DocumentRoot '
|
|||
str_repl=" Redirect / http://$url/"
|
||||
|
||||
# Suspending vhost
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Check ssl vhost
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
|
@ -75,7 +75,7 @@ if [ ! -z "$cert" ]; then
|
|||
str_repl=" Redirect / http://$url/"
|
||||
|
||||
# Suspending vhost
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ for domain in $domains; do
|
|||
str_repl=" Redirect / http://$url/"
|
||||
|
||||
# Suspending vhost
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Check ssl vhost
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
|
@ -82,7 +82,7 @@ for domain in $domains; do
|
|||
str_repl=" Redirect / http://$url/"
|
||||
|
||||
# Suspending vhost
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
fi
|
||||
|
||||
# Adding suspend in config
|
||||
|
|
|
@ -57,7 +57,7 @@ search_phrase='Redirect / '
|
|||
str_repl=" DocumentRoot $V_HOME/$user/domains/$domain/public_html"
|
||||
|
||||
# Unsuspending vhost
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Check ssl vhost
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
|
@ -79,7 +79,7 @@ if [ ! -z "$cert" ]; then
|
|||
str_repl=" DocumentRoot $docroot"
|
||||
|
||||
# Unsuspending vhost
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ for domain in $domains; do
|
|||
str_repl=" DocumentRoot $V_HOME/$user/domains/$domain/public_html"
|
||||
|
||||
# Unsuspending vhost
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
|
||||
# Check ssl vhost
|
||||
cert=$(get_web_domain_value '$SSL_CERT')
|
||||
|
@ -86,7 +86,7 @@ for domain in $domains; do
|
|||
str_repl=" DocumentRoot $docroot"
|
||||
|
||||
# Unsuspending vhost
|
||||
httpd_change_config
|
||||
change_web_config
|
||||
fi
|
||||
|
||||
# Adding unsuspend in config
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue