@@ -7,14 +7,44 @@ chmod 777 /var/www/cgi-bin/mt/theme
77if [ " $1 " = " apache2-foreground" ]; then
88 rm -f /var/log/apache2/access.log # disable access logging
99
10- httpd_conf_d=` test -e /etc/httpd/conf.d && echo /etc/httpd /conf.d || echo ' /etc/apache2 /conf-enabled ' `
10+ httpd_conf_d=` ls -d /etc/httpd/conf.d /etc/apache2 /conf-enabled /etc/httpd /conf/extra 2> /dev/null | head -1 `
1111 cat > $httpd_conf_d /mt.conf << CONF
1212Timeout 3600
1313
1414# mt-static
1515Alias /mt-static/ /var/www/cgi-bin/mt/mt-static/
1616CONF
1717
18+ mod_rewrite_so=` find /usr/lib/apache2/modules /usr/lib64/httpd/modules /usr/lib/httpd/modules -name ' mod_rewrite.so' 2> /dev/null | head -1`
19+ if [ -n " $mod_rewrite_so " ]; then
20+ cat > $httpd_conf_d /mt-rewrite.conf << CONF
21+ LoadModule rewrite_module $mod_rewrite_so
22+ CONF
23+ fi
24+
25+ mod_proxy_so=` find /usr/lib/apache2/modules /usr/lib64/httpd/modules /usr/lib/httpd/modules -name ' mod_proxy.so' 2> /dev/null | head -1`
26+ if [ -n " $mod_proxy_so " ]; then
27+ cat > $httpd_conf_d /mt-proxy.conf << CONF
28+ LoadModule proxy_module $mod_proxy_so
29+ ProxyPassReverse / http://mt/
30+ CONF
31+ fi
32+
33+ mod_proxy_http_so=` find /usr/lib/apache2/modules /usr/lib64/httpd/modules /usr/lib/httpd/modules -name ' mod_proxy_http.so' 2> /dev/null | head -1`
34+ if [ -n " $mod_proxy_http_so " ]; then
35+ cat > $httpd_conf_d /mt-proxy_http.conf << CONF
36+ LoadModule proxy_http_module $mod_proxy_http_so
37+ ProxyPassReverse / http://mt/
38+ CONF
39+ fi
40+
41+ if [ $httpd_conf_d = " /etc/httpd/conf/extra" ]; then
42+ # archlinux
43+ cat >> /etc/httpd/conf/httpd.conf << CONF
44+ Include conf/extra/mt*.conf
45+ CONF
46+ fi
47+
1848 # invoke php-fpm
1949 if [ -e /usr/sbin/php-fpm ]; then
2050 mkdir /run/php-fpm
0 commit comments