Page 1 of 1

I deleted my only subdomain, My server is dead. How do I fix it?

Posted: Thu Oct 28, 2021 11:09 pm
by Rob Swan
If you are reading this then as the name suggests you must have deleted the only user defined subdomain on your server.

When we say user defined subdomain, we mean a subdomain that has been created using the EHCP force control panel. We DO NOT mean any of the built in subdomains, for example mail.YouyDomain.com or cp.YourDomain.com.

DON’T PANIC we can fix this.

Login to your server using your PC and PuTTY.

First lets make sure the Apache service is in fact dead.

Issue this command.
sudo service apache2 status

If all is well you will see a screen like this (followed by some other information)

Image

You may have to press CTRL + C to get the server prompt back.

If you do see a green light on the Apache service, then your server has not been effected by this issue, so you do not need to go any further with this FAQ.

If you see a screen like this (followed by some other information), you need to fix it, so read on.

Image

You may have to press CTRL + C to get the server prompt back.

The Fix.
We need to open the EHCP force subdomain configuration file.

So, from PuTTY issue this command.

sudo vi /var/www/new/ehcp/apachehcp_subdomains.conf

Image

Now it important to note before we go any further that we are going to delete the entire contents of this file, as we know there are NO REMAINING user defied subdomains on the entire server.

Press colon (:) then %, then d like this.

Image

Press Enter.

Image

Now save the changes to the file with :w and exit with :q.

We should now be able to start the Apache service to enter this command.
sudo service apache2 start

Assuming you did not get an error, the Apache service should be up and running again, so let check.

Enter this command.
sudo service apache2 status

If all is well you will see a screen like this (followed by some other information)

Image

You may have to press CTRL + C to get the server prompt back.

You can exit out of PuTTY by typing exit (Enter)

That its ALL FIXED!!