[Help install] 2 forums on same server


  • GNU/Linux

    Hello ,

    I have buy a vps server ( 2 cores , 4 gb ram , 100 gb ssd , 100 mbps)
    and i have install the Ubuntu 14.04 LTS from the hosting company panel .
    Now , i want to install 2 forums-nodebb on the same server .

    1. I have install first forum , everything ok , its responds from : 123.123.123:4567
      Then i have install NGINX but i dont know how to redirect the 123.123.123:4567 to
      my domain name , i have read this : https://docs.nodebb.org/en/latest/configuring/proxies/nginx.html and still not works .
      I have change the dns of that domain with the dns·s that i create on the
      panel of hosting company for that domain and ip , everything ok .

    2. How to clone the second nodebb forum ?
      Ok , i understand that i need to follow the same commands but different ports and folders .
      To clone the 2nd :git clone git://github.com/designcreateplay/NodeBB.git nodebb_forum2

    And then what i need to do ?

    Thanks in advance .



  • Hello,

    First you need to create a config file on nginx for the first forum where you need to have an nginx config looking something like this:

    server {
        listen       80;
        server_name  example.com;
    
        #charset koi8-r;
        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;
    
            # Socket.IO Support
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
      }
    }
    

    then you need to download again the nodebb on a different folder, Run the ./nodebb setup script and configure it with a different port and a different database then you copy the nginx config change the domain name and the port in the proxy_pass option and restart the nginx.


  • GNU/Linux

    @Peter-Zoltan-Keresztes said:

    Hello,

    First you need to create a config file on nginx for the first forum where you need to have an nginx config looking something like this:

    server {
        listen       80;
        server_name  example.com;
    
        #charset koi8-r;
        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;
    
            # Socket.IO Support
           proxy_http_version 1.1;
           proxy_set_header Upgrade $http_upgrade;
           proxy_set_header Connection "upgrade";
      }
    }
    

    then you need to download again the nodebb on a different folder, Run the ./nodebb setup script and configure it with a different port and a different database then you copy the nginx config change the domain name and the port in the proxy_pass option and restart the nginx.

    I have add that code on : /etc/nginx/sites-available/default , and modifi ip:port and domain name its ok ?
    Or where i need to create that file ?



  • @djcyry Make sure you have it in /etc/nginx/sites-enabled/default as well. That's OK. I personally prefer to have different configuration file for different domains.


  • GNU/Linux

    @Peter-Zoltan-Keresztes said:

    @djcyry Make sure you have it in /etc/nginx/sites-enabled/default as well. That's OK. I personally prefer to have different configuration file for different domains.

    No , not working ... :( something is wrong - i do wrong
    Also i have add this line to hosts file on mi pc : 62.75.159.105:4567 www.nodebb.es
    because i think the dns is not ready yet : http://www.intodns.com/nodebb.es

    PD. the second domain , with the dns full propagated is works : http://hercio.net/
    in this setting i neet to modifi the path of nodebb in some place?


  • GNU/Linux

    Now i have install apache and i have edited the :
    /etc/apache2/sites-available/000-default.conf
    /etc/apache2/sites-enabled/000-default.conf

    by adding this lines :

    <VirtualHost 62.75.159.105:4567>
    DocumentRoot "/root/nodebb/"
    ServerName www.hercio.net
    </VirtualHost>

    Only its responds from www.hercio.net:4567 :(
    I dont know what to do for working and install the second forum ....



  • I don't know how to setup with apache cause I never use apache but if you want to try with nginx you could paste your nginx configuration

    also your config.js while you can modify the identifier from the config.


  • GNU/Linux

    @Peter-Zoltan-Keresztes said:

    I don't know how to setup with apache cause I never use apache but if you want to try with nginx you could paste your nginx configuration

    also your config.js while you can modify the identifier from the config.

    I will try with apache one more time , if not i install ngingx .
    One thing , when i install the second forum , the database port still the same port 6379 ?
    I have install the 2nd forum , and i modify only the clone folder name, port to 4568 and database 1 , its ok ?



  • @djcyry Yes the database port does not change just the database itself. You can use 0 for first site and 1 for the second


  • GNU/Linux

    @Peter-Zoltan-Keresztes said:

    @djcyry Yes the database port does not change just the database itself. You can use 0 for first site and 1 for the second

    Done.
    Now ,lets see if anyone knows how to setup that proxy on apache . :(



  • You might want to check the documentation. Use google to find it.


  • GNU/Linux

    Done with nginx . 👍

    First you need to create a .config file on /etc/nginx/conf.d
    Something like this :

     server {
    listen       80;
    server_name  example.com;
    
    #charset koi8-r;
    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;
    
        # Socket.IO Support
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
    

    }
    }

    Then you need to edit 2 lines :

    1. example.com with your website
    2. proxy_pass http://127.0.0.1:4567; with your ip adress

    Afer edit , save that file and then add that code , same code on this files :
    /etc/nginx/sites-available/default
    /etc/nginx/sites-enabled/default

    For redirect non-www to www or vicee versa , add this code :

    server {
    listen 80;
    server_name example.com;

    return 301 http://www.examplee.com$request_uri;
    

    }

    Thanks to all :)


  • Plugin & Theme Dev

    @djcyry you don't have to change proxy_pass http://127.0.0.1:4567 to add your IP... leave it as it is

    if you add the server block in a .conf file under /etc/nginx/conf.d, then you don't need to add it in /etc/nginx/sites-available/default and
    /etc/nginx/sites-enabled/default


Log in to reply
 


Looks like your connection to NodeBB was lost, please wait while we try to reconnect.