This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
revproxy [2016-01-27 13:37] – external edit 127.0.0.1 | revproxy [2016-08-25 09:09] (current) – [Configuration] victor | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Setting up a reverse proxy for the httpd web server | + | ====== |
- | Not as easy as it may seem. This page describes things to do in your Linux host. | + | Turns out it was not as easy as it may seem. This page describes things to do in your Linux host. |
- | Install apache2 with mod_proxy, mod_proxy_html and mod_proxy_http | + | ===== Installation ===== |
- | Enable mod_rewrite, | + | Install apache2 with mod_proxy, |
- | Configuration: | + | Enable mod_rewrite, |
+ | |||
+ | ===== Configuration | ||
+ | Use a2ensite. | ||
Throttle the Apache server to match to ITS server: | Throttle the Apache server to match to ITS server: | ||
+ | < | ||
# ITS can really only handle one connection at a time! | # ITS can really only handle one connection at a time! | ||
MaxRequestsPerChild 1 | MaxRequestsPerChild 1 | ||
ThreadsPerChild 1 | ThreadsPerChild 1 | ||
MaxClients 1 | MaxClients 1 | ||
+ | </ | ||
Basic VirtualHost stuff: | Basic VirtualHost stuff: | ||
+ | < | ||
< | < | ||
ServerAdmin victor@up.update.uu.se | ServerAdmin victor@up.update.uu.se | ||
Line 26: | Line 31: | ||
ErrorLog ${APACHE_LOG_DIR}/ | ErrorLog ${APACHE_LOG_DIR}/ | ||
CustomLog ${APACHE_LOG_DIR}/ | CustomLog ${APACHE_LOG_DIR}/ | ||
- | # ProxyHTMLLogVerbose on | ||
LogLevel error | LogLevel error | ||
+ | </ | ||
Optional: error documents for when the ITS server fails/ | Optional: error documents for when the ITS server fails/ | ||
+ | < | ||
Alias /its-error/ "/ | Alias /its-error/ "/ | ||
ProxyPass /its-error/ ! | ProxyPass /its-error/ ! | ||
Line 35: | Line 41: | ||
ErrorDocument 503 / | ErrorDocument 503 / | ||
ErrorDocument 404 / | ErrorDocument 404 / | ||
+ | </ | ||
Optional(? | Optional(? | ||
+ | < | ||
CacheEnable disk / | CacheEnable disk / | ||
+ | </ | ||
Optional: avoid robots which don't seem to respect robots.txt | Optional: avoid robots which don't seem to respect robots.txt | ||
+ | < | ||
# Forbid the darn Baidu robot which doesn' | # Forbid the darn Baidu robot which doesn' | ||
RewriteEngine on | RewriteEngine on | ||
Line 45: | Line 55: | ||
RewriteCond %{HTTP_USER_AGENT} ^.*Page2RSS [NC] | RewriteCond %{HTTP_USER_AGENT} ^.*Page2RSS [NC] | ||
RewriteRule .* - [L,F] | RewriteRule .* - [L,F] | ||
+ | </ | ||
The real stuff: the proxy | The real stuff: the proxy | ||
+ | < | ||
< | < | ||
ProxyPass http:// | ProxyPass http:// | ||
Line 56: | Line 68: | ||
Allow from all | Allow from all | ||
</ | </ | ||
+ | </ |