]> git.openstreetmap.org Git - chef.git/commitdiff
Pass PHP options to FPM from apache
authorTom Hughes <tom@compton.nu>
Mon, 13 Jul 2020 16:07:45 +0000 (17:07 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 13 Jul 2020 16:26:14 +0000 (17:26 +0100)
cookbooks/forum/attributes/default.rb
cookbooks/forum/recipes/default.rb
cookbooks/forum/templates/default/apache.erb

index b4982d65c5fb4573d37adbbaa3afbe90c490101e..9f4114f8099ff0627294de623cbb41dfd54ff8ab 100644 (file)
@@ -1,8 +1,2 @@
 # Enable the "forum" role
 default[:accounts][:users][:forum][:status] = :role
-
-# Configure PHP options
-default[:php][:fpm][:options][:open_basedir] = "/srv/forum.openstreetmap.org/html/:/usr/share/php/:/tmp/"
-default[:php][:fpm][:options][:disable_functions] = "exec,shell_exec,system,passthru,popen,proc_open"
-default[:php][:fpm][:options][:upload_max_filesize] = "70M"
-default[:php][:fpm][:options][:post_max_size] = "100M"
index 9128f73de99708fa8cef35957ba2fbea43d71155..06929ec3e5ef533bff3c21ad307ce75b3c06e1dd 100644 (file)
@@ -35,6 +35,7 @@ package %w[
   unzip
 ]
 
+apache_module "env"
 apache_module "rewrite"
 
 ssl_certificate "forum.openstreetmap.org" do
index 9150356596f1620419c09665ed42a46800800115..82942001bb4b580a5ff4e6527811d71b4bfe2174 100644 (file)
@@ -38,6 +38,9 @@
        ErrorLog /var/log/apache2/forum.openstreetmap.org-error.log
 
        DocumentRoot /srv/forum.openstreetmap.org/html
+
+       ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/srv/forum.openstreetmap.org/html/:/usr/share/php/:/tmp/\ndisable_functions=exec,shell_exec,system,passthru,popen,proc_open"
+       ProxyFCGISetEnvIf "true" PHP_VALUE "upload_max_filesize=70M\npost_max_size=100M"
 </VirtualHost>
 
 <Directory /srv/forum.openstreetmap.org/html>
@@ -48,3 +51,9 @@
 
        Require all granted
 </Directory>
+
+<Directory /srv/forum.openstreetmap.org/html/img>
+       <FilesMatch ".+\.ph(ar|p|tml)$">
+               SetHandler None
+       </FilesMatch>
+</Directory>