Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to Fix: The Domain already exists in Apache Configuration  (Read 2925 times)

0 Members and 1 Guest are viewing this topic.

joseletk

  • Guest
Scenario: When trying to add a subdomain, parked, or add-on domain via cPanel it causes an error of where it somehow already exists in cPanel’s Apache Configuration Files.

We want to remove all instances of the domain name.

1) Verify Ownership of the Domain in question:

#  grep mydomain.com /etc/userdomains

It will push back to you: mydomain.com: OWNER NAME

2) Verify if a DNS Zone exists for the Domain

#  ls –ld /var/named/mydomain.com.db

3) Kill the DNS Zone for the domain:

#: /scripts/killdns mydomain.com

4) Now, We will make sure no cPanel Users are showing existing traces of the domain:

# grep mydomain.com /var/cpanel/users/*

It will push back a result similar to: /var/cpanel/users/owner:XDNS1=mydomain.com

5) Edit any files that have the traces, you can use any editor such as vi or nano.

6) Rebuild the Domain Databases:

#  /scripts/updateuserdomains

 7) Rebuild the Apache Configuration:

#  /scripts/rebuildhttpdconf
# service httpd restart

You should now be able to add the domain.
====================================================================