Manually delete records for any domain from plesk psa database

December 5th, 2008

Manually delete records for any domain from psa database ( this is plesk windows with psa in mysql database, but should work on msaccess db too )

cd %plesk_dir%\mysql\bin && mysql.exe -u admin -P8306 psa -p

PASSWORD

use psa \G

delete from db_users where db_id=(SELECT id FROM data_bases where dom_id=(SELECT id FROM domains where name=’example.com’));
delete from data_bases where dom_id=(SELECT id FROM domains where name=’example.com’);
delete from mail where id=(SELECT id FROM domains where name=’example.com’);
delete from subdomains where id=(SELECT id FROM domains where name=’example.com’);
delete from dns_recs where id=(SELECT id FROM domains where name=’example.com’);
delete from domains where id=(SELECT id FROM domains where name=’example.com’);
delete from hosting where dom_id=(SELECT id FROM sys_users where home=’C:/inetpub/vhosts//example.com’);
delete from FROM sys_users where home=’C:/inetpub/vhosts//example.com’;
delete from dns_zone where displayName=’example.com’;

exit;

iisweb /delete “example.com”
echo y | del “C:\Inetpub/vhosts\example.com”
echo y | del “C:\Program Files\SWsoft\Plesk\Mail Servers\Mail Enable\Postoffices\example.com”
echo y | del “C:\Program Files\SWsoft\Plesk\Mail Servers\Mail Enable\config\Postoffices\example.com”

“C:\Program Files\SWsoft\Plesk\admin\bin\domain.exe” -r example.com
“C:\Program Files\SWsoft\Plesk\admin\bin\DNSMng.exe” restart

Besides you might need to delete post office manually from mailenable.msc -> postoffices and a few other things in GUI

Repair Plesk DNS named.conf

November 25th, 2008

[FIX[ Zone file and corresponding record in named.conf are missed for particular domain

Article ID: 5242

Last Review: Oct,6 2008

Author: Basalyko Roman
Last updated by: system APPLIES TO:

  • Plesk for Windows

Symptoms

Bind DNS server is used.
There is no entry in named.conf for some domain, there also no zone file for it in %plesk_bin%dns\var folder. If records are created manually they will be removed the next time Plesk updates named.conf.

Cause

There is wrong status in dns_zone table for this domain (it is configured to  2). If DNS for some domain is managed in Plesk Control Panel, the status for this domain in dns_zone table is temporary setting to value 2 (to lock it for any changes) and sets it to 0 value when the transaction is over. If for some reason the transaction is interrupted during DNS
managing (Plesk restarts for example) the status field value is not changed to 0 and stays as 2. Domains with that status value are not recorded in named.conf file during any DNS management.

Resolution

Check dns_zone records for problem domain (domain.com for example):

Example for MysQL (Jet)

select * from  dns_zone where name like 'domain.com';

If there is only one selected record, please change status field from 2 to 0.

Notice, that in case that there are several records, Plesk uses the first of them in numeral order. So it is necessary to check that this id does not belong to another domain and delete it in case it is orphaned:

delete from dns_zone where id=[wrong_record_id]

Otherwise set correct values to all fields.

Please apply following query to DNS zone record which belongs to problem domain:

update dns_zone set status=0 where id=[where id is numerical value
obtained from query 1]

Whn it’s done update DNS records using dnsmng.exe utility:

cd %plesk_bin%
dnsmng.exe update *

Monitor 100% CPU utilization in Windows

October 10th, 2008
Since you mentioned "our services" so I'm assuming you have an idea of
which processes you want to log.  If you have an idea of which
processes are problematic you can log CPU usage for selected process
names (don't have to tie it to a specific PID).  You can use Windows'
perfmon.exe (Start Menu -> Run... -> perfmon).  Although it is a
monitoring tool you can log the data to a file.

To use it, start up perfmon.exe.  Expand the "Performance Logs and
Alerts" tree.  Select "Counter Logs".  Right click on the main window
and select "New Log Settings..."  Type in a name.  Select "Add
Counters..."  Under "Performance object" select "Process".  Use the
default "% Processor Time" counter.  Now either select the suspected
instances or select "All instances".  Note that selecting all
instances only selects the processes running at that time, new
processes will not be added when started.  It will however handle the
case when a process stops and then starts again with a new PID.
Select "Add" to add this counter and then select "Close".  Now set
your Interval to whatever you want.  Note that the smallest Interval
you can use with perfmon is 1 second.  You can download the Windows
2000 Resource Kit if you want to get perfmon4.exe which can gather
statistics at 1000 times a second.  Now select the "Log Files" tab and
select your log file type, you may want to save it to a Text (comma
separated or tab separated) file if you want to be able to view the
logs in a normal viewer.       Select "Configure..." if you want to
change the log file name and location.  Now select "Apply" and "OK".
Select your log and use either the right click menu or the toolbar to
start.  This will continue to gather statistics until you tell it to
stop.

Install dependency for VMWare Server

September 24th, 2008

Install VMWare’s Dependency
Install VMWare’s Dependency

yum install libXrender -y
yum install libXtst -y

vyatta - netlink-listen recvmsg overrun: No buffer space available

September 20th, 2008

edit /etc/rc.local

echo 2048576 > /proc/sys/net/core/rmem_max

=============

Then edit “/etc/init.d/vyatta-quagga” and change the following line:

declare -a zebra_args=( ${common_args[@]} -l -s 223232 -i $pid_dir/zebra.pid )

to

declare -a zebra_args=( ${common_args[@]} -l -s 2048576 -i $pid_dir/zebra.pid )

SmarterMail Bad Data. While logging on

September 15th, 2008

Assume that, Your Enable32bitAppOnWin64 = 1

And you are getting the following message

Bad Data.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Security.Cryptography.CryptographicException: Bad Data.

Fix:

Force the Mailservice.exe to run at 32BIT mode with the following command

corflags.exe <executable> /32BIT+

Sourced from: http://www.smartertools.com/portal/KB/a111/how-to-smartermail-on-a-64-bit-server-with-aspnet-20.aspx

How to mount Xen Tap Disk in XEN Server

August 30th, 2008

Assume that the tap disk is using xvda

1) losetup /dev/loop0 /vm/xen_xxx/data

where /vm/xen_xxx/data is your xen image

2) Once this is mounted, You can do a fdisk to check the partition inside /dev/loop0

3) kpartx -a /dev/loop0 to reload the partition layout

4)  mount /dev/mapper/loop0p1 /mnt to mount the partition into /mnt

Cheers.

IIS7 - DEBUGGING ASP Application

August 15th, 2008

Classic ASP: Security is Painful

I had to write some good old classic ASP code today and my classic ASP coding skills are so rusty that I put tons of errors in the code. I’m used to having basic ASP error messages on IIS5 and 6 which usually help me to track down problems. On IIS7 I only got the following though:

An error occurred on the server when processing the URL. Please contact the system administrator

After investigating a bit I figured out that we changed the default for the “scriptErrorSentToBrowser” flag in IIS7. It’s now false and you always get the error above. Here is how to change it:

%windir%\system32\inetsrv\appcmd set config -section:asp -scriptErrorSentToBrowser:true

Once you are done with debugging your ASP app please set it back to false. There are lots of ‘evildoers’ out there! :)

Disable Unwanted Service

August 10th, 2008

chkconfig –level 3 yum-updatesd    off
chkconfig –level 3 xfs             off
chkconfig –level 3 sendmail        off
chkconfig –level 3 rpcidmapd       off
chkconfig –level 3 rpcgssd         off
chkconfig –level 3 portmap         off
chkconfig –level 3 pcscd           off
chkconfig –level 3 nfslock         off
chkconfig –level 3 netfs           off
chkconfig –level 3 kudzu           off
chkconfig –level 3 iptables        off
chkconfig –level 3 ip6tables       off
chkconfig –level 3 firstboot       off
chkconfig –level 3 gpm             off
chkconfig –level 3 bluetooth       off
chkconfig –level 3 cups            off
chkconfig –level 3 avahi-daemon    off
chkconfig –level 3 autofs          off

Dashboard preset used by user failed: DashboardPreset: unable to select: no such row in the table

May 8th, 2008

Such problem may occurs if a domain has reference to custom dashboard presets that really does not exist. check it withthe following command in Plesk mysql database:
mysql>select d.name,d.id, dp.param, dp.val, P.id from domains d, dom_param dp left join DashboardPreset P on P.id=dp.val where dp.param=’custom_preset_id’ and d.id=dp.dom_id and P.id is NULL”
then
delete from dom_param where dom_id=number of domain from previous command