Skip to content

Instantly share code, notes, and snippets.

@gtrias
Created April 23, 2015 07:44
Show Gist options
  • Save gtrias/574f2b3a124fc69da8fa to your computer and use it in GitHub Desktop.
Save gtrias/574f2b3a124fc69da8fa to your computer and use it in GitHub Desktop.
Apache macro to local developing
<Macro VirtualHost $host $path>
ServerName $host.loc
ServerAlias www.$host.loc
ServerAlias $host.gemenon.cir
ServerAlias www.$host.gemenon.cir
ServerAdmin genar@cirici.com
DocumentRoot /home/genar/src/$path
DirectoryIndex index.php index.html index.htm
# PHP proxy to fastcgi (cannot use unix sockets till apache 2.4.9)
ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/home/genar/src/$path/$1
<Directory /home/genar/src/$path>
Order allow,deny
Allow from all
AllowOverride All
Require all granted
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
# LogLevel info ssl:warn
# LogLevel alert rewrite:trace6
ErrorLog ${APACHE_LOG_DIR}/$host-error.log
CustomLog ${APACHE_LOG_DIR}/$host-access.log combined
</Macro>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment