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

Install Let'sencrypt Error: domain.tld is already setup for server main hostname

Discussion in 'Install & Upgrades or Pre-Install Questions' started by siliwangi, May 22, 2020.

  1. siliwangi

    siliwangi New Member

    May 22, 2020
    Local Time:
    2:39 PM
    Nginx 1.17
    MariaDB 10.3
    • CentOS Version: CentOS 7 64 Bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.17.10
    • PHP Version Installed: 7.3.18
    • MariaDB MySQL Version Installed: 10.3
    • When was last time updated Centmin Mod code base ? : now
    • Persistent Config:
    This is a fresh install in a Linode, without any centminmod addons, my hostname and /etc/hosts is already filled with domain.tld, somehow i cannot passed creating the ssl vhost with let'sencrypt supports.
    Do you want to continue with Nginx vhost site creation ? [y/n] y
    Enter vhost domain name to add (without www. prefix): domain.tld
     Error: domain.tld is already setup for server main hostname
     at /usr/local/nginx/conf/conf.d/virtual.conf
     It is important that main server hostname be setup correctly
     As per Getting Started Guide Step 1
     The server main hostname needs to be unique. So please setup
     the main server name vhost properly first as per Step 1 of guide.
     Aborting nginx vhost creation...
    While checking the /usr/local/nginx/conf/conf.d/virtual.conf, the server_name inside that virtual.conf already contained domain.tld. How to proceed with these?
  2. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    5:39 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    What is your intention to have a full web site on domain.tld ? Is so you don't want main hostname to be the same domain name.

    When you install Centmin Mod it's setup a main hostname nginx vhost host for server which is where Nginx default install index page is shown. Accessing server via IP address will show that page and it's correct and should be left as is as the main hostname site is also used for statistics pages outlined here. When you create a new Nginx vhost site via menu option 2, 22 or nv commands, you have a separate Nginx vhost directory structure. The differences are outlined on official Config file page and at Getting Started Guide step 1 and bottom of that page here.
    What does your /usr/local/nginx/conf/conf.d/virtual.conf and /usr/local/nginx/conf/conf.d/ 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 '' /usr/local/nginx/conf/conf.d

    Also check DNS is correct use dig to check DNS for domain
    Code (Text):
    dig +short A @
    dig +short A @
    dig +short A @

    check HTTP headers via curl for both HTTP (and HTTPS if you have HTTPS/SSL)
    Code (Text):
    curl -I
    curl -I
    curl -I
    curl -I
    curl -I