From dd1d98f78551de2fdd37cce83fce3a2eecffe29a Mon Sep 17 00:00:00 2001 From: Clinton Ebadi Date: Sat, 8 Dec 2012 19:25:51 -0500 Subject: [PATCH] Properly configure suPHP Normalizing with the Handlers uses by mire, without php4 support. --- debian/hcoop-apache2-config.install | 4 ++- debian/rules | 4 ++- files/mods-available/suphp.conf.hcoop | 17 +++++++++ files/suphp.conf.hcoop | 50 +++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 files/mods-available/suphp.conf.hcoop create mode 100644 files/suphp.conf.hcoop diff --git a/debian/hcoop-apache2-config.install b/debian/hcoop-apache2-config.install index 7fba822..d251603 100644 --- a/debian/hcoop-apache2-config.install +++ b/debian/hcoop-apache2-config.install @@ -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/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 diff --git a/debian/rules b/debian/rules index 5a0ef02..3d03936 100755 --- a/debian/rules +++ b/debian/rules @@ -11,7 +11,9 @@ 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 diff --git a/files/mods-available/suphp.conf.hcoop b/files/mods-available/suphp.conf.hcoop new file mode 100644 index 0000000..f744a69 --- /dev/null +++ b/files/mods-available/suphp.conf.hcoop @@ -0,0 +1,17 @@ + + 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 + + + suPHP_Engine on + + +# # 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 . +# suPHP_RemoveHandler + diff --git a/files/suphp.conf.hcoop b/files/suphp.conf.hcoop new file mode 100644 index 0000000..b459bd9 --- /dev/null +++ b/files/suphp.conf.hcoop @@ -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" -- 2.20.1