Perfect guideline for dummies to: "How To Configure Nginx as a Front End Proxy for Apache"
-
@xpcontact may I ask why do you need both ?
-
@xpcontact i never actually setup cpanel my self, i have a feeling it's php based, if so, you don't really need Apache, this is a guide on how to setup php with nginx, basically to run a wordpress site, but it's all the same, https://www.digitalocean.com/community/articles/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04
then after you have your cpanel running, you can proxy your nodebb instance to nginx.
what kind of server are you running, and where?
-
remember to uninstall Apache, and if you can, drop that server, and start fresh,
DigitalOcean have them all, lol
https://www.digitalocean.com/community/articles/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-6 -
For what you need to do to manage a Cloud server, you don't really need cPanel. But that's just me.
-
@xpcontact This depends on a couple things. Are you running Apache or nginx on port 80 on that host right now? If the answer is no, just change the port to 80 in the config.json and restart app.js.
If the answer if yes, you need to proxy/reverse proxy the connection through apache or nginx.
A couple things I ran into with these configurations.
Apache needs to be on 2.4.x branch to support websockets via proxy.Running nginx, you need to be on the 1.4 branch of code to support websockets.
There is a guide to this in the nodebbwiki for use with nginx, and I posted my config in this thread http://community.nodebb.org/topic/761/takes-a-few-seconds-for-it-to-show-users-and-that-i-m-logged-in for how to use it in an apache environment.
-
@julian No prob,I'm still getting my feet wet but really enjoying the feel of the system. I've actually switched to nginx now (don't know why I didn't do this sooner!), had to update to 1.4x manually as debian 7 uses 1.2 still and that version doesnt support websockets.
-
-
Finally there is a light!
I do not remember the steps exactly, but mainly if someone having the same problem (running CentOS 6) you need to:nano /etc/nginx/conf.d/virtual.conf
add the code what was already mentioned many time:
https://github.com/designcreateplay/NodeBB/wiki/Configuring-nginx-as-a-proxy-to-NodeBB
So my problem was that I was not able to figure out the right files to edit! (when you guide people, you might always remind the path or mention exact file need to be edited - what is obvious for you, might be obscure for others)
Now the forum works fine, but there is a new problem:
I want to run nodebb only at http://forum.caffeh.com (as sub-folder or sub-domain) but I can see it is same running at the root (caffeh.com ) and at the server IP 37.59.29.104
My virtual.conf file:server {
listen 80;server_name forum.caffeh.com; location / { 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; }
}