mirror of
https://github.com/myvesta/vesta
synced 2025-08-19 21:04:07 -07:00
extended %elog% support
This commit is contained in:
parent
380f389d13
commit
0b5cf52114
4 changed files with 64 additions and 21 deletions
|
@ -81,13 +81,26 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Defining vars for httpd_add_config function
|
# Defining vars for httpd_add_config function
|
||||||
port=$(get_config_value '$WEB_PORT')
|
web_port=$(get_config_value '$WEB_PORT')
|
||||||
group="$user"
|
group="$user"
|
||||||
email="$user@$domain"
|
email="$user@$domain"
|
||||||
docroot="$V_HOME/$user/domains/$domain/public_html"
|
docroot="$V_HOME/$user/domains/$domain/public_html"
|
||||||
conf="$V_HOME/$user/conf/httpd.conf"
|
conf="$V_HOME/$user/conf/httpd.conf"
|
||||||
tpl_file="$V_WEBTPL/apache_$template.tpl"
|
tpl_file="$V_WEBTPL/apache_$template.tpl"
|
||||||
|
|
||||||
|
# Parsing template keys
|
||||||
|
template_data=$(cat $V_WEBTPL/apache_$template.descr|grep -v '#')
|
||||||
|
for keys in $template_data; do
|
||||||
|
eval ${keys%%=*}=${keys#*=}
|
||||||
|
done
|
||||||
|
|
||||||
|
# Checking error log status
|
||||||
|
if [ "$ELOG" = 'no' ]; then
|
||||||
|
elog=' #'
|
||||||
|
else
|
||||||
|
elog=' '
|
||||||
|
fi
|
||||||
|
|
||||||
# Adding domain to the httpd.conf
|
# Adding domain to the httpd.conf
|
||||||
httpd_add_config
|
httpd_add_config
|
||||||
|
|
||||||
|
@ -139,8 +152,8 @@ chmod 551 $V_HOME/$user/domains/$domain/logs
|
||||||
chmod 640 /var/log/httpd/domains/$domain.*
|
chmod 640 /var/log/httpd/domains/$domain.*
|
||||||
|
|
||||||
# Running template trigger
|
# Running template trigger
|
||||||
if [ -e $V_WEBTPL/apache_$template.sh ]; then
|
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
||||||
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot $port
|
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking main vesta httpd config
|
# Checking main vesta httpd config
|
||||||
|
@ -162,7 +175,6 @@ increase_ip_value
|
||||||
increase_user_value "$user" '$U_WEB_DOMAINS'
|
increase_user_value "$user" '$U_WEB_DOMAINS'
|
||||||
|
|
||||||
# Defining domain variables
|
# Defining domain variables
|
||||||
template_data=$(cat $V_WEBTPL/apache_$template.descr|grep -v '#')
|
|
||||||
v_str="DOMAIN='$domain'"
|
v_str="DOMAIN='$domain'"
|
||||||
v_str="$v_str IP='$ip'"
|
v_str="$v_str IP='$ip'"
|
||||||
v_str="$v_str U_DISK='0'"
|
v_str="$v_str U_DISK='0'"
|
||||||
|
|
|
@ -68,7 +68,7 @@ is_template_valid 'web'
|
||||||
#----------------------------------------------------------#
|
#----------------------------------------------------------#
|
||||||
|
|
||||||
# Defining variables for template replace
|
# Defining variables for template replace
|
||||||
port=$(get_config_value '$WEB_SSL_PORT')
|
web_ssl_port=$(get_config_value '$WEB_SSL_PORT')
|
||||||
aliases=$(get_web_domain_value '$ALIAS')
|
aliases=$(get_web_domain_value '$ALIAS')
|
||||||
aliases_idn=$(idn -t --quiet -a "$aliases")
|
aliases_idn=$(idn -t --quiet -a "$aliases")
|
||||||
email="$user@$domain"
|
email="$user@$domain"
|
||||||
|
@ -83,6 +83,14 @@ group="$user"
|
||||||
conf="$V_HOME/$user/conf/shttpd.conf"
|
conf="$V_HOME/$user/conf/shttpd.conf"
|
||||||
tpl_file="$V_WEBTPL/apache_$template.stpl"
|
tpl_file="$V_WEBTPL/apache_$template.stpl"
|
||||||
|
|
||||||
|
# Checking error log status
|
||||||
|
elog=$(get_web_domain_value '$ELOG')
|
||||||
|
if [ "$elog" = 'no' ]; then
|
||||||
|
elog=' #'
|
||||||
|
else
|
||||||
|
elog=' '
|
||||||
|
fi
|
||||||
|
|
||||||
# Adding domain to the httpd.conf
|
# Adding domain to the httpd.conf
|
||||||
httpd_add_config
|
httpd_add_config
|
||||||
|
|
||||||
|
@ -93,8 +101,8 @@ if [ ! -e "$ssl_cert" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Running template trigger
|
# Running template trigger
|
||||||
if [ -e $V_WEBTPL/apache_$template.sh ]; then
|
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
||||||
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot $port
|
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking main vesta httpd config
|
# Checking main vesta httpd config
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
# Argument defenition
|
# Argument defenition
|
||||||
user="$1"
|
user="$1"
|
||||||
domain="$2"
|
domain=$(idn -t --quiet -u "$2" )
|
||||||
|
domain_idn=$(idn -t --quiet -a "$domain")
|
||||||
template="$3"
|
template="$3"
|
||||||
|
|
||||||
# Importing variables
|
# Importing variables
|
||||||
|
@ -73,25 +74,39 @@ fi
|
||||||
# Defining variables for template replace
|
# Defining variables for template replace
|
||||||
ip=$(get_web_domain_value '$IP')
|
ip=$(get_web_domain_value '$IP')
|
||||||
aliases=$(get_web_domain_value '$ALIAS')
|
aliases=$(get_web_domain_value '$ALIAS')
|
||||||
port=$(get_config_value '$WEB_PORT')
|
aliases_idn=$(idn -t --quiet -a "$aliases")
|
||||||
|
web_port=$(get_config_value '$WEB_PORT')
|
||||||
email="$user@$domain"
|
email="$user@$domain"
|
||||||
docroot="$V_HOME/$user/domains/$domain/public_html"
|
docroot="$V_HOME/$user/domains/$domain/public_html"
|
||||||
conf="$V_HOME/$user/conf/httpd.conf"
|
conf="$V_HOME/$user/conf/httpd.conf"
|
||||||
tpl_file="$V_WEBTPL/apache_$template.tpl"
|
tpl_file="$V_WEBTPL/apache_$template.tpl"
|
||||||
group="$user"
|
group="$user"
|
||||||
|
|
||||||
|
# Parsing template keys
|
||||||
|
template_data=$(cat $V_WEBTPL/apache_$template.descr|grep -v '#')
|
||||||
|
for keys in $template_data; do
|
||||||
|
eval ${keys%%=*}=${keys#*=}
|
||||||
|
done
|
||||||
|
|
||||||
|
# Checking error log status
|
||||||
|
if [ "$ELOG" = 'no' ]; then
|
||||||
|
elog=' #'
|
||||||
|
else
|
||||||
|
elog=' '
|
||||||
|
fi
|
||||||
|
|
||||||
# Adding domain to the httpd.conf
|
# Adding domain to the httpd.conf
|
||||||
httpd_add_config
|
httpd_add_config
|
||||||
|
|
||||||
# Running template post setup file
|
# Running template trigger
|
||||||
if [ -e $V_WEBTPL/apache_$template.sh ]; then
|
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
||||||
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot $port
|
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
if [ "$ssl" = 'yes' ]; then
|
if [ "$ssl" = 'yes' ]; then
|
||||||
# Defining variables for ssl template replace
|
# Defining variables for ssl template replace
|
||||||
port=$(get_config_value '$WEB_SSL_PORT')
|
web_ssl_port=$(get_config_value '$WEB_SSL_PORT')
|
||||||
tpl_option=$(get_web_domain_value '$SSL_HOME')
|
tpl_option=$(get_web_domain_value '$SSL_HOME')
|
||||||
cert=$(get_web_domain_value '$SSL_CERT')
|
cert=$(get_web_domain_value '$SSL_CERT')
|
||||||
ssl_cert="$V_HOME/$user/conf/$cert.crt"
|
ssl_cert="$V_HOME/$user/conf/$cert.crt"
|
||||||
|
@ -106,10 +121,10 @@ if [ "$ssl" = 'yes' ]; then
|
||||||
# Adding domain to the httpd.conf
|
# Adding domain to the httpd.conf
|
||||||
httpd_add_config
|
httpd_add_config
|
||||||
|
|
||||||
# Running template post setup file
|
# Running template trigger
|
||||||
if [ -e $V_WEBTPL/apache_$template.sh ]; then
|
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
||||||
$V_WEBTPL/apache_$template.sh \
|
$V_WEBTPL/apache_$template.sh \
|
||||||
"$user" "$domain" "$ip" "$V_HOME" "$docroot" "$port"
|
"$user" "$domain" "$ip" "$V_HOME" "$docroot"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ for domain in $domains; do
|
||||||
template=$(get_web_domain_value '$TPL')
|
template=$(get_web_domain_value '$TPL')
|
||||||
tpl_file="$V_WEBTPL/apache_$template.tpl"
|
tpl_file="$V_WEBTPL/apache_$template.tpl"
|
||||||
ip=$(get_web_domain_value '$IP')
|
ip=$(get_web_domain_value '$IP')
|
||||||
port=$(get_config_value '$WEB_PORT')
|
web_port=$(get_config_value '$WEB_PORT')
|
||||||
domain=$(get_web_domain_value '$DOMAIN')
|
domain=$(get_web_domain_value '$DOMAIN')
|
||||||
domain_idn=$(idn -t --quiet -a "$domain")
|
domain_idn=$(idn -t --quiet -a "$domain")
|
||||||
group="$user"
|
group="$user"
|
||||||
|
@ -67,13 +67,21 @@ for domain in $domains; do
|
||||||
aliases=$(get_web_domain_value '$ALIAS')
|
aliases=$(get_web_domain_value '$ALIAS')
|
||||||
aliases_idn=$(idn -t --quiet -a "$aliases")
|
aliases_idn=$(idn -t --quiet -a "$aliases")
|
||||||
|
|
||||||
|
# Checking error log status
|
||||||
|
elog=$(get_web_domain_value '$ELOG')
|
||||||
|
if [ "$elog" = 'no' ]; then
|
||||||
|
elog=' #'
|
||||||
|
else
|
||||||
|
elog=' '
|
||||||
|
fi
|
||||||
|
|
||||||
# Adding domain to the tmp_httpd.conf
|
# Adding domain to the tmp_httpd.conf
|
||||||
conf="$V_HOME/$user/conf/tmp_httpd.conf"
|
conf="$V_HOME/$user/conf/tmp_httpd.conf"
|
||||||
httpd_add_config
|
httpd_add_config
|
||||||
|
|
||||||
# Running template trigger
|
# Running template trigger
|
||||||
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
||||||
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot $port
|
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking ssl
|
# Checking ssl
|
||||||
|
@ -89,16 +97,16 @@ for domain in $domains; do
|
||||||
same) docroot="$V_HOME/$user/domains/$domain/public_html" ;;
|
same) docroot="$V_HOME/$user/domains/$domain/public_html" ;;
|
||||||
*) check_args '3' "$#" 'user domain certificate [sslhome]'
|
*) check_args '3' "$#" 'user domain certificate [sslhome]'
|
||||||
esac
|
esac
|
||||||
port=$(get_config_value '$WEB_SSL_PORT')
|
web_ssl_port=$(get_config_value '$WEB_SSL_PORT')
|
||||||
|
|
||||||
# Adding domain to the httpd.conf
|
# Adding domain to the httpd.conf
|
||||||
conf="$V_HOME/$user/conf/tmp_shttpd.conf"
|
conf="$V_HOME/$user/conf/tmp_shttpd.conf"
|
||||||
tpl_file="$V_WEBTPL/apache_$template.stpl"
|
tpl_file="$V_WEBTPL/apache_$template.stpl"
|
||||||
httpd_add_config
|
httpd_add_config
|
||||||
|
|
||||||
|
# Running template trigger
|
||||||
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
if [ -x $V_WEBTPL/apache_$template.sh ]; then
|
||||||
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME \
|
$V_WEBTPL/apache_$template.sh $user $domain $ip $V_HOME $docroot
|
||||||
$docroot $port
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue