Skip to content

Instantly share code, notes, and snippets.

@ericwilson
Last active August 29, 2015 14:00
Show Gist options
  • Save ericwilson/11335797 to your computer and use it in GitHub Desktop.
Save ericwilson/11335797 to your computer and use it in GitHub Desktop.
Custom Logs for Apache Virtual Host
<VirtualHost *:80>
ServerName www.yourdomain.com
ServerAlias www.yourdomain.com
..
.. other custom settings
..
ErrorLog "/var/log/yourlog/error.log"
CustomLog "/var/log/yourlog/access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerName api.yourdomain.com
ServerAlias api.yourdomain.com
..
.. other custom settings
..
ErrorLog "/var/log/yourlog/api/error.log"
CustomLog "/var/log/yourlog/api/access.log" common
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Headers "X-Requested-With, Cache-Control, Content-Type"
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment