Join the community today
Register Now

Proper way to remove the default account ?

Discussion in 'Centmin Mod Insights' started by pamamolf, Oct 12, 2014.

  1. pamamolf

    pamamolf Premium Member Premium Member

    4,068
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    10:52 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Hi


    What is the proper way to remove the default account demodomain.com created by Centminmod?

    Thanks
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    5:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    just delete the vhost and directory
    Code:
    rm -rf /usr/local/nginx/conf/conf.d/demodomain.com.conf
    rm -rf /home/nginx/domains/demodomain.com
    ngxrestart
     
  3. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    1:22 AM
    Code:
    Restarting nginx: nginx: [warn] conflicting server name "localhost" on 0.0.0.0:80, ignored
    nginx: [warn] conflicting server name "site.com" on 0.0.0.0:80, ignored
    nginx: [warn] conflicting server name "www.site.com" on 0.0.0.0:80, ignored
    nginx.
    i deleted the demodomain using the code above, after restart I received above error. Please advise why? Thanks
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    5:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    use egrep recursive command to find all instances of localhost, site.com and www.site.com in your nginx vhost files directory at /usr/local/nginx/conf/conf.d/ excluding log files from output

    Code:
    egrep -R 'localhost|site.com|www.site.com' /usr/local/nginx/conf/conf.d/* | grep -v '.log'
    
    you should only have one entry returned for ssl.conf which has commented out with hash # in front of server_name localhost; line which you can ignore
    Code:
    egrep -R 'localhost|site.com|www.site.com' /usr/local/nginx/conf/conf.d/* | grep -v '.log'
    /usr/local/nginx/conf/conf.d/ssl.conf:#    server_name  localhost;
     
  5. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    1:22 AM
    here's my result:
    Code:
    /usr/local/nginx/conf/conf.d/site.com.conf:  server_name site.com www.site.com;
    /usr/local/nginx/conf/conf.d/virtual.conf:            server_name site.com www.site.com;
    please advise what to do..thanks
     
  6. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    5:52 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    there's your problem you have server_name set same in 2 nginx vhosts

    for /usr/local/nginx/conf/conf.d/virtual.conf it should have server_name set to server's main hostname not the site domain name i.e. when you order a vps the hostname maybe set or entered as host1.site.com, that is your server_name main host name put it /usr/local/nginx/conf/conf.d/virtual.conf

    site.com for /usr/local/nginx/conf/conf.d/site.com.conf is correct if that is created domain via centmin.sh menu option 2
     
  7. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    1:22 AM
    thanks i figure it out on this thread also Centminmod help | XenForo Community

    thanks for the clear explanation :)