Created
November 21, 2014 17:45
-
-
Save jczaplew/11c7cc545e4d2081dd8a to your computer and use it in GitHub Desktop.
Node + Apache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerName app.myurl.com | |
ProxyRequests off | |
<Proxy *> | |
Order allow,deny | |
Allow from all | |
</Proxy> | |
# This says if someone goes to app.myurl.com, forward the request to port :8080, which is where your Node app is running | |
ProxyPass / http://localhost:8080/ | |
ProxyPassReverse / http://localhost:8080/ | |
ProxyPreserveHost on | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install pm2 - a way to daemonize a Node process | |
sudo npm install -g pm2 | |
# Install n, a Node version manager | |
sudo npm install -g n | |
# Use the latest version of node (0.11.x) | |
sudo n latest | |
pm2 start /path/to/app/server.js --name MyApp | |
# Restart Apache after adding the Vhost, and you should be good to go! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment