PLESK FOR WINDOWS MYSQL ACCESS.

1

PLESK FOR WINDOWS MYSQL ACCESS.

Plesk uses two Mysql servers. One for clients databases (port 3306) and second server for Plesk databases (8306). You can connect to Plesk DB using the following command:

%plesk_dir%\mysql\bin\mysql.exe -uadmin -pPlesk_admin_passwd -P8306

“C:\Program Files\Parallels\Plesk\Databases\MySQL\bin\mysql.exe” -uadmin -pPlesk-admin_passwd -P8306

Plesk-admin_passwd = “C:\Program Files\Parallels\Plesk\admin\bin\plesksrvclient.exe” -get

However if you want to connect to Client’s Mysql Server you should use the following command:

%plesk_dir%\databases\mysql\bin\mysql.exe -uadmin -pPassword -P3306

Password you can find in the psa.misc or psa.databaseservers tables (Plesk DB).

If the Plesk DB provider is set to Access mdb or MSSQL then an appropriate tool will be needed to view the Plesk DB.
===================================================>

HOW TO CONFIGURE WHM / CPANEL WITH A VALID SSL CERTIFICATE

0

HOW TO CONFIGURE WHM / CPANEL WITH A VALID SSL CERTIFICATE

Improve your Server Security – Configure your Server to Force SSL redirection with a VALID certificate for WHM / CPANEL usage.

By default, WHM/CPANEL do not use a secure channel but instead offer an optional link to the user. Even if you don’t want to spend $20 for a GoDaddy Certificate, you can still configure the server to force the secure connection when a user attempts to login to WHM/CPANEL.

How to Setup WHM and CPANL so clients will be redirected to a valid SSL Certificate when logging in.

Instructions based on WHM v11.15.0

1) Purchase / Install the Certificate for your fully qualified domain (ie: server.domain.com)

– You can find your fully qualified server URL in the WHM under:
>> Server Status >> Server Information (System Information)

– Then you will create a certificate for this domain under:
>> SSL / TLS >> Generate a SSL Certificate and Signing Request

– After purchasing your certificate, you will install the certificate under:
** THIS MAY SEEM SLOW – BE PATIENT – WAIT FOR A BOLD CONFIRMATION MESSAGE **
>> SSL / TLS >> Install a SSL Certificate and Setup the Domain

– After installation is complete, you can assign the new certificate to be your SHARED certificate under:
** This is NOT required but is a great benefit for your clients and helps brand your domain **
>> SSL / TLS >> Manage SSL Hosts

2) Test your new Certificate

https://server.domain.com/
This should resolve and the cert should function properly before moving forward. If this does not work, you will need to review addition instruction on SSL installation.

https://server.domain.com:2087/
This should NOT WORK but give you an invalid certificate error. The reason is that the certificate is installed for the domain only, and has not been assigned to the appropriate WHM/CPANEL services.

3) Install the CERT for the WHM and CPANEL Service (this is the step you don’t think about!!)

Service Configuration >> Manage Service SSL Certificates
> Select “Install New Certificate” for the “cPanel/WHM/Webmail Service”
> Select Domain this CRT is for “Browse”
> Pick the full server cert you installed “server.domain.com”
> Press “Submit” to install

4) Test your Service Certificate

https://server.domain.com:2087/

should now be working !!

** Once your done, you may choose to install the same cert for your SMTP, POP, and FTP accounts so that the option is available and functioning properly

ENABLE TOMCAT IN PARALLELS PLESK PANEL USING AUTOINSTALLER.

1

ENABLE TOMCAT IN PARALLELS PLESK PANEL USING AUTOINSTALLER.

1. Login to the server using SSH.
2.run /usr/local/psa/admin/bin/autoinstaller
3.In the Main components list for Parallels Plesk Panel
4.Choose Plesk hosting features
5.Select Tomcat Java Servlets support and complete the wizard.

Deploying Web Applications (.war files) on Apache Tomcat from Plesk Control Panel

1. In the Plesk control panel of the website click on the “Websites & Domains” tab and click on the “Show Advanced Operations” link to expand the the Advanced Operations section there.
2. Now click on the “Java Applications” link from the Advanced Operations section.
3. This will open the Java Applications module from where click on the “Install Java Application” Icon. Make sure to Switch it On first and ensure that tomcat service is running on the server before deploying war files.
4. Now Add New Java Application module will shown and click on the “Browse” button there to select the desired .war file. Then click “Ok” to deploy that application on Tomcat Apache. Please note that the file name of the .war file will be used as the uploaded application’s name and it will available at

http://site_url/application_name location.

Plesk Panel services logs and configuration files for Linux

0

Main services
The most widely used hosting control panel solution
With more than 250,000 Windows and Linux servers deployed, Parallels Plesk Panel is the preferred choice for hosting service providers, web designers, and website owners. Parallels Plesk Panel is the first step down your business’ growth path – toward faster sites and faster mobile access for website owners and toward a complete product line as your hosting business grows.

Control Panel
Error log: /var/log/sw-cp-server/error_log
Access log: /usr/local/psa/admin/logs/httpsd_access_log
Panel log: /usr/local/psa/admin/logs/panel.log

service control:
Stop: /etc/init.d/psa stop
Start: /etc/init.d/psa start
Restart: /etc/init.d/psa restart

config files:
php: /usr/local/psa/admin/conf/php.ini
www: /etc/sw-cp-server/applications.d/plesk.conf
features: /usr/local/psa/admin/conf/site_isolation_settings.ini
Sitebuilder
Log: /usr/local/psa/admin/logs/sitebuilder.log
Install / Upgrade logs: /usr/local/sb/tmp/

service control:
No service control (working via sw-cp-server service).

config files:
/usr/local/sb/config
/etc/sw-cp-server/applications.d/plesk.conf
/usr/local/psa/admin/conf/php.ini

Billing
Error Log: /var/log/sw-cp-server/error_log
Access log: /usr/local/psa/admin/logs/httpsd_access_log

service control:
No service control (working via sw-cp-server service).

config files:
/usr/local/psa/admin/conf/php.ini
/etc/sw-cp-server/applications.d/plesk.conf
/opt/plesk-billing/htdocs/lib-billing/include/config/config.php

SSO
Error Log: /var/log/sw-cp-server/error_log
SSO log: /var/log/sso/sso.log

service control:
No service control (working via sw-cp-server service).

Utility to configure SSO & Panel integration:
/usr/local/psa/bin/sso

config files:
/etc/sw-cp-server/applications.d/00-sso-cpserver.conf
/etc/sso/sso_config.ini

phpMyAdmin
Error log: /var/log/sw-cp-server/error_log

service control:
No service control (working via sw-cp-server service).

config files:
/usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/config.default.php

phpPGAdmin
Error log: /var/log/sw-cp-server/error_log

service control:
No service control (working via sw-cp-server service).

config files:
/usr/local/psa/admin/htdocs/domains/databases/phpPgAdmin/conf/config.inc.php/p>

Courier-IMAP
Access and Error log: /usr/local/psa/var/log/maillog

service control:
Stop: /etc/init.d/courier-imap stop
Start: /etc/init.d/courier-imap start
Restart: /etc/init.d/courier-imap restart

config files:
/etc/courier-imap/imapd
/etc/courier-imap/imapd-ssl
/etc/courier-imap/pop3d
/etc/courier-imap/pop3d-ssl

SMTP server (QMail)
Access and Error log: /usr/local/psa/var/log/maillog

service control:
Stop: /etc/init.d/qmail stop
Start: /etc/init.d/qmail start
Restart: /etc/init.d/qmail restart

config files:
/etc/xinetd.d/smtp_psa
/etc/xinetd.d/smtps_psa
/etc/xinetd.d/submission_psa
/etc/inetd.conf (Debians)
/var/qmail/control/

Named (BIND, DNS)
Access and Error log: /var/log/messages

service control:
Stop: /etc/init.d/named stop
Start: /etc/init.d/named start
Restart: /etc/init.d/named restart

config files:
/etc/named.conf

Tomcat
Access and Error logs: /var/log/tomcat5/

service control:
Stop: /etc/init.d/tomcat5 stop
Start: /etc/init.d/tomcat5
Restart: /etc/init.d/tomcat5

config files:
/usr/share/tomcat5/conf/

MySQL
Access and Error log: /var/log/mysqld.log

service control:
Stop: /etc/init.d/mysqld stop
Start: /etc/init.d/mysqld start
Restart: /etc/init.d/mysqld restart

config files:
/etc/my.cnf

Postgresql
Startup log: /var/lib/pgsql/pgstartup.log

service control:
Stop: /etc/init.d/postgresql stop
Start: /etc/init.d/postgresql start
Restart: /etc/init.d/postgresql restart

config files:
/var/lib/pgsql/data/postgresql.conf

Plesk SpamAssassin
Access and Error log: /usr/local/psa/var/log/maillog

service control:
Stop: /etc/init.d/psa-spamassassin stop
Start: /etc/init.d/psa-spamassassin start
Restart: /etc/init.d/psa-spamassassin restart

config files:
/etc/mail/spamassassin/
/etc/mail/spamassassin/local.cf
/var/qmail/mailnames/%d/%l/.spamassassin

Drweb antivirus
Access and Error log: /usr/local/psa/var/log/maillog

service control:
Stop: /etc/init.d/drwebd stop
Start: /etc/init.d/drwebd start
Restart: /etc/init.d/drwebd restart

config files:
/etc/drweb/

FTP(proftpd)
Access and Error log: /usr/local/psa/var/log/xferlog

service control:
No service control (working via xinetd service).

config files:
/etc/xinetd.d/ftp_psa
/etc/proftpd.conf
/etc/proftpd.include

Kaspersky antivirus
Log: /usr/local/psa/var/log/maillog
Before 10.2:
/var/log/kav/5.5/kav4mailservers/aveserver.log
/var/log/kav/5.5/kav4mailservers/smtpscanner.log
/var/log/kav/5.5/kav4mailservers/avstats.log
/var/log/kav/5.5/kav4mailservers/kavscanner.log
/var/log/kav/5.5/kav4mailservers/kavupdater.log
service control:
Since 10.2:
Stop: /etc/init.d/kavehost stop
Start: /etc/init.d/kavehost start
Restart: /etc/init.d/kavehost restart
Before 10.2:
Stop: /etc/init.d/aveserver stop
Start: /etc/init.d/aveserver start
Restart: /etc/init.d/aveserver restart

config files:
Before 10.2:
/etc/kav/5.5/kav4mailservers/
Since 10.2:
/opt/kav/sdk8l3/etc/kav-handler.cfg
/etc/kavehost.xml

SMTP server (Postfix)
Access and Error log: /usr/local/psa/var/log/maillog

service control:
Stop: /etc/init.d/postfix stop
Start: /etc/init.d/postfix start
Restart: /etc/init.d/postfix restart

config files:
/etc/postfix/
xinetd
Access and Error log: /var/log/messages

service control:
Stop: /etc/init.d/xinetd stop
Start: /etc/init.d/xinetd start
Restart: /etc/init.d/xinetd restart

config files:
/etc/xinetd.conf

Watchdog (monit)
Log files: /usr/local/psa/var/modules/watchdog/log/wdcollect.log
/usr/local/psa/var/modules/watchdog/log/monit.log

service control:
Stop: /usr/local/psa/admin/bin/modules/watchdog/wd –stop
Start: /usr/local/psa/admin/bin/modules/watchdog/wd –start
Restart: /usr/local/psa/admin/bin/modules/watchdog/wd –restart

config files:
/usr/local/psa/etc/modules/watchdog/monitrc
/usr/local/psa/etc/modules/watchdog/wdcollect.inc.php

Watchdog (rkhunter)
Log: /var/log/rkhunter.log

service control:
Start: /usr/local/psa/admin/bin/modules/watchdog/rkhunter

config files:
/usr/local/psa/etc/modules/watchdog/rkhunter.conf

Mailman (Maillist service)
Log files: /var/log/mailman/

service control:
Stop: /etc/init.d/mailman stop
Start: /etc/init.d/mailman start
Restart: /etc/init.d/mailman restart

config files:
/etc/httpd/conf.d/mailman.conf
/usr/lib/mailman/Mailman/mm_cfg.py
/etc/mailman/sitelist.cfg

AWstats
service control:

Start: /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php

config files:
/usr/local/psa/etc/awstats/

Webalizer
service control:
Start: /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php

config files:
/var/www/vhosts/%d/conf/webalizer.conf

Plesk Backup Manager
Backup logs: /usr/local/psa/PMM/sessions//psadump.log
/usr/local/psa/PMM/sessions//migration.log
/usr/local/psa/PMM/logs/migration.log
/usr/local/psa/PMM/logs/pmmcli.log
Restore logs: /usr/local/psa/PMM/rsessions//conflicts.log
/usr/local/psa/PMM/rsessions//migration.log
/usr/local/psa/PMM/logs/migration.log
/usr/local/psa/PMM/logs/pmmcli.log

Log level
How to enable debug mode for Parallels Plesk Panel backup operations

service control:
Functionality is controlled by the Plesk Control Panel service.

config files:
/etc/psa/psa.conf

Plesk Migration Manager
Migration logs: /usr/local/psa/PMM/msessions//migration.log
/usr/local/psa/PMM/rsessions//migration.log
/usr/local/psa/PMM/rsessions//conflicts.log
/usr/local/psa/PMM/logs/migration.log
/usr/local/psa/PMM/logs/pmmcli.log
/usr/local/psa/PMM/logs/migration_handler.log

service control:
Functionality is controlled by the Plesk Control Panel service.

Horde
Log: /var/log/psa-horde/psa-horde.log

service control:
Functionality is controlled by the Plesk Control Panel service.

config files:
apache configs: /etc/httpd/conf.d/zzz_horde_vhost.conf
/etc/psa-webmail/horde/conf.d/
horde configs: /etc/psa-webmail/horde/

Atmail
Logs: /var/log/atmail/

service control:
Functionality is controlled by the Plesk Control Panel service.

config files:
apache configs: /etc/httpd/conf.d/zzz_atmail_vhost.conf
/etc/psa-webmail/atmail/conf.d/
Atmail configs: /etc/psa-webmail/atmail/atmail.conf
/var/www/atmail/libs/Atmail/Config.php

psa-logrotate
No logs
service control:

Start: /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php

config files:
/usr/local/psa/etc/logrotate.conf
/usr/local/psa/etc/logrotate.d/

Samba
Logs: /var/log/samba/
service control:
Stop: /etc/init.d/smb stop
Start: /etc/init.d/smb start
Restart: /etc/init.d/smb restart

config files:
/etc/samba/smb.conf
/etc/samba/smb.conf.include

psa-firewall
service control:

Stop: /etc/init.d/psa-firewall stop
Start: /etc/init.d/psa-firewall start
Restart: /etc/init.d/psa-firewall restart

config files:
/usr/local/psa/var/modules/firewall/firewall-active.sh
/usr/local/psa/var/modules/firewall/firewall-emergency.sh
/usr/local/psa/var/modules/firewall/firewall-new.sh

psa-firewall (IP forwarding)
service control:
Stop: /etc/init.d/psa-firewall-forward stop
Start: /etc/init.d/psa-firewall-forward start
Restart: /etc/init.d/psa-firewall-forward restart

config files:
/usr/local/psa/var/modules/firewall/ip_forward.active
/usr/local/psa/var/modules/firewall/ip_forward.saved

psa-vpn
service control:

Stop: /etc/init.d/smb stop
Start: /etc/init.d/smb start
Restart: /etc/init.d/smb restart

config files:
/usr/local/psa/var/modules/vpn/openvpn.conf

Health Monitor
Logs: /usr/local/psa/admin/logs/health-alarm.log

service control:
Stop: /etc/init.d/sw-collectd stop
Start: /etc/init.d/sw-collectd start
Restart: /etc/init.d/sw-collectd restart

config files:
/usr/local/psa/admin/conf/health-config.xml
/usr/local/psa/var/custom-health-config.xml
/etc/sw-collectd/collectd.conf

Parallels Panel Health Monitor Notification Daemon
Logs: /usr/local/psa/admin/logs/health-alarm.log

service control:
Stop: /etc/init.d/psa-health-monitor-notificationd stop
Start: /etc/init.d/psa-health-monitor-notificationd start
Restart: /etc/init.d/psa-health-monitor-notificationd restart

config files:
/usr/local/psa/admin/conf/health-config.xml
/usr/local/psa/var/custom-health-config.xml

Web server (Apache)
Access and Error logs: /var/log/httpd/
Plesk domains logs: /var/www/vhosts/%d/statistics/logs/

service control:
Stop: /etc/init.d/httpd stop
Start: /etc/init.d/httpd start
Restart: /etc/init.d/httpd restart

config files:
/etc/httpd/conf/httpd.conf
/etc/httpd/conf.d/
/usr/local/psa/admin/conf/ip_vhosts_bootstrap.conf
/usr/local/psa/admin/conf/vhosts_bootstrap.conf
/usr/local/psa/admin/conf/webmail_atmail_bootstrap.conf
/usr/local/psa/admin/conf/webmail_atmailcom_bootstrap.conf
/usr/local/psa/admin/conf/webmail_horde_bootstrap.conf

Generated config files:
/usr/local/psa/admin/conf/generated/_server.include
/var/www/vhosts//conf/_httpd.include
/usr/local/psa/admin/conf/generated/_horde.include
/usr/local/psa/admin/conf/generated/_atmail.include
/usr/local/psa/admin/conf/generated/_atmailcom.include
/usr/local/psa/admin/conf/generated/__webmail.include
—————————————————>
Reference : http://kb.parallels.com/en/111283

How to install tomcat 5 on cPanel server and upgarde to 7

1

Tomcat Installation on cPanel server.

To install Tomcat, select the Tomcat option in WHM’s EasyApache (Apache Update) or using
“/scripts/easyapache” (without the quotes) in command line. The Tomcat selection is found in
Step 5’s Apache Options area.

It will install Tomcat 5.5.35 on the server.
Steps to upgrade Tomcat to version 7.0.32 are given below.

1) The Tomcat 5 is installed in /usr/local/jakarta/ directory with the symbolic link tomcat. For
example:

[~]# ll /usr/local/jakarta
drwxr-xr-x 4 tomcat nobody 4096 Apr 5 17:15 ./
drwxr-xr-x 22 root root 4096 Mar 5 15:39 ../
drwxr-xr-x 12 tomcat nobody 4096 Apr 4 17:02 apache-tomcat-5.5.35/
lrwxrwxrwx 1 tomcat nobody 39 Apr 4 17:04 tomcat -> /usr/local/jakarta/apache-tomcat-5.5.35/

2) Then download and extract Tomcat 7 in /usr/local/jakarta directory
[~]# cd /usr/local/jakarta
[/usr/local/jakarta]# wget http://apache.techartifact.com/mirror/tomcat/tomcat-7/v7.0.32/bin/apache-tomcat-7.0.32.tar.gz
[/usr/local/jakarta]# tar -xzvf apache-tomcat-7.0.32.tar.gz
[/usr/local/jakarta]# chown -R tomcat.nobody apache-tomcat-7.0.32/

3) Then Change the tomcat symbolic link to point to your new version (i.e.
/usr/local/jakarta/apache-tomcat-7.0.32)
[/usr/local/jakarta]# rm -rf tomcat
[/usr/local/jakarta]# ln -s /usr/local/jakarta/apache-tomcat-7.0.32 tomcat
[/usr/local/jakarta]# chown -h tomcat.nobody tomcat

4) Then compile the new Tomcat version on cPanel server.
[~]# cd /usr/local/jakarta/apache-tomcat-7.0.32
[/usr/local/jakarta/apache-tomcat-7.0.32]# cd ./bin
[/usr/local/jakarta/apache-tomcat-7.0.32/bin]# tar xvfz commons-daemon-native.tar.gz
[/usr/local/jakarta/apache-tomcat-7.0.32/bin]# cd commons-daemon-1.0.10-native-src/unix
[/usr/local/jakarta/apache-tomcat-7.0.32/bin/commons-daemon-1.0.10-native-src/unix]
[~]# ./configure
[~]# make
[~]# cp jsvc ../..
[~]# cd ../../..

5) Copy over any Host blocks from /usr/local/jakarta/tomcat/conf/server.xml from the old Tomcat install to the new Tomcat install (you may or may not be able to set up new hosts through WHM).

6) Copy over /usr/local/jakarta/tomcat/conf/workers.properties from the old Tomcat install to the new Tomcat install.

7) To use the web administration gui you have to add the gui role in
/usr/local/jakarta/apache-tomcat-7.0.32/conf/tomcat-users.xml file.

You may copy and paste the above code into the tomcat-users.xml file and change the “name”
and “pwd” fields accordingly.

[/usr/local/jakarta/apache-tomcat-7.0.32/conf]#ls -l
-rw——- 1 tomcat nobody 6818 Oct 11 02:04 server.xml
-rw——- 1 tomcat nobody 1734 Oct 9 13:10 tomcat-users.xml
-rw——- 1 tomcat nobody 5563 Oct 9 12:25 workers.properties

8) Restart the server
[/]# reboot
Or
[/]# /usr/local/jakarta/tomcat/bin/shutdown.sh
[/]# /usr/local/jakarta/tomcat/bin/startup.sh
[/]# /etc/init.d/httpd restar
t

9) Check Tomcat Version
[/]# sh /usr/local/jakarta/tomcat/bin/version.sh

The cPanel EasyApache system makes it easy to recompile Apache with various add-ons and modules.

If you ever need your old Tomcat back just stop Tomcat, flip the tomcat symbolic link back to the old install, and restart Tomcat.
===========================================================>

How to disable Dr.Web Notification mail from Plesk

0

Disable Dr.Web Notification mail:

Edit the file /etc/drweb/drweb_handler.conf as shown below to stop Parallels Premium Antivirus from sending notification messages:

[VirusNotifications]
SenderNotify = no
AdminNotify = no
RcptsNotify = no

Edit the file /etc/drweb/drweb32.ini

CronSummary no

Restart Dr. Web :
/etc/init.d/drwebd restart
==================================================>
Reference: http://kb.parallels.com/article_122_1685_en.html

Install LiteSpeed Web Server on Centos

83

LiteSpeed Web Server

LiteSpeed Web Server is the leading high-performance, high-scalability web server. It is completely Apache interchangeable so LiteSpeed Web Server can quickly replace a major bottleneck in your existing web delivery platform. With its comprehensive range of features and easy-to-use web administration console, LiteSpeed Web Server can help you conquer the challenges of deploying an effective web serving architecture.

LiteSpeed Web Server has superior performance in terms of both raw speed and scalability. Our benchmarks demonstrate that it is more than 6 times faster than Apache. When serving static content, LiteSpeed surpasses well-respected content accelerators including thttpd, boa and TUX. When it comes to dynamic content, LiteSpeed is more than 50% faster in PHP content delivery than Apache with mod_php. Don’t just take our word for it. Download the LiteSpeed free or trial version and experience it for yourself.

Install atomic repository, it will install latest package.
[# wget -q -O – http://www.atomicorp.com/installers/atomic | sh

yum –y install libxml2-devel openssl-devel bzip2-devel curl-devel db4-devel libjpeg-devel libpng-devel libXpm-devel freetype freetype-devel gmp-devel libc-client-devel openldap-devel libmcrypt-devel libmhash-devel freetds-devel libz-devel mysql-devel ncurses-devel pcre-devel unixODBC-devel postgresql-devel sqlite-devel aspell-devel readline-devel recode-devel net-snmp-devel libtidy-devel libxslt-devel t1lib-devel

yum -y remove httpd php mysql

Install the latest version modules using “yum” / otherwise you can install it from source.

cd /usr/src/
wget ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.11.tar.gz
tar -zxvf gnupg-1.4.11.tar.gz
cd gnupg-1.4.11
./configure
make
make install
cd..

wget http://ftp.gnu.org/gnu/libidn/libidn-1.9.tar.gz
tar -zxvf libidn-1.9.tar.gz
cd libidn-1.9
./configure
make
make install
ln -s /usr/local/lib/libidn* /usr/lib
cd..

wget http://curl.haxx.se/download/curl-7.21.4.tar.gz
tar -zxvf curl-7.21.4.tar.gz
cd curl-7.21.4
[# ./configure –with-openssl –with-libidn –enable-ipv6
make
make install
ln -s /usr/local/lib/libcurl* /usr/lib
cd..

wget ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz
tar -zxvf libxml2-2.7.8.tar.gz
cd libxml2-2.7.8
./configure
make
make install
rm -rf /usr/lib/libxml2*
ln -s /usr/local/lib/libxml2* /usr/lib
cd..

wget ftp://xmlsoft.org/libxml2/libxslt-1.1.26.tar.gz
tar -zxvf libxslt-1.1.26.tar.gz
cd libxslt-1.1.26
./configure
make
make install
rm -rf /usr/lib/libxslt* /usr/lib/libexslt*
ln -s /usr/local/lib/libxslt* /usr/lib
ln -s /usr/local/lib/libexslt* /usr/lib
cd..

Install MySQL

yum install mysql
yum install mysql-server
yum install mysql-client
yum install mysql-embedded
yum install mysql-shared
yum install mysql-libs

MySQL configuration

There are 5 default MySQL configuration:

my-small.cnf
choose one of those configurations depending on your needs, move to “/etc/” directory and rename it to “my.cnf”.

cp /usr/share/mysql/my-small.cnf /etc/my.cnf

vim /etc/my.cnf
add the following lines to “[mysqld]” section

default-storage-engine=MyISAM
skip-innodb

Now start MySQL, create system tables.

/etc/init.d/mysqld start
/usr/bin/mysql_install_db
mysql_secure_installation
/etc/init.d/mysqld stop
chkconfig –add mysqld
chkconfig mysqld on

Install LiteSpeed

wget http://www.litespeedtech.com/packages/4.0/lsws-4.0.20-std-i386-linux.tar.gz
tar -zxvf lsws-4.0.20-std-i386-linux.tar.gz
cd lsws-4.0.20
chmod +x install.sh
./install.sh

Do you agree with above license: Yes
Destination: /usr/local/lsws (my preferred LiteSpeed directory)
Username: your preferred username for administration panel
Password: your preferred password for administration panel
Email addresses: your email address
User: nobody
Group: nobody
HTTP port: 80
Admin HTTP port: choose any port above 2000
Setup PHP: Y
Suffix for PHP script: php
Install AWStats Add-on modul: N
LiteSpeed restart automatically when server restarts: Y
Would you like to start it now: Y

Compiling PHP 5.3.5 with required modules

Login to your LiteSpeed administration panel
– Open: http://yourip:youradminport
– Go to Action – Compile PHP, select PHP 5.3.5 and push next button
Extra PATH environment: Leave this empty
Install Path Prefix: /usr/local/lsws/lsphp5
Configure Parameters:

[# –prefix=/lsphp5 –with-litespeed –enable-cli –with-mcrypt –enable-mbstring –with-openssl –with-mysql=/usr/bin –with-mysqli –with-mysql-sock=/var/lib/mysql/mysql.sock –with-pdo-mysql –with-gd –with-zlib –with-sqlite –enable-pdo –with-libdir=lib –with-xpm-dir=/usr/lib –with-freetype-dir=/usr/include/freetype2 –with-ttf=/usr/include/freetype2 –libdir=/usr/lib –enable-gd-native-ttf –enable-fileinfo –with-bz2 –with-curl –with-curlwrappers –with-gettext –with-pcre-regex –with-imap –with-imap-ssl=/usr/lib –enable-exif –enable-ftp –enable-magic-quotes –enable-sockets –enable-ucd-snmp-hack –enable-memory-limit –enable-dbx –with-mime-magic –enable-soap –enable-zip –with-mhash –enable-mbregex

Add-on Modules: Check only XCache or eAccelerator for PHP Opcode Cacher module, we will install Suhosin extension later.
– Push build button and wait until configure process has finished or check the status until**PREPARE_DONE**
– After finished, click next button and run the following command from your ssh (root)

/usr/local/lsws/phpbuild/buildphp_manual_run.sh
wait about 5 – 10 minutes until the process finished (it will shown **COMPLETE** status)
– Apply changes and Graceful restart

Check your PHP installation status
# /usr/local/lsws/fcgi-bin/lsphp5 -v
PHP 5.3.5 (litespeed) (built: Dec 8 2012 15:08:51)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Install IonCube Loader
# wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
# tar -xvf ioncube_loaders_lin_x86.tar.gz
# mv ioncube/ioncube_loader_lin_5.3.so /usr/lib/extensions/no-debug-non-zts-20090626/

Install Suhosin Extension

# wget http://download.suhosin.org/suhosin-0.9.32.1.tar.gz
# tar -zxvf suhosin-0.9.32.1.tar.gz
# cd suhosin-0.9.32.1
[# /usr/local/lsws/lsphp5/bin/phpize
#./configure –enable-suhosin –with-php-config=/usr/local/lsws/lsphp5/bin/php-config
# make
# make install

Copy php.ini to lib directory
# cp /usr/local/lsws/php/php.ini /usr/lib
declare the installed extensions to php.ini (IonCube, eAccelerator, Suhosin)

vim /usr/lib/php.ini

zend_extension=”/usr/lib/extensions/no-debug-non-zts-20090626/ioncube_loader_lin_5.3.so”
zend_extension=”/usr/lib/extensions/no-debug-non-zts-20090626/xcache.so”
extension=”/usr/lib/extensions/no-debug-non-zts-20090626/suhosin.so”

Restart LiteSpeed
/usr/local/lsws/bin/lswsctrl restart

check PHP 5.3.5 and other modules
# /usr/local/lsws/fcgi-bin/lsphp5 -v
PHP 5.3.5 (litespeed) (built: Dec 8 2012 15:08:51)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and
with XCache v1.3.1, Copyright (c) 2005-2010, by mOo
with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

Now let’s create and configure Virtual Host.

Install PureFTPD
# wget http://download.pureftpd.org/pure-ftpd/releases/pure-ftpd-1.0.30.tar.gz
# tar -xvf pure-ftpd-1.0.30.tar.gz
# cd pure-ftpd-1.0.30
# ./configure
# make install-strip
# echo “/usr/local/sbin/pure-ftpd &” >> /etc/rc.d/rc.local

start PureFTPD
/usr/local/sbin/pure-ftpd &

Create domain root directory
useradd domain.com
passwd domain.com
mkdir /home/domain.com/public_html /home/domain.com/cgi-bin /home/domain.com/logs
chown -R domain.com:domain.com /home/domain.com

Configure domain virtual host

– Open: http://yourip:youradminport
– Go to Configuration – Virtual Host Templates, choose PHP_SuEXEC (i prefer phpsuexec)
– Go to General tab and edit Template Settings
Virtual Host Root: /home/$VH_NAME/
Config File: $SERVER_ROOT/conf/$VH_NAME.xml
Max Keep-Alive Requests: leave this empty
Smart Keep-Alive: Yes
Document Root: $VH_ROOT/public_html/
Enable GZIP Compression: Yes
Enable IP GeoLocation: Not Set
Administrator Email: your email
– Save and Graceful Restart
Add domain
– Go to Configuration – Virtual Host Templates, choose PHP_SuEXEC
– Go to Template tab and add Member Virtual Hosts
Virtual Host Name: domain.com
Domain: domain.com
Aliases: domain.com
Virtual Host Root: /home/domain.com/
– Save and Graceful Restart

*you might get the following error:
Input error detected. Please resolve the error(s).
*path /home/domain.com/ is not readable

Solution:
chmod 755 -R /home/domain.com

Now create phpinfo.php
Vim /home/domain/public_html/phpinfo.php
======================================================================>
Reference:
http://www.litespeedtech.com
http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:php:lsapi:troubleshoot

Install Suhosin PHP 5 Protection Security Patch

1

WordPress and many other open source application developers asks users to protect PHP apps using Suhosin patch to get protection from the full exploit. Suhosin is an advanced protection system for PHP installations. It was designed to protect your servers from various attacks. How do I install Suhosin under RHEL / CentOS / Fedora Linux?
A. Suhosin was designed to protect your servers against a number of well known problems in PHP applications and on the other hand against potential unknown vulnerabilities within these applications or the PHP core itself including wordpress and many other open source php based apps.

Install Suhosin as extension

Download latest version of Suhosin, enter:
# cd /opt
# wget http://download.suhosin.org/suhosin-0.9.27.tgz
Make sure you have php-devel installed:
# yum install php-devel
Compile Suhosin under PHP 5 and RHEL / CentOS Linux
Type the following commands:
# cd suhosin-0.9.27
# phpize
#./configure
# make
# make install
Configure Suhosin
Type the following command to create Suhosin configuration file:
# echo ‘extension=suhosin.so’ > /etc/php.d/suhosin.ini

Restart web server
# service httpd restart
If you are using lighttpd, enter:
# service lighttpd restart

Verify Suhosin installation
$ php -v
Sample output:
PHP 5.1.6 (cli) (built: Jun 12 2008 05:02:36)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with XCache v1.2.2, Copyright (c) 2005-2007, by mOo
with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH

You can find more information by running phpinfo():
=================================================================>

How to Install Memcache into cPanel Server.

0

Memcache module provides handy procedural and object oriented interface to memcached, highly effective caching daemon, which was especially designed to decrease database load in dynamic web applications.

Make the Sources Folder
mkdir ~/memcache

Compile and Install LibEvent

cd ~/memcache
wget http://www.monkey.org/~provos/libevent-1.4.9-stable.tar.gz
tar xvfz libevent-1.4.9-stable.tar.gz
cd libevent-1.4.9-stable
./configure
make
make install

Compile and Install Memcache

cd ~/memcache
wget http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gz
tar xvfz memcached-1.2.6.tar.gz
cd memcached-1.2.6
./configure –with-lib-event=/usr/local/
make
make install

Starting Memcache
memcached

If you get the following error then you may beed to register libevent:
error while loading shared libraries: libevent-1.4.so.2: cannot open shared object file: No such file or directory

Register LibEvent

vi /etc/ld.so.conf.d/libevent-i386.conf
Open above file and put the line /usr/local/lib/ and save the file and fire below command.
ldconfig

Installing PHP Memcache

cd ~/memcache
wget http://pecl.php.net/get/memcache-3.0.3.tgz
tar xvfz memcache-3.0.3.tgz
cd memcache-3.0.3
phpize
./configure
make
make install

Add extension on php.ini

vi /usr/local/lib/php.ini
extension=memcache.so

Then restart the Apache service.
service httpd restart

=============================================>
Reference : http://php.net/manual/en/book.memcache.php
Reference : http://www.memcached.org/

How to Upgrade from VZ 4.0 to VZ 4.6

0

Upgrading from VZ 4.0 to VZ 4.6

If your server already has VZ 4.0, it’s very easy to upgrade to 4.6. You pretty much don’t have a choice because if you have other servers running 4.6, you won’t be able to move containers back and forth, and you won’t have many new kernel updates headed your way.

Note: This procedure is only for VZ 4.0 servers. If you run a previous version, you need to re-OS and reinstall VZ. You can’t upgrade to 4.6 from previous vesions!

1. Migrate all your containers off the server

If this is a live server, you’ll want to move off all your customers to avoid lengthy downtime. If you plan on moving them back, you can speed up the reverse process by moving off the containers and retaining their private areas

for ve in `vzlist -H -o veid,diskspace |sort -rnk2 |awk ‘{print $1}’` ; do vzmigrate -r no 192.168.x.x $ve ; done

2. Run a Yum update
Take this opportunity to update your operating system, noting that Virtuozzo already has an exclude file (/etc/yum/swsoft-excludes) to prevent the updates of certain packages.
yum update -y

3) install VZ 4.6
cd /root
wget http://download.parallels.com/pvc/46/lin/rtm/vzinstall-linux-x86_64.bin
chmod 755 vzinstall-linux-x86_64.bin
./vzinstall-linux-x86_64.bin

4) Run the self update
After the installation, run vzup2date twice (one is a self-update, the other is the kernel update)

5) reboot
6) Reapply customizations

If you had any customizations to VZ scripts (such as files in /etc/sysconfig/vz-script), you may need to re-apply them

7) Re-populate the server
Start migrations back to the server, which will take a fraction of the time since the private areas were retained:

for ve in `vzlist -H -o veid,diskspace |sort -rnk2 |awk ‘{print $1}’` ; do vzmigrate -r yes 192.168.x.x $ve; done
===============================================>