Skip to content

Instantly share code, notes, and snippets.

@tsunammis
Created May 15, 2014 09:40
Show Gist options
  • Save tsunammis/9f195e5d3e890eca4852 to your computer and use it in GitHub Desktop.
Save tsunammis/9f195e5d3e890eca4852 to your computer and use it in GitHub Desktop.
Apache Virtual Host with one domain under apache and a specific path to node.js app
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot /var/www/yourdomaincom
# Path under Apache/PHP
# http://yourdomain.com/ -> PHP
<Directory /var/www/yourdomaincom>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
# Proxy to Node.js App
# from http://yourdomain.com/yournodejsapp/ to http://localhost:2368/
<ifmodule mod_proxy.c>
ProxyVia On
ProxyRequests Off
ProxyPass /yournodejsapp/ http://localhost:2368/
ProxyPassReverse /yournodejsapp/ http://localhost:2368/
ProxyPreserveHost on
<proxy *>
AllowOverride All
Order allow,deny
allow from all
</proxy>
</ifmodule>
ErrorLog /var/log/apache.yourdomaincom.error.log
LogLevel warn
CustomLog /var/log/apache.yourdomaincom.access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment