@@ -111,6 +111,86 @@ run "sed -i'' 's/^Group[[:space:]]*=.*$/Group = ${MY_GROUP}/g' ${HTTPD_CONF}"
111111run " sed -i'' 's/^Listen[[:space:]].*$/Listen 0.0.0.0:80/g' ${HTTPD_CONF} "
112112run " sed -i'' 's/^#ServerName[[:space:]].*$/ServerName localhost:80/g' ${HTTPD_CONF} "
113113
114+ # Add Custom http Configuration
115+ {
116+ echo " CustomLog \" /var/log/httpd/access_log\" combined" ;
117+ echo " ErrorLog \" /var/log/httpd/error_log\" " ;
118+ echo " LogLevel warn" ;
119+ echo ;
120+
121+ echo " AddDefaultCharset UTF-8" ;
122+ echo ;
123+
124+ echo " HostnameLookups Off" ;
125+ echo ;
126+
127+ echo " Timeout 60" ;
128+ echo " KeepAlive On" ;
129+ echo " KeepAliveTimeout 10" ;
130+ echo " MaxKeepAliveRequests 100" ;
131+ echo ;
132+
133+ echo " EnableMMAP Off" ;
134+ echo " EnableSendfile Off" ;
135+ echo ;
136+
137+ echo " XSendFile On" ;
138+ echo " XSendFilePath /var/www/html" ;
139+ echo ;
140+
141+ } > " /etc/httpd/conf.d/http-defaults.conf"
142+
143+
144+ # Add Default vhost Configuration
145+ {
146+ echo " <VirtualHost _default_:80>" ;
147+ echo " ServerName localhost" ;
148+ echo " ServerAdmin root@localhost" ;
149+ echo ;
150+
151+ echo " ErrorLog /var/log/httpd/localhost-error.log" ;
152+ echo " CustomLog /var/log/httpd/localhost-access.log combined" ;
153+ echo ;
154+
155+ echo " DirectoryIndex index.html index.htm index.php" ;
156+ echo ;
157+
158+ echo " DocumentRoot \" /var/www/html\" " ;
159+ echo ;
160+
161+ echo " <Directory \" /var/www/html\" >" ;
162+ echo " DirectoryIndex index.html index.htm index.php" ;
163+ echo ;
164+
165+ echo " AllowOverride All" ;
166+ echo " Options All" ;
167+ echo ;
168+
169+ echo " RewriteEngine on" ;
170+ echo " RewriteBase /" ;
171+ echo ;
172+
173+ echo " Order allow,deny" ;
174+ echo " Allow from all" ;
175+ echo " Require all granted" ;
176+ echo " </Directory>" ;
177+ echo " </VirtualHost>" ;
178+ echo ;
179+
180+ } > " /etc/httpd/conf.d/localhost.conf"
181+
182+
183+
184+ # Add test Page
185+ if [ ! -d " /var/www/html" ]; then
186+ run " mkdir -p /var/www/html"
187+ else
188+ run " rm -rf /var/www/html/*"
189+ fi
190+ run " echo '<?php phpversion(); ?>' > /var/www/html/index.php"
191+ run " echo 'It works' > /var/www/html/index.html"
192+ run " chown -R ${MY_USER} :${MY_GROUP} /var/www/html"
193+
114194
115195
116196# ##
0 commit comments