简体   繁体   English

在端口80上的现有服务器运行页面上服务Node.JS应用

[英]Serving Node.JS app on a existing server running page on port 80

I have a server at www.example.com running a PHP-made webpage served by Apache, this page is listening to port 80. 我在www.example.com上有一台服务器,运行由Apache提供的PHP网页,该页面正在侦听端口80。

Now I want to serve my Node.JS on the domain www.example2.com. 现在,我想在域www.example2.com上提供我的Node.JS。 Both pages should be on the same server, the Node.JS app should be running on port 3000. How do I achieve this? 两个页面都应该在同一台服务器上,Node.JS应用程序应该在端口3000上运行。 如何实现此目的?

From other answers and blog posts (like this one: http://garr.me/blog/running-node-js-and-apache-together-using-mod_proxy/ ) I have learnt that I can create a ReverseProxy to redirect www.example.com/app to my app, however this is not the intended behavior. 从其他答案和博客文章(例如: http : //garr.me/blog/running-node-js-and-apache-together-using-mod_proxy/ )中,我了解到我可以创建一个ReverseProxy来重定向www .example.com / app转到我的应用程序,但这不是预期的行为。 What I want is this new domain www.example2.com to go the server's ip address at port 3000. 我想要的是这个新域www.example2.com,该服务器的IP地址位于端口3000。

Side question: This question might sound stupid but, can't I redirect the whole domain to the server's IP address at port 3000 from the domain name configuration at GoDaddy/Route53??? 附带问题:这个问题听起来很愚蠢,但是,我不能从GoDaddy / Route53上的域名配置将整个域重定向到端口3000上的服务器IP地址吗???

Thanks. 谢谢。

Yes to your side question. 是的。 i think thats the best approach. 我认为那是最好的方法。 Have your domain configuation on go daddy go to the ip address and 3000 port. 在go daddy上进行域配置,请转到IP地址和3000端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM