How to run Node and apache together in amazon ec2?

Hi, I have an ec2 instance on amazon that runs on a regular 80 port, and I have a node running on port 3002. How can I make my node run on port 80 in my ecaz2 amazon instance along with apache, which I tried most online tutorials like proxy for reveproxy proxy, etc. on apache

I need to start my node server on the site www.mywebsite.com/node now it works on www.mywebsite.com//002/

I tried to change my

/etc/httpd/conf/httpd.conf

Apache as shown below but had no effect

<VirtualHost *:80> ProxyRequests off <Proxy *> Order deny,allow Allow from all </Proxy> <Location /> ProxyPass /node http://localhost:3002/ ProxyPassReverse /node http://localhost:3002/ </Location> </VirtualHost> 
+5
source share
1 answer

I have not used apache for a long time, but I think your location for mod_proxy will look like this:

 <Location /node > ProxyPass http://localhost:3002/ </Location> 

Also, did you restart apache?

service httpd restart should do this.

+1
source

All Articles