tjl2.com

A place to store useful stuff

Has anything here been really useful?


 

[ENSIM] Manually deleting a site

Sometimes, when trying to delete a site on Ensim, it will fail. If you cannot delete the domain through the interface, or via the DeleteVirtDomain command, try the following steps (as root):

  1. First find out the site and admin number of this domain by using the following command:

    sitelookup -d domain.com site_handle,wp_user

    Use the appropriate numbers in all the commands that follow

  2. rm -rf /home/virtual/site#

  3. rm -f /home/virtual/admin#

  4. rm -f /home/virtual/domain.com

  5. rm -f /etc/httpd/conf/virtual/site#

  6. rm -rf /etc/httpd/conf/site#.preview

  7. rm -f /etc/httpd/conf/virtual.preview/site#

  8. rm -rf /etc/httpd/conf/site#

  9. rm -f /etc/webalizer/domain.com

  10. userdel admin#

  11. Log into the PostgreSQL database:

    psql appldb

    Within the PSQL session, do the following queries (where X is the site/admin number):

    • appldb=> delete from users where site_id = X;

    • appldb=> delete from reseller where site_id = X;

    • appldb=> delete from bandwidth_log where site_id = X;

    • appldb=> delete from bandwidth_spans where site_id = X;

    • appldb=> delete from bandwidth where site_id = X;

    • appldb=> delete from ipinfo where site_id = X;

    • appldb=> delete from diskquota where site_id = X;

    • appldb=> delete from telnet where site_id = X;

    • appldb=> delete from apache where site_id = X;

    • appldb=> delete from ssh where site_id = X;

    • appldb=> delete from siteinfo where site_id = X;

    • appldb=> (type Ctrl-D to quit)

  12. Then, check through all text files in /etc/virtualhosting/mappings/ and remove any lines that refer to site# or domain.com. Use the following command to find references:

    cd /etc/virtualhosting/mappings/; grep -l site# *

  13. Finally, restart apache and webppliance:

    service httpd restart; service webppliance restart

This was taken from forum.ensim.com, and was originally written by 'mouse'.

back