Plesk tips $ tricks

How to install cpanel and plesk

[ad code=4 align=center]

Plesk Demo

Plesk Login and password from psa:
# mysql -u admin -p`cat /etc/psa/.psa.shadow`
mysql> use psa;
mysql> select * from clients where pname=’Client Name’;
select * from accounts where id=’3245′;

To find the password of an email account
# mysql -u admin -p`cat /etc/psa/.psa.shadow`
# use psa;
# select * from domains where name=’domainname’;

—> will get like given below.
| 181 | 2005-09-22 | domainname

# select * from mail where dom_id=’181′;
—> will get like given below.
| 265 | domainname | true | 784 | false | | false | false | false | any | -1 | 181 | 392 |
# select * from accounts where id=’784′;

To find the ftp password
# mysql -u admin -p`cat /etc/psa/.psa.shadow`
# use psa;
# select * from sys_users where home=’/home/httpd/vhosts/domainname’;
# select * from accounts where id =’712′;

Reset Plesk admin Password

Additional ftp account

FTP log in Plesk

How to password protect a subdomain
AuthName “Protected Folder”
AuthType Basic
AuthUserFile /home/httpd/vhosts/
Require valid-user

How do I upgrade Plesk (Including patches)

How to change the default port for Plesk
To change the port Plesk listens on you will need to edit /usr/local/psa/admin/conf/httpsd.conf file and change the
following directives to list the port you want Plesk to listen on:
Listen 8443
Port 8443

You will need to restart Plesk afterwards and update the hardware object in the SoftLayer portal with the new port
(Hardware > Click on Server name > Password Update / History)
Plesk cannot listen on any of the ports used for common services (21, 22, 23, 25, 53, 80, 110, 443 etc..).
Most Plesk installs will be using Apache by default. You will want to edit the Apache configuration file C:\Program
1.) Change the following line to list the port number you want Plesk to listen on
Listen 8443
2.) Restart Plesk Control Panel
You will need to restart Plesk afterwards and update the hardware object in the SoftLayer portal with the new port
(Hardware > Click on Server name > Password Update / History)

How to setup a new server

updater Icon missing in Plesk
RPM is located at the …/opt/updater directory in the Plesk distributive.

Install components through autoinstaller
cd /usr/local/psa/bin/
./autoinstaller –help
./autoinstaller –select-release-current –show-components
you want to view.
–select-release-latest Select the latest product version available for your operating system
–select-release-current Select the same product version as the one installed on your machine
./autoinstaller –select-release-current –install-component drweb

Plesk error ERROR: PleskFatalException
rm -rf /var/lib/rpm/__db.00*

Apache failed to start with the “No space left on device” error
These errors mean that there is no available IPC (inter-process communication) resources in the system, such as
semaphores or shared memory segments.
Script to delete semaphore process
ipcs -s | grep apache | perl -e ‘while () {@a=split(/\s+/); print `ipcrm sem $a[1]`}’
ipcs -s|grep apache|awk ‘{print $2}’|while read i; do ipcrm -s $i;done

webmail error “A fatal error has occurred DB Error: connect failed”

To find the history of load on a server
sar -q

How can we add the settings so as to access in Plesk
Create A record or CNAME record for the subdomain in DNS and add the following line in the file given below.
Reconfigure the domain and restart named and apache.

Reconfigure Domain:
/usr/local/psa/admin/sbin/websrvmng –reconfigure-vhost –

Run stat
/usr/local/psa/admin/sbin/statistics –calculate-one –domain-name=domainname

Fixing awstats after a Plesk 8.3 migration
cd /root
tar -xzf fixstats.tar.gz
Please note to change the directory path in as /home/httpd/vhosts or /var/www/vhosts . By default the script is set to /var/www/vhosts
# ./
fixstats v1.2
Usage: ./ [–all | –domain= | –verbose | –test | –help]
–all : Run statistics on all domains. May not be used in conjunction with –domain.
–domain : Run statistics on specified domain only. May not be used in conjunction with –all.
–verbose : Verbose mode. Displays domains as they are processed.
–test : Test mode. Does everything except call awstats. For debugging purposes mostly.
–help : This message.
Enable Full Country list is awstats
vi /usr/local/psa/etc/awstats/
uncomment the line LoadPlugin=”geoipfree”
Rerun the stats for the domain

How to change the mail server ip
/sbin/iptables -t nat -A POSTROUTING -p tcp –dport 25 -j SNAT –to-source

qmail notes – How to change the non existing email accounts bounceback settings globally notes

path to email accounts

[ad code=4 align=center]

Mail queue
command to see mails in queue
command to find the number of mails in a queue
Clean Mail queue
Download qmail-remove tool from here
qmail-remove -r -p “Online Banking” -i -v
qmail-remove -r -p mailer-daemon -i -v
qmail-remove -r -p bouncing -i -v

You can use third party programs like qmail-remove to accomplish queue management in plesk control panel managed qmail
The Plesk control panel itself provides a modified version od qmHandle ( )along with it that can be used with ease to manage the queue
To see the statistics of the queue:

/usr/local/psa/admin/bin/mailqueuemng -s
Messages in local queue: 0
Messages in remote queue: 0
Messages in todo queue: 0
Messages total: 0
Messages found: 0
Timestamp: 1215870834

From this you can see the status of qmails local,remote and todo list
If you wish to do a delivery of the queued messages now run the following command
/usr/local/psa/admin/bin/mailqueuemng -a
To list remote message queue:
/usr/local/psa/admin/bin/mailqueuemng -R
list local message queue:
/usr/local/psa/admin/bin/mailqueuemng -L

To delete messages with a particular pattern in the subject line
/usr/local/psa/admin/bin/mailqueuemng -S”text”

To delete all messages in the queue (Use with caution – possible data loss )
/usr/local/psa/admin/bin/mailqueuemng -D

To disable reverse lookups in qmail with Plesk, simply add -Rt0 to the server_args line in /etc/xinetd.d/smtp_psa

The server is overloaded with SPAM. There are many messages in queue. Mail is delivered slowly

Many email messages are sent from PHP scripts on the server. How can I find what domains these scripts are running on – qmail wrapper

sendmail wrapper

SMTP on different Port in Plesk
a) add the following to /etc/services
smtp-26 26/tcp mail
b) Copy /etc/xinetd.d/smtp_psa to /etc/xinetd.d/smtp_psa-26
c) Change the first line from service smtp to service smtp-26
d) Restart xinetd

How to avoid reverse dns lookup in mail

hard disk quota is not supported
Add ‘usrquota’ to the options in fstab for home partition.
mount -o remount /home
then just ran:
quotaoff -av
quotacheck -avum
quotaon -av

Named error while starting

1) cd /var/named/run-root/etc
2) mv named.conf named.conf.bak
3) cp named.conf.default named.conf
4) for x in `ls`; do /usr/local/psa/admin/sbin/dnsmng update $x; done;/etc/init.d/named restart

Some clients experience a 30-60 second delay when trying to send/receive mail with Plesk mail server.

Plesk backup

Backup convert
/usr/local/psa/bin/backup-convert convert -o output_file_name backup_name

Mail wrapper

Qmail faq
Maintaining your qmail server
queuelifetime – The “queuelifetime” setting for qmail determines how long messages can stay in the queue. By
default, your qmail server will keep messages in the queue for 604,800 seconds, or 7 days. However, you can set a
custom queuelifetime by creating a file called /var/qmail/control/queuelifetime. The content of that file is a
single line containing a number which represents the number of seconds the queue will hold any given message. If
you want to set a custom queuelifetime, you might want to whip out the old calculator.

Squirrelmail 1.4.11 attachment issue
Then from the root of the SquirrelMail directory (/usr/share/psa-horde/sqmail) (where src, class, etc can be seen),

patch -p0 < path_to_the_directory_to_patch/1.4.11_compose_attachments.patch You should then see two lines come back that say it has updated compose.php, and addrbook_search_html.php The GTUBE (Generic Test for Unsolicited Bulk Email) is a 68 byte test string used to test anti spam solutions, notably those based on spamassassin. In spamassassin, it carries an antispam score of 1000 by default, which would be sufficient to trigger any installation. The contents of the string are as follows: XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X How do I repair/rebuild all Qmail configuration files and restore settings for all mailboxes? It can be done with Plesk mchk utility which is located in: $PRODUCT_ROOT_D/admin/bin/mchk Synopsis: mchk [OPTION] –without-spam – restore all settings except for SpamAssassin configuration –with-spam – restore all settings –spam-only – restore only SpamAssassin settings This utility rebuilds in line with Plesk database Qmail control files in the /var/qmail/control, /var/qmail/users directories and mail users’ settings. Also, it sets proper ownership/permissions for all mailboxes (/var/qmail/mailnames/*). Example: # /usr/local/psa/admin/bin/mchk –with-spam # /usr/local/psa/admin/bin/mchk -v MAXPERIP Settings If you are planning on having multiple users connect to your IMAP server from a single IP address, such as in a small home or office network, you may want to increase the “MAXPERIP” setting with the /usr/local/etc/coutier-imap/imapd config file. This setting establishes the maximum number of IMAP connections that can be made from a single IP address. An example of this might be if you have a small office network runing on a single DSL or Cable IP address and your mail server is outside of that network. While each computer in your internal network may have it’s own private IP address, to the outside world anyone coming from your network has the single routeable IP address assigned to your DSL or Cable connection. The default setting for “MAXPERIP” is 4 so f you have a similar network setup and more than 4 people trying to access your IMAP server, you may want to increase this setting accordingly to avoid connection errors. Within the /usr/local/etc/imapd file, the line you are looking for looks like this: Statistics for a domain is calculated, but no icons/images are shown on AwStats pages. This problem fixed in Plesk 8.1.1 Until Plesk 8.1.1 release you can modify AwStats configuration files with: sed -i ‘s,^DirIcons=.*,DirIcons=\”/awstats-icon\”,’ /etc/awstats/*.conf /usr/local/psa/etc/awstats/*.conf After next statistics utility execution by cron the icons will be shown up correctly. If the problem still be actual even if you have Plesk versions greater than 8.1.1, the reason can be in different paths to the icons. Plesk searches for icons in /var/www/html/awstats directory, try to create link: # ln -s /usr/share/awstats/wwwroot/icon/ /var/www/html/awstats Changing language in AWStats Configuration files for AWStats statistics for Plesk domains are located in %plesk_dir%Additional\AWStats\wwwroot\cgi-bin\ and are called awstats.domain_name.conf where domain_name is the name of a domain located on the server. If language needs to be changed for a specific domain, the stats.domain_name.conf file needs to be edited: replace the line Lang=”auto” with (for example) Lang=”ru” # Possible value: # Albanian=al, Bosnian=ba, Bulgarian=bg, Catalan=ca, # Chinese (Taiwan)=tw, Chinese (Simpliefied)=cn, Czech=cz, Danish=dk, # Dutch=nl, English=en, Estonian=et, Euskara=eu, Finnish=fi, # French=fr, Galician=gl, German=de, Greek=gr, Hebrew=he, Hungarian=hu, # Icelandic=is, Indonesian=id, Italian=it, Japanese=jp, Korean=kr, # Latvian=lv, Norwegian (Nynorsk)=nn, Norwegian (Bokmal)=nb, Polish=pl, # Portuguese=pt, Portuguese (Brazilian)=br, Romanian=ro, Russian=ru, # Serbian=sr, Slovak=sk, Slovenian=si, Spanish=es, Swedish=se, Turkish=tr, # Ukrainian=ua, Welsh=cy. # First available language accepted by browser=auto # Default: “auto” To change language for all domains the following file should be edited: %plesk_dir%\Additional\AWStats\wwwroot\cgi-bin\awstats.model.conf with the same changes an in the example above. After the next statistics calculation, statistics language for domains will be applied. I cannot access the webstats for some of my domains via HTTP://, even though the webstat directory is present in their domain The short answer is: if SSL is enabled for a domain, stats can only be accessed via HTTPS. If SSL is disabled,statistics is accessible via HTTP. Switching between Webalizer and AWstats Webalizer and AWstats have different accumulated data storage format, hence you will not be able to see old data from AWstats in Webalizer and vice versa php in html or Parsing PHP in .html Files use the following in vhost.conf AddHandler application/x-httpd-php .html .htm .shtml AddType application/x-httpd-php .html .htm .shtml Creating and Installing Free Self-signed SSL Certificate If you do not feel like paying money for SSL certificates, but still need to secure a site, you can create a self-signed certificate and install it on your web server. This will provide data encryption; however, your customers’ browsers will show warning messages telling that your certificate is not issued by a recognized authority. Thus, using self-signed certificates is not recommended as it will not instill confidence in customers, and is likely to adversely affect the online sales of your client. To secure a site with a self-signed SSL certificate: 1. Go to Domains > domain name > Certificates and click Add New Certificate.
2. Specify the certificate properties:
* Certificate name. This will help you identify this certificate in the repository.
* Encryption level. Choose the encryption level of your SSL certificate. We recommend that you choose a
value more than 1024 bit.
* Specify your location and organization name. The values you enter should not exceed the length of 64
* Specify the domain name for which you wish to generate an SSL certificate. For example:
* Enter the domain owner’s e-mail address.
1. Click Self-Signed. Your certificate will be generated and stored in the repository.
3. Return to the domain’s administration screen (Domain > domain name) and click Setup in the Hosting group.
4. Select the self-signed SSL certificate from the Certificate drop-down box.
If there is no Certificate drop-down box on the screen, this means that you are on a shared hosting account;
therefore, you need to upgrade your hosting package and purchase a dedicated IP address from your hosting provider.
5. Select the SSL support check box and click OK.

Info] Directory for files browsed via HTTPS(SSL)
Since Plesk 7 for Windows does not use httpsdocs directory, the files should be uploaded to httpdocs and they will
be accessible via both HTTP and HTTPS protocols.
Starting with Plesk 7.5, the ‘httpsdocs’ directory is used for ‘Shared SSL’ feature only

[ad code=4 align=center]

Custom error docs
For enabling this feacture you have to check the option “Custom Error Documents” in domain >> setup

Plesk Frontpage issue:∞

“Access Denied” error when trying to log into Plesk
If you get a “Access Denied” error when trying to log into Plesk, it means that you are currently locked out because of too many bad login attempts. To resolve this issue do the following:
1. Log into the psa database.
mysql -uadmin -p$(cat /etc/psa/.psa.shadow) psa
2. All user sessions are stored in the table ‘lockout’ in the psa database. To unlock all users in this table delete the user’s entry from this table using the following query:
delete from lockout;

Changing the page title for the login screen
You can change the title for the control panel login screen.
cd /usr/local/psa/admin/htdocs/javascript
cp common.js common.js.back
open common.js and at the top of the page add this:
document.title = ‘**ENETER THE TEXT HERE**’;

How to reset Plesk admin Password
Linux Server :
Login to Linux server as root, and run following commands :
cd /usr/local/psa/admin/bin
export PSA_PASSWORD=’newpassword’
cat /etc/psa/.psa.shadow

Windows Server : Login to windows server via RDP as a administrator, then open command prompt and run following commands :
C:\Program Files\SWsoft\Plesk\admin\bin\plesksrvclient.exe (according to plesk location)
cd %plesk_dir%
cd admin\bin
Execute this “plesksrvclient.exe”, you will be prompted to enter the new password for your “admin” plesk user.
You can then log into the plesk interface again and use as normal.

Script to find vulnerable files in a server
cd /usr/src
bash script
Open file /root/hacks_details.txt and you will get all the details

Frame redirects

URL Redirect

How to check whether mod_rewrite is enabled on a server

place the following lines in your .htaccess: Code:
Options +FollowSymLinks
Redirect /joomla.html
note: if your site is located in subdomain example “test” you need to insert in .htaccess as: Code:
Options +FollowSymLinks
Redirect /test/joomla.html
Now point your browser to:
If it redirects you to – mod_rewrite is working. If it gives you an error – mod_rewrite is not working.

Mamboo Installation issue in plesk 8.1.1

When you log in to control panel, it can open in either a standard view, a simplified desktop view, or a combination of both.
The standard view is a customary view of the control panel divided into two main areas: navigation pane on the left and the main screen where operations are performed on the right.
The desktop view can show server statistics and shortcuts to the operations you frequently perform everything you may need can now be accessible from a single screen.
You can set the option through plesk admin login and the following steps will help you to select which type of interface to be used for accounts which are using a particular template.
Clients > Client templates > Click on the template to edit >> select the option “Only standard interface is
allowed” or ” Desktop and standard interface are allowed” or “Only Desktop interface is allowed”.

The following url will help in changing the interface of each accounts.

Enabling server-status

[ad code=4 align=center]
SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from

ExtendedStatus On

Error : command not in docroot in /etc/httpd/logs/suexec.log for .cgi files
cp -p /usr/local/psa/suexec/psa-suexec /usr/sbin/suexec

Error “Symbolic link not allowed”
Check open_basedir restriction and give the following in .htaccess file
Options Indexes FollowSymLinks

Redirection Rule
Need to redirect all request to to
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteRule ^(.*)$$1 [R=301,L]

Installing eaccelerator
tar -xvzf eaccelerator-
tar -xvjf eaccelerator-
cd eaccelerator-
./configure –enable-eaccelerator=shared
make install
edit the file /etc/php.d/eaccelerator.ini
mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator
/etc/init.d/httpd stop
/etc/init.d/httpd start

Upgrading ioncube loader ———– download the latest version ———– steps
Download the latest version to some directory(htdocs). Copy the appropiate file ( to the
ioncube folder (normally /usr/local/ioncube). You can get the path from php.ini file (zend_extension =
/usr/local/ioncube/ Edit the above line in php.ini according to the version. Goto
http://servername/ioncube-loader-helper.php (where you downloaded the ioncube source file) and you will see as
An ionCube encoded file has been loaded successfully.
Encoded files should now function correctly.

Get the following error when try to use PHPMyAdmin in the Plesk CP: “#1045 – Access denied for user ‘pma_xxxxxxx’@’localhost’ (using password: YES)”
path to config.default.php is /usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries and the path to is /usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin . Then give necessary privileges

Please Error : Unable to connect to database: get_admin_password() failed: file_get_contents() failed: 0: /usr/local/psa/admin/auto_prepend/auth.php3:1 psaerror(string “Unable to connect to database: get_admin_password() failed: file_get_contents() failed: “)
Make sure that “/etc/psa/.psa.shadow” file has a valid permissions.
Right permissions should be as follows
-rw——- 1 psaadm psaadm 5 Feb 26 11:22 /etc/psa/.psa.shadow

Server monitor in HN

Script to get mail password given a domain name:
#Author Anoop Alias
psapass=`cat /etc/psa/.psa.shadow`
echo “Please Enter Mailname:”
read mailname
echo $mailname >/tmp/mailname
domain=`cut -d@ -f2 /tmp/mailname`
user=`cut -d@ -f1 /tmp/mailname`
echo “use psa;select id from domains where name=’gnusys’;” >/tmp/query1
sed -i s/gnusys/$domain/ /tmp/query1
id=`mysql -uadmin -p$psapass < /tmp/query1|grep -v id` echo “use psa;select account_id from mail where dom_id=’gnusys’ and mail_name=’idiot’;” >/tmp/query1
sed -i s/gnusys/$id/ /tmp/query1
sed -i s/idiot/$user/ /tmp/query1
id=`mysql -uadmin -p$psapass /tmp/query1
sed -i s/gnusys/$id/ /tmp/query1
mysql -uadmin -p$psapass < /tmp/query1 Plesk does not restart Apache automatically when we add a domain or its configuration. Restarting via the Service Management control panel works fine, however. Apache is not restarted immediately by default. Please check the apache restart interval on Server > Preferences.
It was implemented to avoid too many apache restarts if a lot of operations are done in Plesk CP. It doesn’t mean
that apache will be restarted every time of this period. If no one makes changes in Plesk CP then apache will not
be restarted, but if someone does, apache will be restarted not more often than once in the apache restart

Error make_sock: problem listening on port 443, file descriptor (1068) larger than FD_SETSIZE (1024)
Unable to open logs
Too many open files

Do I need a new Certificate Signing Request (CSR) generated to renew a certificate?

In most situations you will not require to generate a new Certificate Signing Request (CSR) to renew an SSL
certificate because you can simply use the one we generated for you when you first purchased the certificate.
However, we are finding that many SSL certificate issuers are now requesting that a new CSR be generated for each
renewal. The reason that many certificate issuers will ask you to generate a new key pair and CSR to request a
certificate renewal is because by renewing your public key along with the certificate you help to protect against
the risk of the cryptographic key being compromised by a sustained computational attack over many years and
maintain improved security for your transactions. You should check with your specific SSL certificate issuer to
find out what their policy is with regards to renewals.

how to exclude an ip recording in webalizer
plesk>Reports>Webstats Preferencies>Hide Refferer

How to setup ssl for subdomain in plesk

URL to unblock ip that are blocked at hotmail

Error “1054 – Unknown column ‘p.products_id’ in ‘on clause'”

Error “1054 – Unknown column ‘a.authors_id’ in ‘on clause'”
To enable http://IP/~username in plesk use the following in httpd.conf

# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
# UserDir enable
# To enable requests to /~user/ to serve the user’s public_html
# directory, remove the “UserDir disable” line above, and uncomment
# the following line instead:
UserDir httpdocs

How do I enable cgi-scripts to run from httpdocs and httpsdocs directories

FTP not working….. Connection closed by foreign host
FTP not working….. Connection closed by foreign host.

Error “Error: This alias already exists” while creating domain
use psa;
select * from domainaliases where name=’’;
delete from domainaliases where name=’’;
select * from `dns_recs` where displayHost like ‘’;
delete from `dns_recs` where displayHost like ‘’;
Follow the steps given below if you still have issue
select * from dns_zone where displayName like ‘’;
delete from dns_zone where displayName like ‘’;
Then delete the named db file

Save MySQL query results into a text or CSV file

Save MySQL query results into a text or CSV file

mysql > select firstname, email from TABLE INTO OUTFILE ‘/tmp/result.txt’;
mysql> select firstname, email from TABLE INTO OUTFILE ‘/tmp/result.csv’ FIELDS
TERMINATED BY ‘,’; –> This will use , as field deliminator

[ad code=4 align=center]


Join the Conversation


  1. Just wish to say your article is as amazing. The clearness on your put up is just spectacular and i could assume you are an expert on this subject. Well together with your permission let me to take hold of your feed to stay updated with approaching post. Thanks a million and please keep up the rewarding work.

Leave a comment