]> ToastFreeware Gitweb - toast/tdyndns.git/blobdiff - doc/apache2.txt
Updated documentation.
[toast/tdyndns.git] / doc / apache2.txt
index b4458bebbe5e4a97cf04520f70749da8eda22cd5..79563e249d1e0fe72780f970c5d108d574b151db 100644 (file)
@@ -1,17 +1,66 @@
-# Add a virtual host similar than that:
+# Add a virtual host similar than that (for apache 2.4):
 # (e.g. in /etc/apache2/sites-available/example.com.conf)
+#
+# Note that apache has to do authentication/authorization
+# as well if needed (which will normally be the case).
+# Normally, AuthBasic is used by DYNDNS systems.
+# See: http://wiki.apache.org/httpd/PasswordBasicAuth
 
 <VirtualHost *:80>
-  SSLEngine Off
   ServerName dyndns.example.com
   ServerAdmin webmaster@example.com
-  DocumentRoot /var/www/dyndns
-  DirectoryIndex dyndns.py
+
   ErrorLog /var/log/apache2/error.log
   CustomLog /var/log/apache2/access.log combined
-  <Directory /var/www/dyndns>
+
+  DocumentRoot /var/www/tdyndns
+
+  <Directory /var/www/tdyndns>
+         DirectoryIndex tdyndns.py
       SetHandler cgi-script
       Options ExecCGI FollowSymLinks
+
+         AuthType Basic
+         AuthName "tdyndns authorization"
+         AuthUserFile "/etc/tdyndns/.htpasswd"
+         Require valid-user
   </Directory>
+
 </VirtualHost>
 
+
+
+# Hint: For clients that do not support AuthBasic (if there should be any),
+# the "AuthBasicFake" parameter might be an option to overcome this.
+
+
+
+
+As an example for an non-standard authorization method, we provided the script
+tdyndns_auth_simplepwd that just checks whether the user is present in the
+system and whether a certain password is given:
+
+<VirtualHost *:80>
+  ServerName dyndns.example.com
+  ServerAdmin webmaster@example.com
+
+  ErrorLog /var/log/apache2/error.log
+  CustomLog /var/log/apache2/access.log combined
+
+  DocumentRoot /var/www/tdyndns
+
+  DefineExternalAuth tdyndnsauth environment /usr/local/bin/tdyndns_auth_simplepwd
+
+  <Directory /var/www/tdyndns>
+         DirectoryIndex tdyndns.py
+      SetHandler cgi-script
+      Options ExecCGI FollowSymLinks
+
+      AuthType Basic
+      AuthBasicProvider external
+      AuthExternal tdyndnsauth
+      AuthName "tdyndns authorization"
+      Require valid-user
+  </Directory>
+
+</VirtualHost>