PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, June 25, 2022

[FIXED] How to run Node And apache together in amazon ec2?

 June 25, 2022     amazon-ec2, amazon-web-services, apache, node.js, reverse-proxy     No comments   

Issue

hi i have an ec2 instance at amazon which runs on normal 80 port and i have a node running on 3002 port how can i make my node run on port 80 in my amazon ec2 instance along with apache i tried most of online tutorials like reverseproxy mod proxy etc on apache

i need to run my node server on www.mywebsite.com/node now its running on www.mywebsite.com:3002/

i tried to edit my

/etc/httpd/conf/httpd.conf

Of apache like below but had no effect whatsoever

<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>

Solution

I've not used apache for ages now but I think your location for mod_proxy would look like:

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

Also, have you restarted apache?

service httpd restart should do it.



Answered By - Samar
Answer Checked By - Gilberto Lyons (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing