This repository was archived by the owner on Jul 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 22
33source /etc/apache-bootstrap.conf
44
5+ add_hosts_entry ()
6+ {
7+ local IP=${1:- 127.0.0.1}
8+ local HOSTS
9+ local USAGE=" Usage: $0 ip_address hostname [hostname ...]"
10+
11+ shift
12+ if [[ ${# } -eq 0 ]]; then
13+ echo ${USAGE}
14+ exit 1
15+ fi
16+
17+ while (( ${# } )) ; do
18+ if [[ ${1} != ' localhost' ]] && [[ ${1} != ' 127.0.0.1' ]] && [[ ${1} != ${IP} ]]; then
19+ HOSTS+=" ${1} "
20+ fi
21+ shift
22+ done
23+
24+ printf -- " %s\t%s\n" " ${IP} " " ${HOSTS} " >> /etc/hosts
25+ }
26+
527get_password ()
628{
729 echo $( head -n 4096 /dev/urandom | tr -cd ' [:alnum:]' | head -c ${1} )
@@ -19,9 +41,10 @@ set_apache_server_name ()
1941
2042APP_HOME_DIR_TEMPLATE=" /var/www/.app-skel"
2143
44+ OPTS_APACHE_SERVER_ALIAS=" ${APACHE_SERVER_ALIAS:- } "
2245OPTS_APACHE_SERVER_NAME=" ${APACHE_SERVER_NAME:- $(hostname)} "
23- OPTS_APACHE_MOD_SSL_ENABLED=" ${APACHE_MOD_SSL_ENABLED:- false} "
2446OPTS_APACHE_LOAD_MODULES=" ${APACHE_LOAD_MODULES:- authz_user_module log_config_module expires_module deflate_module headers_module setenvif_module mime_module status_module dir_module alias_module reqtimeout_module} "
47+ OPTS_APACHE_MOD_SSL_ENABLED=" ${APACHE_MOD_SSL_ENABLED:- false} "
2548OPTS_APP_HOME_DIR=" ${APP_HOME_DIR:-/ var/ www/ app} "
2649OPTS_SERVICE_USER=" ${SERVICE_USER:- app} "
2750OPTS_SERVICE_USER_GROUP=" ${SERVICE_USER_GROUP:- app-www} "
6891 exit 1
6992fi
7093
94+ # Add local hosts entries
95+ add_hosts_entry 127.0.0.1 ${OPTS_APACHE_SERVER_NAME}${OPTS_APACHE_SERVER_ALIAS: + }${OPTS_APACHE_SERVER_ALIAS}
96+
7197# Add ServerName
7298set_apache_server_name ${OPTS_APACHE_SERVER_NAME} 80
7399
You can’t perform that action at this time.
0 commit comments