Added RewriteEngine apache2 configuration.
[toast/tdyndns.git] / doc / apache2.txt
1 # Add a virtual host similar than that:
2 # (e.g. in /etc/apache2/sites-available/example.com.conf)
3 #
4 # The Rewrite* lines are necessary to prevent mod_cgi to filter the Authorization HTTP header.
5
6 <VirtualHost *:80>
7   SSLEngine Off
8   ServerName dyndns.example.com
9   ServerAdmin webmaster@example.com
10   DocumentRoot /var/www/dyndns
11   DirectoryIndex dyndns.py
12   ErrorLog /var/log/apache2/error.log
13   CustomLog /var/log/apache2/access.log combined
14   <Directory /var/www/dyndns>
15       SetHandler cgi-script
16       Options ExecCGI FollowSymLinks
17       RewriteEngine on
18       RewriteCond %{HTTP:Authorization} ^(.*)
19       RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
20   </Directory>
21 </VirtualHost>
22