Get the most out of your Centmin Mod LEMP stack
Become a Member

Noob questions

Discussion in 'Install & Upgrades or Pre-Install Questions' started by tdubs, Oct 6, 2017.

  1. tdubs

    tdubs Member

    83
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    7:38 PM
    1.7.12
    10.0.17
    Hello,

    I have come across some noob questions with the initial installation of Centmin Mod. I've used it plenty of times in the past for XenForo but got to the point where I no longer run a forum so I stopped using Centmin Mod since then. With that being said, I am rusty when it comes to setting it up and I feel like I've got this big brain fart.

    I did a fresh install of the Centmin Mod BETA and started thoroughly reading the Getting Started Guide and I'm stuck on the basic hostname, vhost, and root directory setup. Once my initial install completed, I ran uname -n and it outputs ryder.mydomain.com which is the hostname I registered with my VPS company. In Step 1, it mentions that uname -n should output the same hostname as what I registered with my VPS company, which it does. It also mentions that I need to take the 'ryder' and create an A record pointing to my VPS IP, which I also did. I then used Option #2 and created a vhost with mydomain.com and for some reason, it's wanting to use the default Centmin Mod page located at /usr/local/nginx/html and not /home/nginx/domains/mydomain.com/public/. I'm not sure what I'm doing wrong but I swear this never happened to me before when I used Centmin Mod.

    Any ideas? I am using Centos 7 64-Bit as my OS.

    Thanks!
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    7:38 PM
    Nginx 1.13.x
    MariaDB 5.5
    what does your /usr/local/nginx/conf/conf.d/virtual.conf and /usr/local/nginx/conf/conf.d/yourdomain.com.conf contents look like ? Make sure virtual.conf main hostname's server_name isn't same as any added nginx vhost site's domain name as per Getting Started Guide step 1, the main hostname needs to be unique.

    You can check via recursive grep filter of your domain name in vhost directory at /usr/local/nginx/conf/conf.d
    Code (Text):
    grep -rnw 'yourdomain.com' /usr/local/nginx/conf/conf.d
    
     
  3. tdubs

    tdubs Member

    83
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    7:38 PM
    1.7.12
    10.0.17
    It returned:
    Code (Text):
    /usr/local/nginx/conf/conf.d/mydomain.com.conf:9:#            server_name mydomain.com;
    /usr/local/nginx/conf/conf.d/mydomain.com.conf:10:#            return 301 $scheme://wwwmydomain.com.com$request_uri;
    /usr/local/nginx/conf/conf.d/mydomain.com.conf:15:  server_name mydomain.com www.mydomain.com;
    /usr/local/nginx/conf/conf.d/mydomain.com.conf:29:  access_log /home/nginx/domains/mydomain.com.com/log/access.log combined buffer=256k flush=5m;
    /usr/local/nginx/conf/conf.d/mydomain.com.conf:30:  error_log /home/nginx/domains/mydomain.com/log/error.log;
    /usr/local/nginx/conf/conf.d/mydomain.com.conf:32:  include /usr/local/nginx/conf/autoprotect/mydomain.com/autoprotect-mydomain.com.conf;
    /usr/local/nginx/conf/conf.d/mydomain.com.conf:33:  root /home/nginx/domains/mydomain.com/public;
    /usr/local/nginx/conf/conf.d/virtual.conf:3:            server_name ryder.mydomain.com;
    


    So what I need to do is go into /usr/local/nginx/conf/conf.d/virtual.conf and /usr/local/nginx/conf/conf.d/mydomain.com.conf and set the hostname to something different than ryder.mydomain.com?
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    7:38 PM
    Nginx 1.13.x
    MariaDB 5.5
    the configs for virtual.conf and mydomain.com.conf look correct as they have different server_name entries so should work

    Other side is checking DNS is correct use dig to check DNS for domain
    Code (Text):
    dig +short A @8.8.8.8 mydomain.com
    dig +short A @8.8.8.8 www.mydomain.com
    dig +short A @8.8.8.8 ryder.mydomain.com
    

    check HTTP headers via curl
    Code (Text):
    curl -I http://mydomain.com
    curl -I http://www.mydomain.com
    curl -I http://ryder.mydomain.com
    
     
  5. tdubs

    tdubs Member

    83
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    7:38 PM
    1.7.12
    10.0.17
    Code (Text):
    [05:43][root@ryder.mydomain.com ~]# dig +short A @8.8.8.8 mydomain.com
    104.27.149.44
    104.27.148.44
    [05:59][root@ryder.mydomain.com ~]# dig +short A @8.8.8.8 www.mydomain.com
    104.27.148.44
    104.27.149.44
    [05:59][root@ryder.mydomain.com ~]# dig +short A @8.8.8.8 ryder.mydomain.com
    104.27.149.44
    104.27.148.44
    [06:01][root@ryder.mydomain.com ~]#
    


    curl Check:
    Code (Text):
    [06:01][root@ryder.mydomain.com ~]# curl -I http://mydomain.com
    HTTP/1.1 200 OK
    Date: Fri, 06 Oct 2017 06:07:53 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: __cfduid=dd7b0d371e74d17a1519162d820e592b11507270072; expires=Sat, 06-Oct-18 06:07:52 GMT; path=/; domain=.mydomain.com; HttpOnly
    Vary: Accept-Encoding
    Server: cloudflare-nginx
    CF-RAY: 3a967164227b142b-LAX
    


    Code (Text):
    [06:07][root@ryder.mydomain.com ~]# curl -I http://www.mydomain.com
    HTTP/1.1 200 OK
    Date: Fri, 06 Oct 2017 06:08:44 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Set-Cookie: __cfduid=da40acf124407d5f2346cb0a68ced07b01507270124; expires=Sat, 06-Oct-18 06:08:44 GMT; path=/; domain=.mydomain.com; HttpOnly
    Vary: Accept-Encoding
    Server: cloudflare-nginx
    CF-RAY: 3a9672a3331876e2-LAX
    


    Code (Text):
    [06:08][root@ryder.mydomain.com ~]# curl -I http://ryder.mydomain.com
    HTTP/1.1 200 OK
    Date: Fri, 06 Oct 2017 06:12:22 GMT
    Content-Type: text/html; charset=utf-8
    Content-Length: 3801
    Last-Modified: Thu, 05 Oct 2017 21:18:10 GMT
    Connection: keep-alive
    Vary: Accept-Encoding
    ETag: "59d6a192-ed9"
    Server: nginx centminmod
    X-Powered-By: centminmod
    Accept-Ranges: bytes
    
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    7:38 PM
    Nginx 1.13.x
    MariaDB 5.5
    Looks good there too though it's reporting cloudflare's IP not server IP which is expected when behind cloudflare. Tried something as simple as restart nginx + php-fpm services ?
    Code (Text):
    nprestart
    

    Could also be problem with cloudflare itself
     
  7. tdubs

    tdubs Member

    83
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    7:38 PM
    1.7.12
    10.0.17
    That did not work. :(
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    7:38 PM
    Nginx 1.13.x
    MariaDB 5.5
    Not sure what to say, your vhost configs and dns all check out fine so should work. Is this test server ? Tried disabling cloudflare and see if it works ?
     
    Last edited: Oct 7, 2017