Join the community today
Register Now

Xenforo Migrating from xampp to Linode vps

Discussion in 'Forum software usage' started by Altair, Feb 9, 2018.

  1. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    I was developing for the past 2 years on localhost using xampp,
    I just migrated to Linode vps using centmin mod,
    configured basic nginx vhost configuration for xenforo, and restored database and it looks till now that it restored successfully ! because I can access my admin panel fine by:
    site.com/admin.php and I can login and check everything, however I can't access the site by domain.com, it redirects to domain.com/xampp/ even though my board url from Basic Board
    is just the plain domain.

    Any ideas? might it be a database url parameter? if so how do I edit that without phpmyadmin
     
  2. eva2000

    eva2000 Administrator Staff Member

    37,363
    8,162
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,563
    Local Time:
    9:07 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    in this example site.com and domain.com are the same or different domains ? did you update forum url in xenforo admin.php ?
     
  3. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    they are the same domain, I had already the correct url in basic board information > Board URL: http://domain.com
    is there another field where I have to specify url? I'm using xenforo 1.x

    it's weird that domain.com/admin.php works fine and all the pages inside of it, however accessing the board or any public path at domain.com redirects to domain.com/xampp/ that doesn't exist, even accessing http://domain.com/misc/contact just redirects to domain.com/xampp/

    Note that I deleted the .htaccess file the is in the root directory, could it be that?
     
  4. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    Code:
    [23:33][[email protected] public]# tail -10 /home/nginx/domains/domain.com/log/access.log
    xx.xx.xxx.xxx - - [09/Feb/2018:00:10:22 +0000] "GET /xampp/ HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
    
     
  5. eva2000

    eva2000 Administrator Staff Member

    37,363
    8,162
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,563
    Local Time:
    9:07 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    what output do you get for these curl header check commands

    Code (Text):
    curl -I http://domain.com
    
    curl -I http://domain.com/admin.php
    
    curl -I http://domain.com/misc/contact
    


    do you have any local PC hosts file edits in place that override the domain's DNS ?
     
  6. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    I don't think it's a database issue, cuz when I query the database that I restored on my localhost using search from phpmyadmin, searching inside all tables for: "xampp" doesn't get any matches!

    Also tried searching from the admin panel for "xampp" and didn't yield any results.

    As for the curl output:

    in my hosts file on windows I had the domain.com with the ip of the linode because dns propagate took long time.

    I don't think that's an issue, as when accessing from my iphone the redirect happens to /xampp/ too, is there any vhost configuration that I can put to fix this? I wanna test if my board is working fine with mariadb.


     
  7. eva2000

    eva2000 Administrator Staff Member

    37,363
    8,162
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,563
    Local Time:
    9:07 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    is DNS/internet working on server ?

    Code (Text):
    ping -c4 domain.com
    

    dig check domain DNS A record
    Code (Text):
    dig A domain.com +short
    


    When you create a new nginx vhost domain via centmin.sh menu option 2 or menu option 22 or via /usr/bin/nv cli command line, you will create the Nginx vhost files and directories. You will get an outputted the path location where it will create the domain name's vhost conf file named newdomain.com.conf (and newdomain.com.ssl.conf if you selected yes to self signed SSL)
    • Nginx vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.conf
    • Nginx HTTP/2 SSL vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    • Nginx Self-Signed SSL Certificate Directory at /usr/local/nginx/conf/ssl/newdomain.com
    • Vhost public web root will be at /home/nginx/domains/newdomain.com/public
    • Vhost log directory will be at /home/nginx/domains/newdomain.com/log
    Please post the contents of /usr/local/nginx/conf/conf.d/newdomain.com.conf and if applicable /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf wrapped in CODE tags (outlined at How to use forum BBCODE code tags)
     
  8. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    Code:
    [00:57][[email protected] public]# ping -c4 domain.com
    ping: domain.com: Name or service not known
    
    Code:
    dig A domain.com +short
    Returns nothing.

    I'm using linode dns manager, where I just put linode name servers in my domain registrar's panel, and then configure domain zone from linode dns manager. and there is an A record in my linode dns manager for the hostname.domain.com

    contents of /usr/local/nginx/conf/conf.d/domain.com.conf

    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
    
      server_name domain.com www.domain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      # prevent access to ./directories and files
      #location ~ (?:^|/)\. {
      # deny all;
      #}
    
      location / {
        try_files $uri $uri/ /index.php?$uri&$args;
        index index.php index.html;
    
      include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Wordpress Permalinks example
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      }
    
    
      location /internal_data/ {
      internal;
      allow 127.0.0.1;
      deny all;
      }
    
      location /library/ {
      internal;
      allow 127.0.0.1;
      deny all;
      }
    
      location /install/templates/ {
               internal;
      }
    
      location /install/data/ {
                internal;
    
      }
    
    
      include /usr/local/nginx/conf/pre-staticfiles-local-domain.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
    
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
    
    Not using SSL currently(aka don't have certificate), planning to do in the future:
    contents of /usr/local/nginx/conf/conf.d/domain.com.ssl.conf

    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For HTTP/2 SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    # server {
    #       listen   80;
    #       server_name domain.com www.domain.com;
    #       return 302 https://$server_name$request_uri;
    # }
    
    server {
      listen 443 ssl http2;
      server_name domain.com www.domain.com;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/domain.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/domain.com/domain.com.crt;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/domain.com/domain.com.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/
      #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/domain.com/origin.crt;
      #ssl_verify_client on;
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # mozilla recommended
      ssl_ciphers ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA$
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
    
      # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
    
      # enable ocsp stapling
      #resolver 8.8.8.8 8.8.4.4 valid=10m;
      #resolver_timeout 10s;
      #ssl_stapling on;
      #ssl_stapling_verify on;
      #ssl_trusted_certificate /usr/local/nginx/conf/ssl/domain.com/domain.com-trusted.crt;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
    access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
    error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Wordpress Permalinks example
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      }
    
      include /usr/local/nginx/conf/pre-staticfiles-local-domain.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Wordpress Permalinks example
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      }
    
      include /usr/local/nginx/conf/pre-staticfiles-local-domain.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
    
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
     
  9. eva2000

    eva2000 Administrator Staff Member

    37,363
    8,162
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,563
    Local Time:
    9:07 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  10. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    On introdns.com
    i got everything green marks, and 2 or 3 exclamation marks, with only 1 red mark:
    Code:
    Recursive Queries    I could use the nameservers listed below to performe recursive queries. It may be that I am wrong but the chances of that are low. You should not have nameservers that allow recursive queries as this will allow almost anyone to use your nameservers and can cause problems. Problem record(s) are:
    162.159.26.99
    162.159.24.39
    162.159.24.25
    162.159.27.72
    162.159.25.129
    
    from
    Everthing is fine!
    Code:
    Delegation
    
    Everything is fine.
    
    All tests successful in this part, no errors or warnings
    
    Nameserver
    
    ns1.linode.com.
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Everything is fine.
    
    
    All tests successful in this part, no errors or warnings.
    
    ns2.linode.com.
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Everything is fine.
    
    
    All tests successful in this part, no errors or warnings.
    
    ns3.linode.com.
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Everything is fine.
    
    
    All tests successful in this part, no errors or warnings.
    
    ns4.linode.com.
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Everything is fine.
    
    
    All tests successful in this part, no errors or warnings.
    
    ns5.linode.com.
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Everything is fine.
    
    
    All tests successful in this part, no errors or warnings.
    
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Consistency
    
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Everything is fine.
    
    
    All tests successful in this part, no errors or warnings.
    
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    SOA
    
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Everything is fine.
    
    
    All tests successful in this part, no errors or warnings.
    
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Connectivity
    
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Everything is fine.
    
    
    All tests successful in this part, no errors or warnings.
    
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    DNSSEC
    
    [IMG]http://dnscheck.pingdom.com/images/null.gif[/IMG]
    Everything is fine.
    
    
    All tests successful in this part, no errors or warnings.
    
    
    
     
  11. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    When installing I used the menu option to create vhosts, and then applied permissions and touch commands to xenforo files. Took the time to read dns guide and set up mx txt spf records with zoho mail. And tested it with echo test mail and it worked fine.

    What could it be that dns isn't working?
     
  12. eva2000

    eva2000 Administrator Staff Member

    37,363
    8,162
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,563
    Local Time:
    9:07 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    maybe linode server DNS resolver not working ? what's contents of

    Code (Text):
    cat /etc/resolv.conf
    

    try adding google public dns too
    Code (Text):
    nameserver 8.8.8.8
    
     
  13. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    Code:
    [01:43][[email protected] public]# cat /etc/resolv.conf
    # Generated by NetworkManager
    search members.linode.com domain.com
    nameserver 139.162.138.5
    nameserver 139.162.139.5
    nameserver 139.162.130.5
    
    Do I add it like that: nano /etc/resolv.conf
    then below last nameserver?
     
  14. eva2000

    eva2000 Administrator Staff Member

    37,363
    8,162
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,563
    Local Time:
    9:07 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    add as the first nameserver entry above the other 3
     
  15. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    done
    Code:
    [01:51][[email protected] public]# cat /etc/resolv.conf
    # Generated by NetworkManager
    search members.linode.com domain.com
    nameserver 8.8.8.8
    nameserver 139.162.138.5
    nameserver 139.162.139.5
    nameserver 139.162.130.5

    still the ping commands return the same output in my previous posts.
     
  16. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    Code:
    Running:
    dig +noall +question +answer domain.com
    
    [02:00][[email protected] public]# dig +noall +question +answer domain.com
    ;domain.com.                   IN      A
    
     
  17. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    I just removed my dns records from the pc host file, and now the site isn't available, also the pinging from cmd
    Code:
    Ping request could not find host domain.com. Please check the name and try agai
    n.
    hmmm, also it ain't anymore accessible from my iphone, could it be the google nameserver addition?

    EDIT: so earlier when I was setting dns, I wanted at first to use domain registrar's panel, I inserted an A record for the hostname there, then I decided to use linode dns manager, would that of caused a conflict, I just deleted the A record from the domain panel, and keep only nameservers of linode there.

    EDIT2: From linode checking the zone
    DNS Manager » domain.com » Check zone

    Your zone looks good!
    zone domain.com/IN: loaded serial xxxxxxxx
    OK

    EDIT3: when pinging from my pc the hostname: ping hostname.domain.com it successfully returns the corresponding linode vps ip and when accessed via browser I get:
    Centmin Mod Nginx Test Page

    EDIT4: checking domain through Down For Everyone Or Just Me - Check if a website or site is down.
    reports back:
    It's not just you! domain.com looks down from here.
     
    Last edited: Feb 9, 2018
  18. eva2000

    eva2000 Administrator Staff Member

    37,363
    8,162
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,563
    Local Time:
    9:07 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  19. Altair

    Altair Member

    33
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    1:07 PM
    On A check shows x's. On ns checks shows green checkmarks and on mx records shows correct records.

    I just noticed something:
    Code:
    [02:48][[email protected] public]# whois domain.com
    connect: Connection refused
    [02:49][[email protected] public]# whois google.com
    connect: Connection refused
    Why is connection refused when I try "whois google.com" ? Could this be CSF firewall issues? I haven't touched it yet.
     
  20. eva2000

    eva2000 Administrator Staff Member

    37,363
    8,162
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,563
    Local Time:
    9:07 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    whois command uses TCP port 43 with you need to add to /etc/csf/csf.conf TCP_OUT/TCP6_OUT command separated list of whitelisted ports and then restart csf firewall
    Code (Text):
    csf -r
    

    nothing to do with your actual issue though
     
..