ITS wiki

The Incompatible Timesharing System

User Tools

Site Tools


revproxy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
revproxy [2016-01-27 13:37] – external edit 127.0.0.1revproxy [2016-08-25 09:09] (current) – [Configuration] victor
Line 1: Line 1:
-Setting up a reverse proxy for the httpd web server+====== 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, mod_cache, mod_proxy, mod_proxy_http, mod_proxy_html+Install apache2 with mod_proxy, mod_proxy_html and mod_proxy_http (installed by default in Raspbian)
  
-Configuration:+Enable mod_rewrite, mod_cache, mod_proxy, mod_proxy_http, mod_proxy_html (e.g. using ''a2enmod rewrite cache proxy proxy_http proxy_html''
 + 
 +===== Configuration ===== 
 +Use a2ensite.
  
 Throttle the Apache server to match to ITS server: Throttle the Apache server to match to ITS server:
 +<code>
 # 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
 +</code>
  
 Basic VirtualHost stuff: Basic VirtualHost stuff:
 +<code>
 <VirtualHost *:80> <VirtualHost *:80>
   ServerAdmin victor@up.update.uu.se   ServerAdmin victor@up.update.uu.se
Line 26: Line 31:
   ErrorLog ${APACHE_LOG_DIR}/up-error.log   ErrorLog ${APACHE_LOG_DIR}/up-error.log
   CustomLog ${APACHE_LOG_DIR}/up-access.log combined   CustomLog ${APACHE_LOG_DIR}/up-access.log combined
-#  ProxyHTMLLogVerbose on 
   LogLevel error   LogLevel error
 +</code>
  
 Optional: error documents for when the ITS server fails/crashes: Optional: error documents for when the ITS server fails/crashes:
 +<code>
   Alias /its-error/ "/home/klh10/its/apache-errors/"   Alias /its-error/ "/home/klh10/its/apache-errors/"
   ProxyPass /its-error/ !   ProxyPass /its-error/ !
Line 35: Line 41:
   ErrorDocument 503 /its-error/503.html   ErrorDocument 503 /its-error/503.html
   ErrorDocument 404 /its-error/404.html   ErrorDocument 404 /its-error/404.html
 +</code>
  
 Optional(?): caching Optional(?): caching
 +<code>
   CacheEnable disk /   CacheEnable disk /
 +</code>
  
 Optional: avoid robots which don't seem to respect robots.txt Optional: avoid robots which don't seem to respect robots.txt
 +<code>
   # Forbid the darn Baidu robot which doesn't respect robots.txt! And the Page2RSS thing which also doesn't, and connects every 2 minutes   # Forbid the darn Baidu robot which doesn't respect robots.txt! And the Page2RSS thing which also doesn't, and connects every 2 minutes
   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]
 +</code>
  
 The real stuff: the proxy The real stuff: the proxy
 +<code>
   <Location />   <Location />
     ProxyPass http://its-up.update.uu.se/ nocanon max=1 disablereuse=on retry=0 timeout=10 connectiontimeout=5     ProxyPass http://its-up.update.uu.se/ nocanon max=1 disablereuse=on retry=0 timeout=10 connectiontimeout=5
Line 56: Line 68:
     Allow from all     Allow from all
   </Location>   </Location>
 +</code>
revproxy.1453898230.txt.gz · Last modified: (external edit)