Skip to content

Commit c5a7bdc

Browse files
committed
addopted httpd_change_config for nginx and renamed it
1 parent 30512ea commit c5a7bdc

13 files changed

+55
-128
lines changed

bin/v_add_web_domain_alias

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,10 @@ is_package_full 'web_alias'
6262
# Action #
6363
#----------------------------------------------------------#
6464

65-
# Get template name
65+
# Defining params for change function
6666
tpl_name=$(get_web_domain_value '$TPL')
6767
tpl_file="$V_WEBTPL/apache_$tpl_name.tpl"
68-
69-
# Defining config
7068
conf="$V_HOME/$user/conf/httpd.conf"
71-
72-
# Defining search phrase
7369
search_phrase='ServerAlias'
7470

7571
# Defining new alias string
@@ -86,20 +82,16 @@ fi
8682
str_repl=" ServerAlias ${new_alias_idn//,/ }"
8783

8884
# Adding alias
89-
httpd_change_config
85+
change_web_config
9086

9187
# Checking ssl domain
9288
cert=$(get_web_domain_value '$SSL_CERT')
9389
if [ ! -z "$cert" ]; then
9490

95-
# Defining ssl template
91+
# Defining params for change function
9692
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
97-
98-
# Defining ssl config
9993
conf="$V_HOME/$user/conf/shttpd.conf"
100-
101-
# Adding alias
102-
httpd_change_config
94+
change_web_config
10395
fi
10496

10597

bin/v_add_web_domain_cgi

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# info: adding cgi for domain
2+
# info: adding cgi support for domain
33

44
#----------------------------------------------------------#
55
# Variable&Function #
@@ -53,55 +53,32 @@ is_web_domain_key_empty '$CGI'
5353
tpl_name=$(get_web_domain_value '$TPL')
5454
tpl_file="$V_WEBTPL/apache_$tpl_name.tpl"
5555

56-
# Defining config
56+
# Defining params for ScriptAlias
5757
conf="$V_HOME/$user/conf/httpd.conf"
58-
59-
# Defining search phrase
6058
search_phrase='ScriptAlias '
61-
62-
# Defining replace string
6359
str_repl=" ScriptAlias /cgi-bin/ $V_HOME/$user/domains/$domain/cgi-bin/"
60+
change_web_config
6461

65-
# Adding cgi-bin support
66-
httpd_change_config
67-
68-
# Defining search phrase
62+
# Defining params for Options
6963
search_phrase='Options '
70-
71-
# Defining replace string
7264
str_repl=' Options +Includes -Indexes +ExecCGI'
73-
74-
# Adding execscgi support
75-
httpd_change_config
65+
change_web_config
7666

7767
# Checking ssl
7868
cert=$(get_web_domain_value '$SSL_CERT')
7969
if [ ! -z "$cert" ]; then
8070

81-
# Get ssl template name
71+
# Defining params for ScriptAlias
8272
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
83-
84-
# Defining ssl config
8573
conf="$V_HOME/$user/conf/shttpd.conf"
86-
87-
# Defining search phrase
8874
search_phrase='ScriptAlias '
89-
90-
# Defining replace string
9175
str_repl=" ScriptAlias /cgi-bin/ $V_HOME/$user/domains/$domain/cgi-bin/"
76+
change_web_config
9277

93-
# Adding cgi-bin support
94-
httpd_change_config
95-
96-
# Defining search phrase
78+
# Defining params for Options
9779
search_phrase='Options '
98-
99-
# Defining replace string
10080
str_repl=' Options +Includes -Indexes +ExecCGI'
101-
102-
# Adding execscgi support
103-
httpd_change_config
104-
81+
change_web_config
10582
fi
10683

10784

bin/v_add_web_domain_elog

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ search_phrase='ErrorLog '
6363
str_repl=" ErrorLog /var/log/httpd/domains/$domain.error.log"
6464

6565
# Adding errolog support
66-
httpd_change_config
66+
change_web_config
6767

6868
# Checking ssl
6969
cert=$(get_web_domain_value '$SSL_CERT')
@@ -76,7 +76,7 @@ if [ ! -z "$cert" ]; then
7676
conf="$V_HOME/$user/conf/shttpd.conf"
7777

7878
# Adding errolog support
79-
httpd_change_config
79+
change_web_config
8080

8181
fi
8282

bin/v_change_web_domain_sslcert

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ search_phrase='SSLCertificateFile'
7171
str_repl=" SSLCertificateFile $ssl_cert"
7272

7373
# Changing sslhome
74-
httpd_change_config
74+
change_web_config
7575

7676
# Defining search phrase
7777
search_phrase='SSLCertificateKeyFile'
@@ -80,7 +80,7 @@ search_phrase='SSLCertificateKeyFile'
8080
str_repl=" SSLCertificateKeyFile $ssl_key"
8181

8282
# Changing sslhome
83-
httpd_change_config
83+
change_web_config
8484

8585
# Adding certificate to user dir
8686
if [ ! -e "$ssl_cert" ]; then

bin/v_change_web_domain_sslhome

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ esac
7171
str_repl=" DocumentRoot $docroot"
7272

7373
# Changing sslhome
74-
httpd_change_config
74+
change_web_config
7575

7676
# Get old sslhome value
7777
ssl_home=$(get_web_domain_value '$SSL_HOME')
@@ -90,7 +90,7 @@ search_phrase="<Directory $dirroot>"
9090
str_repl=" <Directory $docroot>"
9191

9292
# Changing sslhome directory tag
93-
httpd_change_config
93+
change_web_config
9494

9595

9696
#----------------------------------------------------------#

bin/v_del_web_domain_alias

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,45 +58,34 @@ fi
5858

5959
# Defining new alias string
6060
new_alias=$(echo "$cur_alias" |\
61-
sed -e "s/,/\n/g"|\
62-
sed -e "s/^$dom_alias$//g"|\
63-
sed -e "/^$/d"|\
64-
sed -e ':a;N;$!ba;s/\n/,/g')
61+
sed -e "s/,/\n/g"|\
62+
sed -e "s/^$dom_alias$//g"|\
63+
sed -e "/^$/d"|\
64+
sed -e ':a;N;$!ba;s/\n/,/g')
6565

6666
new_alias_idn=$(idn -t --quiet -a "$cur_alias" |\
67-
sed -e "s/,/\n/g"|\
68-
sed -e "s/^$dom_alias$//g"|\
69-
sed -e "/^$/d"|\
70-
sed -e ':a;N;$!ba;s/\n/,/g')
67+
sed -e "s/,/\n/g"|\
68+
sed -e "s/^$dom_alias$//g"|\
69+
sed -e "/^$/d"|\
70+
sed -e ':a;N;$!ba;s/\n/,/g')
7171

72-
# Get template name
7372
tpl_name=$(get_web_domain_value '$TPL')
7473
tpl_file="$V_WEBTPL/apache_$tpl_name.tpl"
75-
76-
# Defining config
7774
conf="$V_HOME/$user/conf/httpd.conf"
78-
79-
# Defining search phrase
8075
search_phrase='ServerAlias'
81-
82-
# Defining replace string
8376
str_repl=" ServerAlias ${new_alias_idn//,/ }"
8477

8578
# Deleting alias
86-
httpd_change_config
79+
change_web_config
8780

88-
# Checking ssl domain
81+
# Checking ssl
8982
cert=$(get_web_domain_value '$SSL_CERT')
9083
if [ ! -z "$cert" ]; then
9184

92-
# Defining ssl template
85+
# Defining ssl options
9386
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
94-
95-
# Defining ssl config
9687
conf="$V_HOME/$user/conf/shttpd.conf"
97-
98-
# Deleting ssl alias
99-
httpd_change_config
88+
change_web_config
10089
fi
10190

10291

bin/v_del_web_domain_cgi

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -53,55 +53,32 @@ is_web_domain_value_exist '$CGI'
5353
tpl_name=$(get_web_domain_value '$TPL')
5454
tpl_file="$V_WEBTPL/apache_$tpl_name.tpl"
5555

56-
# Defining config
56+
# Defining params for ScriptAlias
5757
conf="$V_HOME/$user/conf/httpd.conf"
58-
59-
# Defining search phrase
6058
search_phrase='ScriptAlias '
61-
62-
# Defining replace string
6359
str_repl=" #ScriptAlias /cgi-bin/ $V_HOME/$user/domains/$domain/cgi-bin"
60+
change_web_config
6461

65-
# Deleting cgi-bin support
66-
httpd_change_config
67-
68-
# Defining search phrase
62+
# Defining params for Options
6963
search_phrase='Options '
70-
71-
# Defining replace string
7264
str_repl=' Options +Includes -Indexes -ExecCGI'
73-
74-
# Deleting execscgi support
75-
httpd_change_config
65+
change_web_config
7666

7767
# Checking ssl
7868
cert=$(get_web_domain_value '$SSL_CERT')
7969
if [ ! -z "$cert" ]; then
8070

81-
# Get ssl template name
71+
# Defining params for ScriptAlias
8272
tpl_file="$V_WEBTPL/apache_$tpl_name.stpl"
83-
84-
# Defining ssl config
8573
conf="$V_HOME/$user/conf/shttpd.conf"
86-
87-
# Defining search phrase
8874
search_phrase='ScriptAlias '
89-
90-
# Defining replace string
9175
str_repl=" #ScriptAlias /cgi-bin/ $V_HOME/$user/domains/$domain/cgi-bin"
76+
change_web_config
9277

93-
# Deleting cgi-bin support
94-
httpd_change_config
95-
96-
# Defining search phrase
78+
# Defining params for Options
9779
search_phrase='Options '
98-
99-
# Defining replace string
10080
str_repl=' Options +Includes -Indexes -ExecCGI'
101-
102-
# Deleting execscgi support
103-
httpd_change_config
104-
81+
change_web_config
10582
fi
10683

10784

bin/v_del_web_domain_elog

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ search_phrase='ErrorLog '
6363
str_repl=" #ErrorLog /var/log/httpd/domains/$domain.error.log"
6464

6565
# Deleting errolog support
66-
httpd_change_config
66+
change_web_config
6767

6868
# Checking ssl
6969
cert=$(get_web_domain_value '$SSL_CERT')
@@ -76,7 +76,7 @@ if [ ! -z "$cert" ]; then
7676
conf="$V_HOME/$user/conf/shttpd.conf"
7777

7878
# Deleting errolog support
79-
httpd_change_config
79+
change_web_config
8080

8181
fi
8282

bin/v_suspend_web_domain

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ search_phrase='DocumentRoot '
6060
str_repl=" Redirect / http://$url/"
6161

6262
# Suspending vhost
63-
httpd_change_config
63+
change_web_config
6464

6565
# Check ssl vhost
6666
cert=$(get_web_domain_value '$SSL_CERT')
@@ -75,7 +75,7 @@ if [ ! -z "$cert" ]; then
7575
str_repl=" Redirect / http://$url/"
7676

7777
# Suspending vhost
78-
httpd_change_config
78+
change_web_config
7979
fi
8080

8181

bin/v_suspend_web_domains

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ for domain in $domains; do
6767
str_repl=" Redirect / http://$url/"
6868

6969
# Suspending vhost
70-
httpd_change_config
70+
change_web_config
7171

7272
# Check ssl vhost
7373
cert=$(get_web_domain_value '$SSL_CERT')
@@ -82,7 +82,7 @@ for domain in $domains; do
8282
str_repl=" Redirect / http://$url/"
8383

8484
# Suspending vhost
85-
httpd_change_config
85+
change_web_config
8686
fi
8787

8888
# Adding suspend in config

0 commit comments

Comments
 (0)