Dear Wiki user, You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.
The following page has been changed by RiciLake: http://wiki.apache.org/httpd/Recipes/Different_UserIDs_Using_Reverse_Proxy ------------------------------------------------------------------------------ }}} to start each host. + == Alternative Proxy Configuration == + + As an alternative to the above, a single proxy server can be set up using + a very simple httpd.conf file: + {{{ + ProxyPreserveHost On + RewriteEngine On + + # A dbm map might be better if you had a lot of hosts + RewriteMap host txt:/usr/local/etc/apache22/host_to_ip + RewriteMap tolower int:tolower + + RewriteCond ${host:${tolower:%{HTTP_HOST}} } (.+) + RewriteRule (.*) http://%1/$1 [P] + + <Directory /> + Deny from all + </Directory> + }}} + + The host_to_ip file might look like this: + {{{ + foo.com 127.0.0.1:8000 + www.foo.com 127.0.0.1:8000 + + bar.com 127.0.0.1:8001 + www.bar.com 127.0.0.1:8001 + }}} + + Alternatively, each user apache server could be started on a different loopback interface. That works nicely with FreeBSD jails. + + The individual servers can be started as the target user/group, and even in a chroot environment; if they are listening on a high port, there is no need to start them as root. You need to make sure that they have unique PidFile, ScoreBoardFile and (if you're using it) LockFile settings; these can be relative to the ServerRoot which avoids having to change the basic httpd.conf prelude. They must also include: + {{{ + UseCanonicalName Off + }}} +
