Rework for generic setup
authorHeiko Schlittermann <hs@schlittermann.de>
Tue, 24 Nov 2015 22:03:31 +0100
changeset 48 aa14588b4232
parent 47 1a695ff398e9
child 49 308c7edbfda5
Rework for generic setup
configs/apache.conf
--- a/configs/apache.conf	Fri Nov 20 18:13:33 2015 +0100
+++ b/configs/apache.conf	Tue Nov 24 22:03:31 2015 +0100
@@ -1,15 +1,27 @@
 # -> /etc/apache2/conf.d
-    <Location "/once">
-        SetHandler once-upload-handler
-        Action once-upload-handler /once-handler/upload.pl virtual
-    </Location>
+
+# The directory where the files are stored,
+# it needs to be writable by the web server user (wwwrun, www-data,
+# who ever)
+# SentEnv may go into the <Directory>...</Directory>
+SetEnv ONCE_VAR /var/lib/once/
+# Action may go into <Location>...</Location>
+Action once-upload-handler /once-handler/upload.pl virtual
 
-    <Directory "$DOCUMENTROOT/once-handler">
-        AllowOverride AuthConfig Limit Options
-        AddHandler cgi-script .pl
-    </Directory>
+# Order of location blocks matters!
+<Location "/once">
+	SetHandler once-upload-handler
+</Location>
 
-    <Location "/once/d">
-        SetHandler once-download-handler
-        Action once-download-handler /once-handler/download.pl virtual
-    </Location>
+#<Location "/once/d">
+#	SetHandler once-download-handler
+#	Action once-download-handler /once-handler/download.pl virtual
+#</Location>
+
+ScriptAlias /once-handler/ /usr/local/lib/once/
+
+<Directory "/usr/local/lib/once">
+	Require all granted
+	Allow from all
+	Options ExecCGI FollowSymlinks
+</Directory>