Start a conversation

How to Fix cPanel Error: Sorry, that domain is already setup (remove it from httpd.conf?)

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 set up (remove it from httpd.conf)

Getting the above error simply means that the domain still exists in the virtual host 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 maybe 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:

root@server [~]# 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 a 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!

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Diya Ahmed

  2. Posted

Comments