Skip to content

Instantly share code, notes, and snippets.

@nileshgr
Created November 24, 2014 17:27
Show Gist options
  • Save nileshgr/129e9fe9ff6da5b4041a to your computer and use it in GitHub Desktop.
Save nileshgr/129e9fe9ff6da5b4041a to your computer and use it in GitHub Desktop.
<Macro php $username $siteroot>
AddHandler php-fcgi .php
FastCgiExternalServer $siteroot/cgi-bin/php.fcgi -socket /var/run/php-fpm-$username.sock -pass-header Authorization -idle-timeout 600
Action php-fcgi /cgi-bin/php.fcgi
</Macro>
<Macro phpvhost $hostname $siteroot $username $aliases>
<VirtualHost *:80>
ServerName $hostname
ServerAlias www.$hostname $aliases
DocumentRoot $siteroot/htdocs
<Directory $siteroot/htdocs>
Options SymLinksIfOwnerMatch Indexes
AllowOverride All
Require all granted
</Directory>
<Directory $siteroot/cgi-bin>
Options None
AllowOverride None
Require all granted
</Directory>
ScriptAlias /cgi-bin/ $siteroot/cgi-bin/
Use php $username $siteroot
</VirtualHost>
</Macro>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment