Properly configure suPHP
authorClinton Ebadi <clinton@unknownlamer.org>
Sun, 9 Dec 2012 00:25:51 +0000 (19:25 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Sun, 9 Dec 2012 00:25:51 +0000 (19:25 -0500)
Normalizing with the Handlers uses by mire, without php4 support.

debian/hcoop-apache2-config.install
debian/rules
files/mods-available/suphp.conf.hcoop [new file with mode: 0644]
files/suphp.conf.hcoop [new file with mode: 0644]

index 7fba822..d251603 100644 (file)
@@ -1,4 +1,6 @@
 files/conf.d/* etc/apache2/conf.d
 files/apache_in.rules etc/ferm/service.in.d
 files/apache_out.rules etc/ferm/service.out.d
 files/conf.d/* etc/apache2/conf.d
 files/apache_in.rules etc/ferm/service.in.d
 files/apache_out.rules etc/ferm/service.out.d
-files/www-data.hcoop etc/apache2/suexec
\ No newline at end of file
+files/www-data.hcoop etc/apache2/suexec
+files/suphp.conf.hcoop etc/suphp
+files/mods-available/suphp.conf.hcoop etc/apache2/mods-available
\ No newline at end of file
index 5a0ef02..3d03936 100755 (executable)
@@ -11,7 +11,9 @@
 
 DEB_DIVERT_EXTENSION =.hcoop
 DEB_DIVERT_FILES_hcoop-apache2-config += \
 
 DEB_DIVERT_EXTENSION =.hcoop
 DEB_DIVERT_FILES_hcoop-apache2-config += \
-       /etc/apache2/suexec/www-data.hcoop
+       /etc/apache2/suexec/www-data.hcoop \
+       /etc/suphp/suphp.conf.hcoop \
+       /etc/apache2/mods-available/suphp.conf.hcoop
 
 DEB_DH_INSTALL_CRON_ARGS_DEFAULT = --name=hcoop-apache-sync-logs
 
 
 DEB_DH_INSTALL_CRON_ARGS_DEFAULT = --name=hcoop-apache-sync-logs
 
diff --git a/files/mods-available/suphp.conf.hcoop b/files/mods-available/suphp.conf.hcoop
new file mode 100644 (file)
index 0000000..f744a69
--- /dev/null
@@ -0,0 +1,17 @@
+<IfModule mod_suphp.c>
+        AddType application/x-httpd-php .php .phtml
+       AddType application/x-httpd-php5 .php5
+       AddHandler x-httpd-php .php .phtml
+        AddHandler x-httpd-php5 .php5
+       suPHP_AddHandler x-httpd-php
+       suPHP_AddHandler x-httpd-php5
+
+       <Directory /afs/hcoop.net>
+                          suPHP_Engine on
+        </Directory>
+
+# # Use a specific php config file (a dir which contains a php.ini file)
+#      suPHP_ConfigPath /etc/php4/cgi/suphp/
+# # Tells mod_suphp NOT to handle requests with the type <mime-type>.
+#      suPHP_RemoveHandler <mime-type>
+</IfModule>
diff --git a/files/suphp.conf.hcoop b/files/suphp.conf.hcoop
new file mode 100644 (file)
index 0000000..b459bd9
--- /dev/null
@@ -0,0 +1,50 @@
+[global]
+;Path to logfile
+logfile=/var/log/suphp/suphp.log
+
+;Loglevel
+loglevel=info
+
+;User Apache is running as
+webserver_user=www-data
+
+;Path all scripts have to be in
+docroot=/afs/hcoop.net/*
+
+;Path to chroot() to before executing script
+;chroot=/mychroot
+
+; Security options
+; HCoop: we don't have to care about group/others, since afs ignores
+;        unix permissions
+allow_file_group_writeable=true
+allow_file_others_writeable=true
+allow_directory_group_writeable=true
+allow_directory_others_writeable=true
+
+;Check wheter script is within DOCUMENT_ROOT
+check_vhost_docroot=true
+
+;Send minor error messages to browser
+errors_to_browser=false
+
+;PATH environment variable
+env_path=/bin:/usr/bin
+
+;Umask to set, specify in octal notation
+umask=0077
+
+; Minimum UID
+min_uid=100
+
+; Minimum GID
+min_gid=100
+
+
+[handlers]
+;Handler for php-scripts
+x-httpd-php="php:/usr/bin/php-cgi"
+x-httpd-php5="php:/usr/bin/php5-cgi"
+
+;Handler for CGI-scripts
+x-suphp-cgi="execute:!self"