0

I'm trying to learn how to use the npm start command on a remote server that has centos 8 installed. I downloaded someone else's jekyll project and then ran the commands:

npm install
npm start

And I get success messages like so:

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

I open a separate terminal window (to not kill the current process), SSH into the server and typed:

systemctl stop firewalld
wget http://127.0.0.1:3000/

And this successfully downloads an index.html file with the contents that I expected from this jekyll project website. I then went to my web browser and typed http://example.com:3000/ but I get a connection time out server/site is unreachable.

How do I use npm start to load up a jekyll website on a remote centos 8 server?


EDIT

In my question above, I actually replaced example.com with a domain that I own, and the domain has an A Record that's pointed to the IP address of the server my jekyll project is on.

John
  • 32,403
  • 80
  • 251
  • 422

1 Answers1

1

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.

The problem here is that you can't (unless you do some tunnelling) access the network interface the project is listening on. 127.0.0.1 is the loopback address. It is only available internally.

The webpack development server is designed for local development, not for production use. You can make it listen on other network interfaces but for production deployment you should follow the deployment instructions (the project you are using may have additional instructions that vanilla Jekyll doesn't include).

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • 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. I'll update my question with this note. – John Nov 03 '20 at 10:51
  • I built the code base into a folder that apache could serve and it worked. I couldn't get the network interface approach to work, so maybe i'll try again next time. For now, I'll just re-build each time I make a change since hot-reloading doesn't work. I'd imagine this dilemma would occur for me if I ran this project from virtualbox in a guest OS as well... – John Nov 03 '20 at 11:21