I''m using this on my server to let external users manage their password. First, create a custom template here: /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/27ManagerProxyPass
And put this content:
{
# vim: ft=perl:
$haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no';
$plainTextAccess = ${'httpd-admin'}{PermitPlainTextAccess} || 'no';
$OUT = '';
foreach $place ('server-common','user-password')
{
if (($port eq "80") && ($haveSSL eq 'yes') && ($plainTextAccess ne 'yes'))
{
$OUT .= " RewriteRule ^/$place(/.*|\$) https://%{HTTP_HOST}/$place\$1 [L,R]\n";
} else {
$OUT .= " ProxyPass /$place http://127.0.0.1:${'httpd-admin'}{TCPPort}/$place\n";
$OUT .= " ProxyPassReverse /$place http://127.0.0.1:${'httpd-admin'}{TCPPort}/$place\n";
}
$OUT .= " <Location /$place>\n";
$OUT .= " order deny,allow\n";
$OUT .= " deny from all\n";
$OUT .= " allow from all\n";
$OUT .= " </Location>\n";
}
if (($port eq "80") && ($haveSSL eq 'yes') && ($plainTextAccess ne 'yes'))
{
$OUT .= " RewriteRule ^/server-manager(/.*|\$) https://%{HTTP_HOST}/server-manager\$1 [L,R]\n";
} else {
$OUT .= " ProxyPass /server-manager http://127.0.0.1:${'httpd-admin'}{TCPPort}/server-manager\n";
$OUT .= " ProxyPassReverse /server-manager http://127.0.0.1:${'httpd-admin'}{TCPPort}/server-manager\n";
}
$OUT .=<<"HERE";
<Location /server-manager>
order deny,allow
deny from all
allow from $localAccess $externalSSLAccess
</Location>
HERE
}
Then
expand-template /etc/httpd/conf/httpd.conf
Check the config file with
httpd -t
Which should tell you everything is OK
And restart httpd service with
sv t /service/httpd-e-smith
Regards, Daniel