Plesk ERROR: PleskMainDBException

Written by Mike on January 17, 2009 – 2:08 pm -

While accessing plesk control panel, somtime we get following Error

ERROR: PleskMainDBException
MySQL query failed: Table 'psa.APSApplicationItems' doesn't exist

0: /usr/local/psa/admin/plib/common_func.php3:218
        db_query(string 'SHOW CREATE TABLE `APSApplicationItems`')
1: /usr/local/psa/admin/plib/SQLParser.php:27
        SQLParser->handleDatabase()
2: /usr/local/psa/admin/plib/MySQL5FixBinaryColumns.php:36
        MySQL5FixBinaryColumns::run()
3: /usr/local/psa/admin/auto_prepend/auth.php3:90

SOLUTION:

The Main reason of this problem is corrupted Plesk Database. We can check that using following command

[root@server ~]#  mysqlcheck -uadmin -p`cat /etc/psa/.psa.shadow ` psa
psa.APSApplicationItems
error    : Table 'psa.APSApplicationItems' doesn't exist
psa.APSClientApplicationItems
error    : Table 'psa.APSClientApplicationItems' doesn't exist
psa.APSLicenseTypes
error    : Table 'psa.APSLicenseTypes' doesn't exist
psa.APSLicenses
error    : Table 'psa.APSLicenses' doesn't exist

To resolve the issue, please do the following:

- remove corrupted tables from plesk database
- restore them from plesk database distributive

you can do above using following Steps

1.  Backup undamaged Tables

mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -NB -e'show tables' > ../tables
for i in `cat ../tables`
 do
  mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` psa $i > $i.sql
 done

2. Remove Plesk database from /var/lib/mysql/ manually.

3. Restore the latest valid daily dump which can be found in /var/lib/psa/dumps/ directory.

4. Finally Restore the backup which we have taken on step 1.

for i in `cat ../tables`
 do echo $i
  mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa < $i.sql
 done

NOTE: Fix for this problem is completely depends upon the error you are getting. So, be careful before trying this fix.


Tags: ,
Posted in Plesk For Linux, VPS hosting, Windows VPS | 1 Comment »

How to use Apache mod_ssl/OpenSSL to generate CSR ?

Written by Pravin on November 14, 2008 – 11:55 pm -

Certificate Signing Request (CSR) contains all the information regarding certificate application. It also includes the Public key.

Following steps will show how to generate a pair of private key and public Certificate Signing Request (CSR) for a webserver, “server” using Apache mod_ssl/OpenSSL.

root@vps [~]# openssl req -new -nodes -keyout vps.key -out vps.csr

This creates a two files. The file vps.key contains a private key;

Following is the output from the above command, you will have to fill some of the fields here:

root@vps [~]# openssl req -new -nodes -keyout vps.key -out vps.csr

Generating a 1024 bit RSA private key
……………++++++
……++++++
writing new private key to ‘vps.key’
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [GB]:GB
State or Province Name (full name) [Berkshire]:Berkshire
Locality Name (eg, city) [Newbury]:Newbury
Organization Name (eg, company) [My Company Ltd]:Trulymanaged
Organizational Unit Name (eg, section) []:Webhosting
Common Name (eg, your name or your server’s hostname) []:vps.server.com
Email Address []:vps@server.com

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:sdfhsdfj
An optional company name []:

Your CSR will now have been created. Open the vps.csr in a text editor and copy and paste the contents into the online enrollment form when requested.


Tags: , , ,
Posted in linux, Linux VPS Hosting, Plesk For Linux, VPS hosting | No Comments »

Plesk key update deferral notification

Written by Mike on November 5, 2008 – 5:07 pm -

ERROR:

You getting emails from Plesk, or getting Following error while pressing “Retrieve Keys” from Plesk >> Server >> License Management

Licensing Server Unreachable: Unable to connect with licensing server.
Please make sure that your network allows communication to ka.swsoft.com:5224.
For more details check system help pages


SOLUTION:

Plesk connects Parallels license server at 5224 port for the license update procedure. Make sure that the outgoing connection to ka.swsoft.com:5224 is not blocked on Plesk server or somewhere in the net. This can be examined with commands:

# nmap -P0 -p5224 ka.swsoft.com

[root@support ~]# nmap -P0 -p5224 ka.swsoft.com

Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2008-11-05 10:00 EST
Interesting ports on ka.parallels.com (64.131.90.38):
PORT     STATE    SERVICE
5224/tcp filtered unknown

Nmap run completed -- 1 IP address (1 host up) scanned in 2.205 seconds


# telnet ka.swsoft.com 5224

[root@support ~]# telnet ka.swsoft.com 5224
Trying 64.131.90.38...
Connected to ka.swsoft.com.
Escape character is '^]'.

Tags: , ,
Posted in Plesk For Linux, Windows VPS | 26 Comments »

How to fix Input/Output error on a VPS?

Written by MaxMK on November 3, 2008 – 12:09 pm -

How to fix Input/Output error on a VPS?

Recently we came up with the following error on one of our server and could not fix the same.

The server is a Virtuozzo Server with Plesk but this fix works for cPanel and other Control Panels as well.

virtuozzo_box How to fix Input/Output error on a VPS?

And the error is as follows;

mv: cannot stat ‘<filename>: Input/Output error
**Note with the filename indicating the corrupt files or broken files

1) Now fora temporary fix Input/Output error try the following:

  • find /vz/private/vps_ID/ | grep “file_name”

**Note with the filename indicating the corrupt files or broken files

  • Then “ls” on directory where file is stored.
  • Remove the broken file and try to restart the VPS.

Explanation for the error with an e.g.

Now the Problem occurs when there are a few broken files inside private area of of the VPS here for e.g we use vps_ID as 1000000

[root@xx ~]# ls /vz/private/1000000/root/var/www/vhosts/domainname.com/httpdocs/images/
ls: /vz/private/1000000/root/var/www/vhosts/domainname.com/httpdocs/images/ln_9.gif: Input/output error
ls: /vz/private/1000000/root/var/www/vhosts/domainname.com/httpdocs/images/logo.jpg: Input/output error
ls: /vz/private/1000000/root/var/www/vhosts/domainname.com/httpdocs/images/ln_7.gif: Input/output error

Here the system cannot stat the files and cannot move them away and these are the files which suggest that the file system on server can be corrupted.

2) Now for a permanent fix for the Input/Output error perform “fsck” for /vz partition.


Tags: , , , , , ,
Posted in Plesk For Linux, VPS hosting | 1 Comment »

PHP Cache

Written by Pravin on October 18, 2008 – 10:23 am -

If your sites are using php as the major scripting & the server load is highly around 10+, PHP Cachers like APC , Xcache or Eaccelerator can are really help to minimize the load to 1-2.

APC: The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. It was conceived of to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.

XCache: XCache is a open-source opcode cacher, which means that it accelerates the performance of PHP on servers. It optimizes performance by removing the compilation time of PHP scripts by caching the compiled state of PHP scripts into the shm (RAM) and uses the compiled version straight from the RAM. This will increase the rate of page generation time by up to 5 times as it also optimizes many other aspects of php scripts and reduce serverload.

Eaccelerator: It is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.


Tags: , , , ,
Posted in Dedicated Server Hosting, linux, Linux VPS Hosting, Plesk For Linux, VPS hosting, Windows VPS | 1 Comment »

How to converting MYSQL table from InnoDB engine to MyISAM

Written by Mangesh on October 16, 2008 – 10:36 pm -

How to converting MYSQL table from InnoDB engine to MyISAM

I have problem of table repair in InnoDB so I need to convert InnoDB to the engine MyISAM.

I converted a MySQL table’s InnoDB to the engine MyISAM.

The code I found for conversion:

ALTER TABLE Tablename ENGINE=MYISAM

You can replace MYISAM engine to InnoDB, ISAM, HEAP and etc.


Tags: , ,
Posted in Dedicated Server Hosting, linux, Linux VPS Hosting, Plesk For Linux, VPS hosting, Windows VPS | No Comments »

Kill Zombie Process

Written by Navjeet on October 16, 2008 – 5:29 pm -

Zombie process or defunction process is a process that has completed execution but still has an entry in the process table. The term zombie process derives from the common definition of zombie—an undead person.

Zombie processes are mostly harmless: they are a process which has finished and is sticking around because their parent hasn’t reaped their exit status. Normally it will do no harm to your system except resource waste.

You can use below command to kill zombie processes:

for i in `ps ax | grep Z | awk {’print $1?}`;do kill -9 $(cat /proc/${i}/status | grep PPid | awk {’print $2?});done


Tags:
Posted in Dedicated Server Hosting, linux, Linux VPS Hosting, Plesk For Linux, VPS hosting | No Comments »

What is DomainKeys

Written by AlanV on October 16, 2008 – 5:51 am -

DomainKeys is an e-mail authetication mechanism designed for verifying the identity of an email sender. It is one of cryptographic authentication method to verify sender’s identity and the integrity of email content. It also verify DNS records of domain of an email sender and the message integrity. DomainKeys has implemented standard of Identified Internet Mail to create enhanced protocol called DomainKeys Identified Mail (DKIM)

How it works and mail is identified as spam or legitimate.

Technically DKIM provides a method for validating a domain name identity that is associated with a message through cryptographic authentication. Basically mailservers generate a public and private key pair and sign outgoing messages with the private key and published the public key as part of their DNS record. The public key published by mailservers can be used to confirm that the sender of the email has not been spoofed.

Email without headers can be used as part of the process of identifying spam.

You can install and use DomainKeys on all cPanel server as cPanel has included this feature for email authentication.

Type the following command on server to enable domainkeys.

#/usr/local/cpanel/bin/domain_keys_installer username (username=cPanel account like alan etc.)

So enjoy the emails without spam :)


Tags: , , , , , ,
Posted in Dedicated Server Hosting, linux, Linux VPS Hosting, Plesk For Linux, VPS hosting | 1 Comment »

How To Use Netstat To Find Out Number Of Connections To Server

Written by Jahangir on October 13, 2008 – 2:04 pm -

Netstat :- Netstat is the most frequent tool used for monitoring network connections on a Linux servers. Netstat returns a variety of information on active connections such as their current status, what hosts are involved, and which programs are involved. You can also see information about the routing table and even get statistics on your network interfaces. Netstat is a good all-around utility and it is an essential tool for the Linux administrators.
If you just type netstat, it would display a long list of information that’s usually more than you want to go through at any given time. The trick is that how to keeping the information useful and what you’re looking for and how to tell netstat to only display that information.

Below is some of the command to find out number of connections to server using netstat, grep, cut, awk, uniq, sort.

To find out the number of connections from an IP.
netstat -ntu | awk ‘{print $5}’ | cut -d: -f1 | uniq -c | sort -n

In the above command AWK print out the 5th column of netstat output, the CUT part cuts every line at the first space character and take the first piece, than we just have to SORT the results and take the UNIQUE values.

To find out the largest number of established connections.
netstat -na | grep ‘ESTABLISHED’ | awk ‘{print $4}’ | cut -d: -f1 | uniq -c | sort -rn

In the above command GREP is been used to find the line containing “ESTABLISHED“, AWK print out the 4th column of netstat output. CUT part cuts every line at the first space character and take the first piece, than we just have to SORT the results and take the UNIQUE values.

To check max number of connections to server.
netstat -nap |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n | tail

In the above command GREP is been used to find the line containing “tcp/udp[ if you want to sort such lines which are matching two or more different pattern then simply define all patterns in single quote and separate them using \|] , AWK print out the 5th column of netstat output. CUT part cuts every line at the first space character and take the first piece, than we just have to SORT the results and take the UNIQUE values. TAIL command print the last part (10 lines) of the output.

To find out the largest number of established connections with port number.
netstat -na | grep ‘ESTABLISHED’ | awk ‘{print $4}’ | uniq -c | sort -rn

To find out the number of connections to port 80 [http] from each IP.
netstat -plan|grep :80|awk {‘print $5′}|cut -d: -f 1|sort|uniq -c|sort -n

Similarly, you can find out the number of connections to port 25 from each IP as.
netstat -plan|grep :25|awk {‘print $5′}|cut -d: -f 1|sort|uniq -c|sort -n

NETSTAT is the most useful tool to detect and determine whether a server is under DoS or DDoS attack (Distributed Denial of Service).


Tags: , , , , , , , ,
Posted in Dedicated Server Hosting, linux, Linux VPS Hosting, Plesk For Linux | 3 Comments »

Some Linux Tricks

Written by AlanV on October 12, 2008 – 6:26 am -

Some Linux Tricks

To do simple calculation you can use command ((…))

$ echo $(( 20 + 10 ))
30

Following are the basic math operator use in Linux.

+ perform addition

/ divide last two numbers

* perform multiplication

- perform substration

For more complex math , like floating point etc. use bc command

$ echo "scale=5; 5/3" | bc
1.66666

You can use ((…)) or bc command to convert hex values to decimal

$ echo $((0xff))
255
$ echo 'obase=10; ibase=16; FF' | bc
255

You should always use uppercase letters while using bc command

To convert decimal to hex:

$ echo 'obase=16; ibase=10; 255' | bc
FF

One of the most important command ‘units’you can use to do conversion

$ units -t '1mile' 'km'
1.609344
Hope you will enjoy this 
 


Tags: , , , ,
Posted in Dedicated Server Hosting, linux, Linux VPS Hosting, Plesk For Linux, VPS hosting | No Comments »
RSS

  • Subscribe Me

  • Tag Cloud

  • Archives