Skip to content

Instantly share code, notes, and snippets.

@adamcbrewer
Created July 23, 2013 08:38
Show Gist options
  • Save adamcbrewer/6060840 to your computer and use it in GitHub Desktop.
Save adamcbrewer/6060840 to your computer and use it in GitHub Desktop.
NODE: Run a daemon node.js server and create virtualhost to forward all site traffic to the specified port.
# This command will make sure the process persists
# even after you log out of a session
node server.js >/dev/null 2>&1 &
<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin [email protected]
ServerName www.yoursite.com
ServerAlias yoursite.com
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/yoursite.com/public_html
# These proxy settings will funnel all :80 requests
# to our local node server running at :3000
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location />
ProxyPass http://localhost:3000/
ProxyPassReverse http://localhost:3000/
</Location>
# Log file locations
LogLevel warn
ErrorLog /var/www/brewerlogic.com/log/error.log
CustomLog /var/www/brewerlogic.com/log/access.log combined
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment