Join to Get Free Linux Server Hacks & cPanel Tips

Sorry, that domain is already setup (remove it from httpd.conf) – Error and Fix

Sorry, that domain is already setup (remove it from httpd.conf) – Error and Fix
5 (100%) 5 votes

Once in a while, when you are creating a new account on WHM control panel, you can get this weird error: Sorry, that domain is already setup (remove it from httpd.conf).

This is a very common error on cPanel and WHM, and it means because the domain you are trying to create already exists in the server.

Sorry, that domain is already setup (remove it from httpd.conf) can happen because of two reasons.

How can I fix Sorry, that domain is already setup (remove it from httpd.conf) error?

Let’s ensure you can setup that domain again by cleaning up all the common places where after a failed account termination you still can have partial configuration for that domain name.

1) The domain is actually already created on the server and it is present at Apache configuration, you can check this by browsing to WHM – List Accounts, or, it can also exist because it is a parked domain or subdomain, make sure you check this also by going to cPanel – Parked Domains and cPanel – Subdomains. In this case, it’s common to see another error while trying to remove the domain:

Error from park wrapper: Sorry, you do not control the domain

The solution for this case is the following:

Try to find the domain owner.

/scripts/whoowns sitename.com

If this doesn’t show any results, then run the following grep command:

grep sitename.com /var/cpanel/users/*

You will get something like this:

root@server [~]# grep sitename.com /var/cpanel/users/*
/var/cpanel/users/exam:XDNS1=sitename.com

There you have the account owner, now you can go and remove it from the list of parked/addon/subdomain names.

2) When someone removes an account from cPanel (an independen account, a parked domain, addon domain or subdomain) because of network errors, or software bugs on cPanel, it is not totally removed after you hit the remove tool.

  • Remove the virtualhost for example.com from /usr/local/apache/conf/httpd.conf (/etc/httpd/conf/httpd.conf)
  • Try to delete the dns zone from WHM – Delete a DNS Zone.
  • You can also remove the A registry if it was an addon or subdomain name by editing the DNS Zone from: WHM – Edit DNS Zone or manually altering the data from /var/named/yoursite.com.db

Remove all the entries related to your domain name from the following files:

  • /var/cpanel/users/username
  • /etc/userdomains
  • /etc/localdomains
  • /etc/named.conf

Finally, run:

/scripts/updateuserdomains

This will update the user & domains database.

And if that still doesn’t fix your problem, try a simpler solution:

  • Re-create the addon/parked/subdomain name, and try to remove it again. Sometimes doing this cleans up all the previous screwed operations.

Do you know any other fixes for Sorry, that domain is already setup (remove it from httpd.conf) error? Please share it with us.