UNSOLVED have problem with install on vm


  • Hi, I put this software on the virtual machine. At the direct address-192.168.1.131:4567-there is a response, and at the external address-there is no response - 93.95.167.101.
    There is also no response for the domain - cp.slainscraft.com
    The firewall has a rule, tried to disable it, redirection is configured in the Internet center:
    ID STATUS NAME Local Adress Protocol PortO PortIn
    7 Enable Node 192.168.1.131 TCP 80 4567
    8 Enable NGINX 192.168.1.131 ALL 4567 4567

    I also tried reinstalling everything.
    In config - "url": "http://cp.slainscraft.com",

    server {
        listen 80;
    
        server_name cp.slainscraft.com;
    
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            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";
        }
    }
    

    Снимок экрана (14).png
    Снимок экрана (15).png

    darkshy@darkshy:/etc/nginx/sites-available$ sudo ufw status
    Status: inactive

  • Global Moderator Plugin & Theme Dev

    @dark-shy is nginx running? Is your nginx config in both sites-available and sites-enabled? Did you restart nginx after adding them? Do you get a response with curl on your server on port 80?

  • Global Moderator Plugin & Theme Dev

    I deleted your other topic. Please only make one at a time.


  • @pitaj Nginx is turn on

    darkshy@darkshy:/etc/nginx/sites-available$ service nginx status
    ● nginx.service - nginx - high performance web server
    Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
    Active: active (running) since Thu 2021-03-04 05:19:53 UTC; 1h 32min ago
    Docs: https://nginx.org/en/docs/
    Main PID: 21973 (nginx)
    Tasks: 2 (limit: 4586)
    Memory: 2.8M
    CGroup: /system.slice/nginx.service
    ├─21973 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
    └─23091 nginx: worker process

    curl - not respond


  • @pitaj i check log:
    2021-03-04T11:41:08.086Z [4567/4813] - info: [socket.io] Restricting access to origin: https://cp.slainscraft.com😘
    2021-03-04T11:41:08.411Z [4567/4813] - info: [api] Adding 0 route(s) to api/v3/plugins
    2021-03-04T11:41:08.421Z [4567/4813] - info: Routes added
    2021-03-04T11:41:08.424Z [4567/4813] - info: NodeBB Ready
    2021-03-04T11:41:08.425Z [4567/4813] - info: Enabling 'trust proxy'
    2021-03-04T11:41:08.426Z [4567/4813] - info: NodeBB is now listening on: 0.0.0.0:4567 <- maybe trouble?

  • Global Moderator Plugin & Theme Dev

    @dark-shy that's not a problem. Please share the command you used to curl port 80 on your server.


  • @pitaj at now moment site is working only on port :4567, when i curl :80 - i take:
    darkshy@darkshy:/etc/nginx/sites-enabled$ curl 192.168.1.103:80
    <html>
    <head><title>403 Forbidden</title></head>
    <body>
    <center><h1>403 Forbidden</h1></center>
    <hr><center>nginx/1.18.0 (Ubuntu)</center>
    </body>
    </html>

  • Global Moderator Plugin & Theme Dev

    @dark-shy try curl http://localhost:80

    Also please use code blocks when appropriate

  • Community Rep

    @Dark-Shy

    A couple simple diagnostics confirm your server is answering incoming connection requests on both ports 80 and 443:

    telnet cp.slainscraft.com 80
    Trying 172.67.131.203...
    Connected to cp.slainscraft.com.
    Escape character is '^]'.
    ^]
    telnet> quit
    Connection closed.
    
    
    telnet cp.slainscraft.com 443
    Trying 172.67.131.203...
    Connected to cp.slainscraft.com.
    Escape character is '^]'.
    ^]
    telnet> quit
    Connection closed.
    
    

    So your firewall rules are fine.

    But it is not serving up html on either. No port 443 makes sense because I don't see nginx config blocks for tls. Port 80 is another matter and leads me to suspect either a misconfigured nginx or misconfigured nodebb config.json

    Maybe I missed it but I did not see your config.json posted, only that single line. Please ensure you don't have any typos, error, missing commas, brackets, braces, etc. I realize that bits of that file are likely sensitive so obfuscate those bits, leaving the remainder as is and post it up here. Maybe we'll catch some glitch there?

    As for nginx, I presume nginx -t is not whinging about any errors? Try driving this command whilst hitting your box via web browser and post up results:

    tail -f /var/log/nginx/access.log
    

    Then maybe also:

    tail -f /var/log/nginx/error.log
    

    I have not used Ubuntu nor Debian since forever so adapt above as necessary to point at 'buntu's nginx logfiles.

    P.S.; Curl (or wget) should work too, as mentioned above. Good luck o/


  • @gotwf nginx does not display the data at all. that is, it does not process the domain. this is very, very strange.. the address you found is the cloudflare address.

  • Community Rep

    @dark-shy We are not mind readers. And my crystal ball is in need of repairs. Please report the logs and/or info back from my and @PitaJ requests. Else otherwise we are groping about in the dark, spinning our wheels, throwing darts blindfolded, etc., in the hopes of getting lucky.

    Shooting from the hip, my guess based on above is that your issue is cloudflare related. Else why would I be hitting cloudflare but not your server? Or maybe I am? Need logs.

    Have fun!


  • @gotwf said in have problem with install on vm:

    We are not mind readers. And my crystal ball is in need of repairs. Please report the logs and/or info back from my and @PitaJ requests. Else otherwise we are groping about in the dark, spinning our wheels, throwing darts blindfolded, etc., in the hopes of getting lucky.
    Shooting from the hip, my guess based on above is that your issue is cloudflare related. Else why would I be hitting cloudflare but not your server? Or maybe I am? Need logs.
    Have fun!

    I can give u or @PitaJ access to virtual machine at pm

  • Global Moderator Plugin & Theme Dev

    @dark-shy I don't plan on fixing it for you. You haven't even tried all of the things I suggested yet.


  • NodeBB Log:

    Nginx part of log:

    root@darkshy:/etc/nginx# root@darkshy:/etc/nginx# nginx
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] still could not bind()
    

    Full error/access log not created, i dont know why.

    Programs on ports


  • Community Rep

    @dark-shy said in have problem with install on vm:

    Nginx part of log:
    root@darkshy:/etc/nginx# root@darkshy:/etc/nginx# nginx
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
    nginx: [emerg] still could not bind()

    You are trying to start nginx when it is already running. Hence port 80 is already in use. Please drive the following commands:

    systemctl restart nginx
    
    systemctl status nginx
    
    nginx -t
    

    Those should confirm that nginx is running fine.

    nginx -t
    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful
    

    From your paste below, seems like maybe NodeBB is not configured 100% correctly? I did not notice anything amiss in your nginx conf posted above. Is that your entire conf file? And/or something amiss with your nodebb config/installation? Warnings are survivable. Errors may not be. You have a couple where modules are not found:

    2021-03-06T11:24:03.851Z [4567/1511] - error: Error: Cannot find module '/var/www/html/node_modules/nodebb-plugin-soundpack-default'
    
    ........
    
    2021-03-06T11:24:03.929Z [4567/1511] - error: Error: Cannot find module './categories'
    
    ............
    
    2021-03-06T11:24:03.936Z [4567/1511] - error: Error: Cannot find module './user'
    
    .............
    
    2021-03-06T11:24:03.997Z [4567/1511] - error: [plugins/spam-be-gone] Honeypot API Key not set!
    
    ............
    
    2021-03-06T11:24:04.151Z [4567/1511] - error: [plugins/spam-be-gone] Unable to verify Akismet API key.
    

    If you don't have those API keys then those bits should be disabled. In ACP/plugins/spam-be-gone:

    0c70c5cd-c022-4244-9fa6-12f025058b05-image.png

    Uncheck Akismet and Project Honeypot boxes.

    I'll leave pitaj to comment on the modules errors.

    Howesomever: That you receive a response to a curl on the localhost indicates your server is indeed serving up some html - at least locally. So the issue is something amiss with access from your external IP address. Your lsof output indicates your server is listening on port 80 on all network interfaces. So maybe a firewall issue - or maybe cloudflare. We still do not have any nginx log files.

    If you tail your nginx access log and then attempt to access your site from an external source (i.e. not local LAN) then you should see that in your nginx logs. If not, then you have an issue upstream from somewhere.

    If so, then mayhaps you have something wrong with your DNS records:

     drill cp.slainscraft.com
    ;; ->>HEADER<<- opcode: QUERY, rcode: NOERROR, id: 23888
    ;; flags: qr rd ra ; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0 
    ;; QUESTION SECTION:
    ;; cp.slainscraft.com.	IN	A
    
    ;; ANSWER SECTION:
    cp.slainscraft.com.	300	IN	A	104.21.4.78
    cp.slainscraft.com.	300	IN	A	172.67.131.203
    
    ;; AUTHORITY SECTION:
    
    ;; ADDITIONAL SECTION:
    
    ;; Query time: 67 msec
    ;; SERVER: 192.168.27.1
    ;; WHEN: Sat Mar  6 07:18:54 2021
    ;; MSG SIZE  rcvd: 68
    
    

    Are you/cloudflare really serving up your stuff on both of those A record addresses above? I don't use Cloudflare but IF nginx logs indicate you are able to access your box from non local lan addresses, then there is something wrong w/your fw, upstream Cloudflare, and/or DNS configuration.

    Hope this helps you get it sorted. Good luck! o/

  • Global Moderator Plugin & Theme Dev

    @dark-shy okay so it looks like nginx is binding on port 80, and you're getting a response from NodeBB there, so it must be something like a firewall preventing access from the outside. You mentioned cloudflare, could you try disabling that?

  • Global Moderator Plugin & Theme Dev

    @dark-shy as for the startup logs, you have a few plugins that aren't compatible with your version of NodeBB. Try disabling them for now


  • @pitaj disable CloudFlare-it will not work, since I have all the dns running through it. In it, I have all the settings for this domain.

    @gotwf said in have problem with install on vm:

    2021-03-06T11:24:03.929Z [4567/1511] - error: Error: Cannot find module './categories'

    ............

    2021-03-06T11:24:03.936Z [4567/1511] - error: Error: Cannot find module './user'

    i dont know how fix it.

  • Global Moderator Plugin & Theme Dev

    @dark-shy the fix is to update those plugins so they use require.main.require('./src/user') instead of module.parent.require('./user'). But if you aren't the developer of those plugins, there's nothing you can do, so just disable them or ignore the errors for now. They aren't causing the issue.

    Since you can access NodeBB on http://localhost:4567, this means NodeBB is running.

    Since you can access NodeBB on http://localhost:80, this means that nginx is (at least partially) working.

    Since you cannot access NodeBB on http://your.ip:80, this means that there's something blocking requests into your server. It may be a firewall on your server, or it may be something upstream from that. Do you mind sharing more information about your setup?

Suggested Topics

| |