简体   繁体   English

在Centos7 Apache服务器上运行Node.js应用

[英]Running nodejs app on Centos7 apache server

I'm trying to run a node web app (built with meteor) on a Centos7 server running EasyApache4 with WHM cPanel. 我正在尝试在运行带有WHM cPanel的EasyApache4的Centos7服务器上运行节点网络应用程序(使用流星构建)。 I'm trying to run it on a subdomain off of one of our main websites on port 8080. 我正在尝试在端口8080上我们主要网站之一的子域上运行它。

When going to the subdomain on port 8080, the connection just times out, but can see the html when using curl to access it. 当进入端口8080上的子域时,连接只是超时,但是在使用curl访问它时可以看到html。

Does anyone have any ideas why it won't work through the browser, and also how I can get it to look like it's running straight from the subdomain instead of having to go directly to the port. 有谁知道为什么它不能在浏览器中工作,以及如何使它看起来像是直接从子域运行,而不是直接进入端口。

EDIT 编辑

Below is the curl we are using to view the html 下面是我们用来查看html的curl

curl http://subdomain.site.com:8080

Doing that brings back the html no problems 这样做可以使html没问题

Had the same problem today. 今天遇到了同样的问题。 I am using Memset Centos7 server with WHM/CPanel, running EasyApache 4. 我将Memset Centos7服务器与WHM / CPanel一起使用,并运行EasyApache 4。

After trying everything I could think of, I realised that I had a basic firewall setup, which closed all ports that were not listed. 在尝试了所有我能想到的东西之后,我意识到我有一个基本的防火墙设置,该防火墙关闭了所有未列出的端口。 After adding port 8080, it worked. 添加端口8080后,它可以工作。

Used this: 使用这个:

sudo iptables -I INPUT 1 -i + -p tcp --dport 8080 -j ACCEPT

I am not 100% certain how secure this is, as I am still researching. 我仍在研究中,我不确定100%的安全性。

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

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