Digital Ocean - Nodebb setup trouble
-
Hey everyone,
I'm trying to publish my Nodebb forum on my server but I'm having a bit of trouble.
I currently have everything set up on my Ubuntu 16.04 digital ocean droplet server (mongo, node, npm and nginx), and I can get static pages working, but whenever i try to link to the nodebb directory instead of a static page directory i receive this error:
Error: Failed to lookup view "500" in views directory "/var/www/nodebb/build/public/templates" at Function.render (/var/www/nodebb/node_modules/express/lib/application.js:580:17) at ServerResponse.render (/var/www/nodebb/node_modules/express/lib/response.js:971:7) at content (/var/www/nodebb/src/middleware/render.js:82:15) at /var/www/nodebb/node_modules/async/dist/async.js:3830:24 at replenish (/var/www/nodebb/node_modules/async/dist/async.js:946:17) at /var/www/nodebb/node_modules/async/dist/async.js:950:9 at eachOfLimit (/var/www/nodebb/node_modules/async/dist/async.js:975:24) at /var/www/nodebb/node_modules/async/dist/async.js:980:16 at eachOf (/var/www/nodebb/node_modules/async/dist/async.js:1051:5) at _parallel (/var/www/nodebb/node_modules/async/dist/async.js:3829:5) at Object.parallelLimit [as parallel] (/var/www/nodebb/node_modules/async/dist/async.js:3912:5) at async.waterfall.str (/var/www/nodebb/src/middleware/render.js:77:12) at nextTask (/var/www/nodebb/node_modules/async/dist/async.js:5273:14) at next (/var/www/nodebb/node_modules/async/dist/async.js:5280:9) at /var/www/nodebb/node_modules/async/dist/async.js:906:16 at /var/www/nodebb/node_modules/async/dist/async.js:421:16
I've tried doing everything the docs say, and I've also tried other stuff like reinstalling everything, rerunning ./nodebb setup and ./nodebb build.
I've checked the config.json which looks like this:{ "url": "http://dogster.dk", "secret": "d2069ebe-2876-4c9a-89c0-758e42b4e779", "database": "mongo", "port": "4567", "mongo": { "host": "127.0.0.1", "port": "27017", "username": "my_username", "password": "my_password", "database": "nodebb" } }
I've also tried
./nodebb reset -p
.I've been messing around with the /etc/nginx/sites-available and /etc/nginx/sites-enabled which are both linked.
The files look like this:
server { listen 80; server_name dogster.dk; location / { root /var/www/nodebb; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://127.0.0.1:4567/; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }
And I've of course also restarted all the service multiple times (nginx, mongo and nodebb).
My nodebb directory is located in /var/www/nodebb
The overall problem is that if i reinstall nginx it starts off fresh and shows the nginx welcome html static page. But when im changing it to the nodebb by correcting all of the forementioned stuff i get the error.
I'd apprectiate some help alot.
Thanks for reading all of this if you made it this far.
Edited by pitaj. Please use code blocks in the future
-
@mbensler: In the basic setup, nginx is used as a reverse proxy only. It does not serve the pages of nodebb, it justs forwards all requests to port 4567! So you do not need to install nodebb in /var/www.
In your configuration it most likely the
root /var/www/nodebb;
which is causing the trouble. Remove it and check if it is working :-).I am not a server expert, but I had absolutely no difficulties setting up my board using the instructions and examples from the documentation (e.g. the nginx settings).
-
Thanks for the replies. I've changed a bit in the setup after looking through guides, and suggestions, and I'm now at a place where I can get the Nodebb installer to show up on my domain. It then wants me to enter my username, email and database type and after i do that my terminal nodebb starts working a lot, and then stops at this point and then nothing happens. At the same time the web installer on the domain just refreshes the site, and allows me to type in the details again. If i do that the same process just starts over again in the terminal. If i CTRL-C the terminal, and then refreshes the domain it tells me bad gateway. Here's a picture of where it just keeps thinking and nothing happens:
I've tried both the mongo and redis database, and i have both installed and setup from the nodebb docs guide.
Appreciate the help
-
@teh_g I changed the nginx configuration to what is displayed in the docs, which now works. Nginx is working fine and im using Node v.8.2.1 - I've tried using 6.11.2 which didn't work for me at all. It wouldn't let me use the npm install --production command without crashing, which 8.2.1 will.