added ssl support

This commit is contained in:
Serghey Rodin 2011-06-30 00:29:47 +03:00
commit 9f1d16d87a
3 changed files with 38 additions and 9 deletions

View file

@ -59,7 +59,6 @@ is_template_valid "proxy"
ip=$(get_web_domain_value '$IP')
web_port=$(get_config_value '$WEB_PORT')
proxy_port=$(get_config_value '$PROXY_PORT')
domain=$(get_web_domain_value '$DOMAIN')
domain_idn=$(idn -t --quiet -a "$domain")
group="$user"
docroot="$V_HOME/$user/domains/$domain/public_html"
@ -87,6 +86,34 @@ if [ -z "$main_conf_check" ]; then
echo "include $conf;" >>$main_conf
fi
# Checking ssl
cert=$(get_web_domain_value '$SSL_CERT')
if [ ! -z "$cert" ]; then
# Defining certificate params
ssl_cert="$V_HOME/$user/conf/$cert.crt"
ssl_key="$V_HOME/$user/conf/$cert.key"
tpl_option=$(get_web_domain_value '$SSL_HOME')
case $tpl_option in
single) docroot="$V_HOME/$user/domains/$domain/public_shtml" ;;
same) docroot="$V_HOME/$user/domains/$domain/public_html" ;;
*) check_args '3' "$#" 'user domain certificate [sslhome]'
esac
web_ssl_port=$(get_config_value '$WEB_SSL_PORT')
proxy_ssl_port=$(get_config_value '$PROXY_SSL_PORT')
# Adding domain to the snginx.conf
conf="$V_HOME/$user/conf/snginx.conf"
tpl_file="$V_WEBTPL/ngingx_vhost_$template.stpl"
httpd_add_config
# Checking vesta nginx config
main_conf='/etc/nginx/conf.d/vesta_users.conf'
main_conf_check=$(grep "$conf" $main_conf )
if [ -z "$main_conf_check" ]; then
echo "include $conf;" >>$main_conf
fi
fi
#----------------------------------------------------------#
# Vesta #

View file

@ -51,7 +51,7 @@ field='$DOMAIN'
# Parsing unsuspeneded domains
domains=$(dom_clear_search)
# Starting update disk loop
# Starting loop
for domain in $domains; do
# Defining domain parameters
@ -85,10 +85,9 @@ for domain in $domains; do
fi
# Checking ssl
ssl=$(get_web_domain_value '$SSL')
if [ "$ssl" = 'yes' ]; then
# Parsing certificate params
cert=$(get_web_domain_value '$SSL_CERT')
cert=$(get_web_domain_value '$SSL_CERT')
if [ ! -z "$cert" ]; then
# Defining certificate params
ssl_cert="$V_HOME/$user/conf/$cert.crt"
ssl_key="$V_HOME/$user/conf/$cert.key"
tpl_option=$(get_web_domain_value '$SSL_HOME')
@ -99,7 +98,7 @@ for domain in $domains; do
esac
web_ssl_port=$(get_config_value '$WEB_SSL_PORT')
# Adding domain to the httpd.conf
# Adding domain to the shttpd.conf
conf="$V_HOME/$user/conf/tmp_shttpd.conf"
tpl_file="$V_WEBTPL/apache_$template.stpl"
httpd_add_config