It may be possible that you may come across an issue of adding a domain via WHM create account function and get the following error:

Sorry, that domain is already setup (remove it from httpd.conf)

Getting the above error simply means that the domain still exists in the virtualhost in apache configuration file known as httpd.conf . There are two main reasons why it has shown you this error.

Reason One:

It might be possible that the domain you are trying to create is being used as a primary domain for one of the accounts or may be it has been used as an addon domain or parked for other domains and accounts.

Reason Two:

Or it may be possible that you are facing some technical issues such as the addon, parked or the primary domain is not removed completely from the system after using the removing function.

If the error is due to the first reason, you can easily remove the domain name from the cPanel account and even if it is not removed and come up with the following error:

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

Follow the steps given below:

First you should find out who owns the domain, enter the following command:

/scripts/whoowns example.com

Even if it didn’t show any results, enter the following command string:

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

You will get the result something like the following:

[email protected] [~]# grep example.com /var/cpanel/users/*
/var/cpanel/users/exam:XDNS1=example.com

As you can see, we could easily find the owner of the domain (example.com), the next step is to edit the following files with the corresponding user and remove the lines associated with 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

That’s it!

Like this post ?

Share on your Social Networking Profile ( Facebook, Twitter & Google+ ) and get a flat 10% Recurring discount on our VPS Hosting and Dedicated Servers.

Email us the shared link at : [email protected] or speak to our live chat operator now, by clicking on the “Live Chat” Scroller on the left-hand side of this page and we will provide you with the discount Coupon right away!

About The Author