There are a few answers on StackOverflow that suggest approach to editing the VHost file, but my knowledge in apache config is nearly 0, and I really don't want to risk screwing up my whole server. Moreover, the VPS belongs to my school.
Scenario: I have a VPS, with 2 dedicated IPs, running Apache on port 80. I have a domain mywebdomain.com pointing to my VPS, which would display a PHP website (under Apache). I have another node app mynodeapp.com pointing to my VPS, which display my node app when I run mynodeapp.com:8080. Editing .htaccess is not an option for my situation.
So I tried to access my node app using mynodeapp.com:8080, but that ":8080" isn't very comfortable typing, and based on my limited knowledge, I can't really make my node app listen to port 80 where Apache is.
Question: Is there any way to make mynodeapp.com to point to my node app WITHOUT the port on the address? The easiest way is to make it listen to port 80, but it conflicts with Apache. I tried using node-http-proxy https://github.com/nodejitsu/node-http-proxy (together with Express) but I have never got it to work, here is my code:
express = require( 'express' );
app = express();
httpProxy = require( 'http-proxy' );
proxy = httpProxy.createProxyServer({target:'http://mynodeapp.com:8080'}).listen( 80 );
server = require( 'http' ).createServer( app );
server.listen( 8080 );
The code was slightly edited from the official page of http-proxy. I don't see where it defines the domain that it is trying to proxy. I'm not sure where I've done wrong. I just need to one domain to display the node app without the port.