- RewriteCond %{LA-U:REQUEST_FILENAME} -f
- RewriteRule ^/cgi-bin/(.*)$ /cgi-bin/cgiwrap/~<%= @user %>/cgi-bin/$1 [PT,L]
+ RewriteCond <%= @directory %>%{REQUEST_FILENAME} -f
+ RewriteRule ^/cgi-bin/(.*)$ /~<%= @user %>/cgi-bin/$1 [PT,L]
+
+ <FilesMatch ".+\.ph(p|ps|p3|tml)$">
+ SetHandler "proxy:unix:/run/php/php-<%= @user %>-fpm.sock|fcgi://127.0.0.1"
+ </FilesMatch>
+</VirtualHost>
+
+<VirtualHost *:80>
+ ServerName <%= @user %>.dev.openstreetmap.org
+ ServerAdmin webmaster@openstreetmap.org
+ ServerAlias <%= @user %>.dev.osm.org