How to Fix cPanel Error: Sorry, that domain is already setup (remove it from httpd.conf?)
It might be possible that you simply may come upon with a difficulty of adding a domain via WHM create account function and get the error as follow:
Sorry, that domain is already setup (remove it from httpd.conf)
Getting the error as shown above can simply means that the domain still exists within the virtual host in apache configuration file called httpd.conf . There are 2 main reasons why it’s shown you this error.
Reason One:
It might be possible that the domain you’re trying to create is being used as a primary domain for one amongst the accounts or could also be it’s been used as an addon domain or parked for other domains and accounts.
Reason Two:
Or it should be possible that you simply face some technical problems like the addon, parked or the primary domain isn’t removed fully from the system after using the removing function.
If the error is due to the first reason, you’ll be able to simply remove the domain name from the cPanel account and although it’s not removed and come up with the error as follow:
Error from park wrapper: Sorry, you do not control the domain
Follow the steps given below:
First you have to verify who owns the domain, then enter the command as given below:
/scripts/whoowns example.com
Though if it didn’t show any results, enter the command string as follow:
grep example.com /var/cpanel/users/*
You will get the result some what as shown below:
root@server [~]# grep example.com /var/cpanel/users/*
/var/cpanel/users/exam:XDNS1=example.com
As you’ll be able to see, we could simply notice the owner of the domain (example.com), the next step is to edit the files with the corresponding user and remove the lines related to the domain (example.com) you have problem with.
/var/named/example.com.db
Remove the virtualhost for example.com from /etc/httpd/conf/httpd.conf
/var/cpanel/users/username [remove entries related to domain]
/etc/userdomains
/etc/localdomains
vim /etc/named.conf [remove entries related to domain]
Remove DNS entry in WHM
Run /scripts/updateuserdomains as root on the server