Passenger does not display app.js


Looking for a little bit of help here on DreamHost’s Passenger integration – Let’s see how much preemptive detail I can provide. Any and all help would be greatly appreciated!!

  • I’m on a VPS

  • Utilizing version:
    [ps21170]$ node -v

  • .htaccess:
    [ps21170]$ cat .htaccess
    PassengerNodejs /home/familyc22/.nvm/versions/node/v12.18.3/bin/node

  • app.js
    var http = require(“http”);

http.createServer(function(request, response) {
response.writeHead(200, {“Content-Type”: “text/plain”});
response.write("Hello World. This page is running Node.js version: ");

  • tree:
  • tmp/
    – restart.txt
  • public/
  • app.js
  • .htaccess
  • Site after node app.js
  • Site after: touch tmp/restart.txt
    (Blank – nothing on it at all)
  • No errors in http/errors.log
  • Access seen in access.log, though

I’ve followed the NPM configuration guide twice, the bin/node file for the version I am using exists and is set as the default. Nothing is found in the console log for visiting the site either. I’m at a complete loss as to what I could be doing wrong. Any and all help would be greatly appreciated! Thank you for your time and consideration.

Passenger should fire up node and load app.js from the domain directory (webroot) that was set in Panel. If a failure is encountered Passenger should print a brief message as a response informing that something went wrong (albeit with little to no detail).

Tree should be:
/home/familyc2/… +

    - publicly accessible files
    - restart.txt


That’s how I have it laid out:

Except I don’t have the folder called “”, just “familyc2” – but it 404’s if I change that folder name.

Ahh. I didn’t spot the difference with the double 2 in the user name.

Is the index.html file in the public directory blank? If so it might be that you’re manually starting node in shell rather than allowing Passenger to control node and allowing it to handle the running of app.js.


Thank you so much for helping me figure this out! I -really- appreciate it.

Unfortunately, it’s not empty.

Are you using the 8888 port number in the browser?
A Passenger controlled app.js serves http over port 80 (even 'tho node is “listening” on 8888).

If I do: npm start
I’ll see the expected website in the browser:

Once I exit that, all I see is a blank website at Passenger does not seem to pick up the site hosting at all.

This is certainly strange behaviour. Passenger usually sends something to the browser as a response even if something goes wrong - and if Passenger isn’t even firing up I’d expect you’d see one of those default “Website is coming Soon!” page that DreamHost sets as a default display rather than a raw directory listing (or a blank page).

I’d be inclined to go into Panel, click on the domain and double check that both the Passenger switch and the NodeJS checkbox have actually stayed set (might have glitched out). If they are, turn them off, try loading the site in a browser to see what happens when served by Apache, then touch /tmp/restart.txt and turn the Panel switches back on again.

It looks like the site is correctly running Node.js, because most URLs produce the “Hello World” message. E.g.:

Hello World. This page is running Node.js version: v12.18.3

The index page appears blank, but it has the title “React App” and if you view source you will see the contents of public/index.html. Similarly, other public files are accessible, like . For debugging/sanity, you might want to put some static visible HTML in index.html (like <h1>Test React App</h1>) so you know it is loading correctly.

1 Like


I completely misunderstood what I was expecting to see… I was expecting to see the “Hello World” on Index, but it makes sense now that I wouldn’t see it now, since my index.html overrides that default message. Jeez… I was expecting it because when I ran it on port 8888, I saw it.

Thank you so much!


Thank you for all your help as well!

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.