Skip to content

Commit c9926ce

Browse files
committed
Support relative CGIPath/StaticWebPath.
1 parent 1d2e309 commit c9926ce

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
### Added
10+
11+
* Support relative CGIPath/StaticWebPath.
12+
913
## [1.0.2] - 2020-10-15
1014

1115
### Fixed

mt/cgi-bin-mt.htaccess

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Options +SymLinksIfOwnerMatch
22

33
RewriteEngine on
44
RewriteRule ^mt-static - [L]
5-
RewriteRule (.*) http://mt:80/cgi-bin/mt/$1 [P,L]
5+
RewriteRule (.*) http://mt/cgi-bin/mt/$1 [P,L]

mt/docker-entrypoint.sh

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,44 @@ chmod 777 /var/www/cgi-bin/mt/theme
77
if [ "$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
1212
Timeout 3600
1313
1414
# mt-static
1515
Alias /mt-static/ /var/www/cgi-bin/mt/mt-static/
1616
CONF
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

Comments
 (0)