Install node bb but how to change the domain

  • GNU/Linux Admin

    The following are requirements for allowing a domain to resolve to your NodeBB:

    1. You must own a domain name (e.g. example.org)
    2. Your domain's DNS server needs to contain an A record pointing to the IP address of your server machine
    3. Your machine must have a reverse proxy service installed (e.g. nginx or apache, among many possible options)
    4. The reverse proxy must be configured to listen for requests for your domain name, and proxy them on to your NodeBB instance (probably running on port 4567)
    5. Your NodeBB should be configured to have a base_url of your domain name, with use_port as false.

    More information: https://docs.nodebb.org/en/latest/configuring/proxies.html


  • @julian
    can you explain the last point
    5) Your NodeBB should be configured to have a base_url of your domain name, with use_port as false.
    How to do that


  • @SANTOSH-KUMAR When you run ./nodebb setup, you will see URL used to access this NodeBB (http://191.101.6.63:4567) and a flashing cursor, just type http://explorehowto.com and press enter. Keep pressing enter until the setup is finished.

    Assuming your DNS has an A NAME record pointing to 191.101.6.63. Then you will be able to access your forum by going to http://explorehowto.com:4567.


  • I dont want to use :4567 after my domain.How can i do that


  • @SANTOSH-KUMAR

    Read this (You can also use apache, but it's a bit of a pain)

    This will explain how to install Nginx.


  • It makes me confusing can you just tell me easily in two words how to do that


  • You have to set up Nginx or Apache if you don't want the port number at the end. There's no way around that.


  • I have setup vesta control panel on my vps which automatically installs
    Nginx web server as light front-end
    Apache web server as application back-end
    I thought that i am using both


  • @SANTOSH-KUMAR

    Here goes...

    cd ~/
    sudo apt-get install nginx
    cd /etc/nginx/sites-available/
    sudo nano explorehowto.com
    

    Paste in the block (server listen 80: etc) found here

    Replace server_name forum.example.org; with server_name explorehowto.com; and change proxy_pass http://127.0.0.1:4567/; to proxy_pass http://191.101.6.63:4567/;

    Press Ctrl + X to exit, tap Y then Enter to confirm save.

    sudo ln -s /etc/nginx/sites-available/explorehowto.com /etc/nginx/sites-enabled/
    sudo service nginx reload
    

    Try accessing your forum at explorehowto.com

    EDIT: Vesta CP is pretty useless as everything can be done through SSH just as easily with no loss of overheads. You only need Nginx or Apache, not both. If you already have Nginx, then start from cd /etc/nginx/sites-available


  • @a_5mith said:
    ok thanks


  • @SANTOSH-KUMAR

    No problem, if you get a fail message when you reload nginx, then you've pasted the server block wrong and will need to check it to make sure you followed the above steps correctly. To paste the server block into SSH, use right click on your mouse. 👍


  • server {
    listen 80;

    server_name forum.example.org;
    
    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";
    }
    

    }
    Does these are the server blocks


  • @SANTOSH-KUMAR

    Yes. Replace server_name and proxy_pass with what I gave you above. Then carry on the steps.


  • i have cloudflare ssl can i use https://www.explorehowto.com


  • @SANTOSH-KUMAR Yes, but you'll want to be up and running without it first, https and cloudflare can bring it's own issues. So, one step at a time.


  • @SANTOSH-KUMAR, don't take on too much at once. Let's get you up and running at http://www.explorehowto.com before we start using SSL from Cloudflare


  • Ok thanks to all the supporting team
    Especially @a_5mith @Ted
    Thanks YOU uuuuuuuuuuuuuuuuuu


  • @SANTOSH-KUMAR, thank you - but it was really @julian and @a_5mith providing support. Feel free to reach out via chat once you're up and running if you need assistance. I'm usually around, even if I'm not on.


  • @a_5mith
    Pal i reached the last stage every thing setup
    Presntly i have setup domain on http://explorehowto.com:4567
    As you said above i have done all the steps.But a problem with the last step
    when i used server block like this
    server_name explorehowto.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://explorehowto.com:4567/;
    proxy_redirect off;
    
    # Socket.IO Support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    

    }

    then using the following code
    sudo ln -s /etc/nginx/sites-available/explorehowto.com /etc/nginx/sites-enabled/
    sudo service nginx reload

    The result is

    root@server:~# cd /etc/nginx/sites-available/
    root@server:/etc/nginx/sites-available# sudo nano explorehowto.com
    root@server:/etc/nginx/sites-available# sudo ln -s /etc/nginx/sites-available/ex
    plorehowto.com /etc/nginx/sites-enabled/
    ln: failed to create symbolic link `/etc/nginx/sites-enabled/explorehowto.com':
    File exists
    root@server:/etc/nginx/sites-available# sudo service nginx reload

    • Reloading nginx configuration nginx [fail]
      root@server:/etc/nginx/sites-available#

  • OK PROBLEM SOLVED

Suggested Topics

  • 1
  • 4
  • 1
  • 11
  • 3
| |