在远程服务器上启动 npm 后无法访问 http://example.com:3000/
unable to visit http://example.com:3000/ after npm start on a remote server
我正在尝试学习如何在安装了 centos 8 的远程服务器上使用 npm start
命令。我下载了别人的 jekyll 项目,然后 运行 命令:
npm install
npm start
我收到这样的成功消息:
bcx@1.0.0 start /var/www/example.com
webpack --watch | bundle exec jekyll serve --livereload --incremental
webpack is watching the files…
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Configuration file: /var/www/example.com/_config.yml
Source: /var/www/example.com
Destination: /var/www/example.com/_site
Incremental build: enabled
Generating...
done in 5.453 seconds.
Auto-regeneration: enabled for '/var/www/example.com'
Server address: http://127.0.0.1:3000/
LiveReload address: http://127.0.0.1:35729
我打开一个单独的终端 window(不终止当前进程),SSH 进入服务器并输入:
systemctl stop firewalld
wget http://127.0.0.1:3000/
这成功下载了一个 index.html
文件,其中包含我期望从这个 jekyll 项目网站获得的内容。然后我去我的网络浏览器并输入 http://example.com:3000/
但我得到一个连接超时 server/site is unreachable.
如何使用 npm start
在远程 centos 8 服务器上加载 jekyll 网站?
编辑
在我上面的问题中,我实际上用我拥有的域替换了 example.com
,并且该域有一个 A 记录指向我的 jekyll 项目所在服务器的 IP 地址。
Ooh, actually, in my project, I don't use example.com . I'm actually using a domain that I own. And the domain points to the IP address of my remote server that has the jekyll project installed.
这里的问题是你不能(除非你做一些隧道)访问项目正在监听的网络接口。 127.0.0.1
是环回地址。它仅在内部可用。
webpack 开发服务器专为本地开发而设计,不适合生产使用。您可以 make it listen on other network interfaces but for production deployment you should follow the deployment instructions(您正在使用的项目可能有 vanilla Jekyll 不包含的额外说明)。
我正在尝试学习如何在安装了 centos 8 的远程服务器上使用 npm start
命令。我下载了别人的 jekyll 项目,然后 运行 命令:
npm install
npm start
我收到这样的成功消息:
bcx@1.0.0 start /var/www/example.com
webpack --watch | bundle exec jekyll serve --livereload --incremental
webpack is watching the files…
Browserslist: caniuse-lite is outdated. Please run the following command: `npm update`
Configuration file: /var/www/example.com/_config.yml
Source: /var/www/example.com
Destination: /var/www/example.com/_site
Incremental build: enabled
Generating...
done in 5.453 seconds.
Auto-regeneration: enabled for '/var/www/example.com'
Server address: http://127.0.0.1:3000/
LiveReload address: http://127.0.0.1:35729
我打开一个单独的终端 window(不终止当前进程),SSH 进入服务器并输入:
systemctl stop firewalld
wget http://127.0.0.1:3000/
这成功下载了一个 index.html
文件,其中包含我期望从这个 jekyll 项目网站获得的内容。然后我去我的网络浏览器并输入 http://example.com:3000/
但我得到一个连接超时 server/site is unreachable.
如何使用 npm start
在远程 centos 8 服务器上加载 jekyll 网站?
编辑
在我上面的问题中,我实际上用我拥有的域替换了 example.com
,并且该域有一个 A 记录指向我的 jekyll 项目所在服务器的 IP 地址。
Ooh, actually, in my project, I don't use example.com . I'm actually using a domain that I own. And the domain points to the IP address of my remote server that has the jekyll project installed.
这里的问题是你不能(除非你做一些隧道)访问项目正在监听的网络接口。 127.0.0.1
是环回地址。它仅在内部可用。
webpack 开发服务器专为本地开发而设计,不适合生产使用。您可以 make it listen on other network interfaces but for production deployment you should follow the deployment instructions(您正在使用的项目可能有 vanilla Jekyll 不包含的额外说明)。