Manually removing the domains from plesk – when plesk frontend don’t work

Could be a bug with Plesk 9.5 version. But Plesk 9.5 is giving issues once in a while in deleting the domains which are “partially” created.

ISSUE

DNS zones are never created, and the DBs are not properly updated. Even after reconfiguring the domains using websrvmng.exe –reconfigure-vhost –vhost-name =”domain.com” it couldn’t be deleted. Shows the message “Information: Domains are now removed”, but in real, the domain will be still shown under the domains list.

And the domain will be in suspended state. Unsuspension of the domain will result in an error message “DNSZone::Table::select() failed: no such row in the table”

Solution for the above issue is explained at http://www.supportsages.com/blog/2009/08/plesk-account-unsuspension-tableselect-failed-no-such-row-in-the-table/

However even after fixing the DNS like this, the issue cycles.

Removal of domain results in suspension of domain -> Unsuspension of domains results in above error -> Fixing the error allows to unsuspend and Removal of domain results in suspension of domain :D

SOLUTION

So solution I used to solve was to manually remove the domain related entries from plesk database, from the file system and also from the email services. Get into MySQL or whichever DB plesk is using. For finding the current DB, use Plesk Reconfigurator and then follow the parallels KB found at http://kb.parallels.com/en/3472

The instructions below assumes that you are using Mailenable and Plesk vhosts directory is at “C:\Inetpub\Vhosts” . This location can be at D:\ or E:\ even. Also, I hereby assume that there are no two domains which can match the mysql LIKE query I used below i.e There are no domains like 1domain.com , 2domain.com along with actual domain.com. If there is one, please use your “brain” to find the right domain and the IDs associated with it. When in doubt, please comment.

Disclaimer : If you mess up the database neither me or SS will be responsible for it :)

Let’s first gather all the ‘id’’s first, like dom_id, sys_user_id, id etc which will be helpful in the deletion of database entries relating to the domain name which you want to removed.

1. Getting the IDs.

Domain ID – dom_id or id


 mysql> SELECT id FROM domains where name=’domain.com’

We are assuming that dom_id you got as a result of above command is 8880

Database ID – db_id


mysql> select id FROM data_bases where dom_id=(SELECT id FROM domains where name=’domain.com’);

We are assuming that db_id you got as a result of above query is 1433. Please note that you could get more than one result. Please save all the db_id and re-execute the sql query for each db_id.

System User IDsys_user_id


mysql> select id FROM sys_users where home like '%domain.com%';

We are assuming that sys_user_id you got as a result of above command is 8843

Let’s start the actual deletion process

Shall we backup ? Better be safe!


C:\Program Files (x86)\Parallels\Plesk\Databases\MySQL\bin>mysqldump -P8306 -uadmin -p<plesk DB admin pass> psa > c:\psa.sql

You are now ready to delete. Please execute the follow sql commands in mysql prompt


delete from db_users where db_id='1433';
delete from data_bases where dom_id='8880';
delete from mail where id='8880';
delete from subdomains where id='8880';
delete from dns_recs where id='8880';
delete from domains where id='8880';
delete from domain_aliases where dom_id='8880';
delete from hosting where sys_user_id='8843';
delete FROM sys_users where id='8843';
delete from dns_zone where displayName=’domain.com’;

Database entries are deleted. Now it’s time to remove the users and files from the filesystems, IIS, Server, Mail server, DNS server etc.

  1. Remove the domain from inetpub -> vhosts
  2. Remove from Mail Enable Administrator. If it is SmarterMail, follow other steps.
  3. Start => run => mailenable.msc => Post Offices and remove it.
  4. Remove Sites “domain.com” and “Application Pool” from Internet Information Services manager. If IIS7, use command line option => %systemroot%\system32\inetsrv\APPCMD.EXE delete site “domain.com” .
  5. Remove from Computer management Console -  System Tools > Local Users and Groups > Users. You must remove references to the domain for Plesk Domain User and Plesk IIS User as well.
  6. Remove DNS entry – depending on the DNS server.

Finally,


cd %plesk_bin%
domain.exe -r domain.com

These steps should help remove the domain manually from the plesk. Please note that this article is based on the second attempt and could be buggy. I assume some “common sense” when running these commands. Understand the commands and each step before you actually execute it. Good luck. Don’t MESS up!!

Post to Twitter Tweet This Post

Continue Reading

How do I change the default Plesk Backup Repository location ?

Windows 32 bit edition

You can edit default server backup repository directory path through registry. Go to

Regedit and then browse the keys
HKEY_LOCAL_MACHINE\SOFTWARE\PLESK\PSA Config\Config

Right Click on variable “DUMP_D” select Modify and set the server backup repository path as you wish. Default Directory Path for Plesk Backup is “C:\Program Files\Parallels\Plesk\Backup\”. Go ahead and change it to a location of your wish, say “E:\Backup”

Windows 64 bit edition

Again it’s the registry only, but the location may be a bit different. You need to browse to
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PLESK\PSA Config\Config

And repeat the steps mentioned above. If you cant find these keys, search for the “DUMP_D” without quotes and update it.

Linux 32/64 bit editions

#vi /etc/psa/psa.conf

Find the following variable, DUMP_D and edit the server backup repository directory PATH as you wish. Default Directory Path for Plesk Backup is “/var/lib/psa/dumps” You may change it to /media/backups

# Backups directory
DUMP_D /var/lib/psa/dumps

Okay. Those were the steps of a sysadmin not so greenhorn. If you are not comfortable with running regedit, use Plesk Panel Reconfigurator.

By using Parallels Plesk Panel Reconfigurator you can move the Parallels Plesk Panel backup files storage directory to another location on the same or another partition.

To change location of the backup files directory, follow these steps:

1. Run Parallels Plesk Panel Reconfigurator and select the Change Plesk Backup Data location option.
2. Specify the destination directory name. If the directory does not exist, it will be created.
3. Click Next. During this operation all Parallels Plesk Panel services will be restarted.

Post to Twitter Tweet This Post

Continue Reading

Solving “Service Unavailable” message just for one website in Plesk and IIS7

A particular website of a client was getting “Service Unavailable” message for just one website in a Plesk server while all other website was working fine. No logs in Event Viewer were giving any clue. However when someone changed the Application pool to use the shared pool plesk(domain2.0)pool, it was working fine which deserted the issue to application pool issue.

Approach to the solution

  1. Check the application pool running, by taking Start => Run => inetmgr
  2. Find out which application pool a website is running by taking the IIS Manager => Sites => domain.com (domain in question) and right column of options => Advanced Settings => General => Application pool
  3. Expand application pools and check whether the application pool is stopped and if it is in the stopped status, start it.
  4. As a good measure, please recycle the application pool as well.
  5. If it fails to start, check whether the application pool generates any event logs. Next measure is to reset the password of IUSR_username
  6. For resetting the password of IUSR_username, go with the below steps,
    1. Login to the server by RDP
    2. Retrieve password of the domain owner from Parallels Panel database running this command:

      “%plesk_bin%”\dbclient –direct-sql –sql=”select su.login, a.password from accounts a, sys_users su  where a.id=su.account_id and su.login=’username’ ”

      login       password
      username password

      where username is an owner of the domain, which can be taken from Plesk => Domains => Web Hosting Settings

    3. Synchronize system password with accordance of retrieved one as follow:

      net user IUSR_username password

  7. Try restarting the application pool again and if is works well, all is good, or else, check to see further options, like Handler Mappings or ISAPI_Filters. But Handler Mappings or ISAPI filters usually affects only one or two types of file extensions.

Post to Twitter Tweet This Post

Continue Reading

Bad Request (Invalid Hostname) when accessing via IP

Customer wanted to have a dedicated IP, but once I change the IP from the plesk control panel, I couldn’t get the website when accessed using IP. Instead, it was giving me the plesk control panel’s default page. Reason ? Default Website was having the IP as “All Unassigned”. Set that to the main IP address. But after that I was getting a new error.

What I could get was “Bad Request (Invalid Hostname)” in bold letters. Here is what I did to fix the same.

Start -> Run -> inetmgr -> Expand the (+) -> Websites -> Right click on the domain name -> Take Properties -> Website -> IP Address (make sure that it has the dedicated IP assigned there) and then click “Advanced”

Add/Edit Web Site Identification

IP Address : Choose the dedicated IP from drop down list
TCP/IP Port : 80
Host Header Value : Leave it blank (Important)

Leaving the Host Header Value should fix the issue and fetch the website when accessing it using the IP.

Post to Twitter Tweet This Post

Continue Reading

How to recover forgotten plesk password from a Linux or Windows Dedicated or VPS server

To Recover your plesk password on a Linux Dedicated or VPS Server

  1. Login as root to the server using ssh
  2. Then issue the command below, to see your plesk password cat /etc/psa/.psa.shadow

To Recover your plesk password on a windows dedicated or VPS server

  1. cd %plesk_bin%
  2. Make sure that you ended up in a folder which is a line similar to “C:\Program Files\Parallels\Plesk\admin\bin\” If not, you will have to do a “D:\” or so depending on which drive or disk you installed Plesk on and then issue the below command
  3. plesksrvclient.exe -get

Post to Twitter Tweet This Post

Continue Reading

Your email:

 

Post to Twitter Tweet This Post

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later