Tag-Archive for » cPanel server «

Friday, October 17th, 2008 | Author: Angelo

What is Xcache ? :: Xcache help to accelerates the performance of PHP on servers. It optimizes performance by excluding compilation time of PHP scripts by caching the compiled state of PHP scripts into the RAM and uses the compiled version directly from the RAM. Which help to increase the rate of page generation time by up to 5 times as it also optimizes many other aspects of php scripts and help to reduce serverload.

Installing Xache module:

XCache is a fast, stable PHP opcode cacher that has been tested on linux server and running under high load.
XCache 1.2.1 is release is compatible with apache1/ZendOptimizer/ZendCore compatibility. This version support only support 4.3.x 4.4.x 5.1.x and 5.2.x but does not support the PHP 5.0.x series, also note Xcache is not compatible with IONCUBE.

Installation:
[root@linuxserver ~]# wget http://xcache.lighttpd.net/pub/Releases/1.2.1/xcache-1.2.1.tar.gz
[root@linuxserver ~]# tar -xzf xcache-1.2.1.tar.gz
[root@linuxserver ~]# cd xcache-1.2.1
[root@linuxserver ~]# phpize
[root@linuxserver ~]# ./configure –enable-xcache –enable-xcache-optimizer
[root@linuxserver ~]# make
[root@linuxserver ~]# make install

Adding extensions and configuring xcache in php.ini you can find location of php.ini file by following command
[root@linuxserver ~]# php -i | grep php.ini
Now edit php.ini file.
Under ? extension_dir = "/usr/local/lib/php/extensions/no-debug-non-zts-20060613" line add following parameter to enable xcache.

extension = xcache.so

[xcache.admin]
; Change xcache.admin.user to your preferred login name
xcache.admin.user = "admin" ? no need to add system user.

; Change xcache.admin.pass to the MD5 fingerprint of your password
; Use md5 -s "your_secret_password" to find the fingerprint
xcache.admin.pass = "cd959ac3debe8f587546a3fa353b3268" ? Password in MD5(op3nsesam3)

[xcache]
; Change xcache.size to tune the size of the opcode cache
xcache.size = 128M
xcache.shm_scheme = "mmap"
xcache.count = 2
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0

; Change xcache.var_size to adjust the size of variable cache
xcache.var_size = 8M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = On
xcache.mmap_path = "/tmp/xcache"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = On

[xcache.coverager]
xcache.coverager = On
xcache.coveragedump_directory = ""

save and quit.

Restart httpd service.

Now from xcache source copy the "admin" directory to your htdocs from where you can manage the xache.
http://server-ip/admin/

Thursday, October 02nd, 2008 | Author: Angelo

Using mod_layout you can create a single look for your site by placing information at both the beginning and the end of a document (header and footer). It is useful for adding banners at the top or end of all web pages. Also if wish you can insert layouts in documents at any place dynamically.

Below are the steps to install mod_layout on your cPanel server.

Download tar file for installtion

A. wget http://www.tangent.org/download/mod_layout-3.2.1.tar.gz
B. tar xvfz mod_layout-3.2.tar.gz
C. cd mod_layout-3.2
D. vi Makefile
and find following
# the used tools
APXS=apxs
APACHECTL=apachectl
CC=`apxs -q CC`
INC=-I`apxs -q INCLUDEDIR` `$(APXS) -q CFLAGS` #-DLAYOUT_FILEOWNER_NAME
LD_SHLIB=`apxs -q LDFLAGS_SHLIB`

Replace the values with the following details :

# the used tools
APXS=/usr/local/apache/bin/apxs
APACHECTL=apachectl
CC=`/usr/local/apache/bin/apxs -q CC`
INC=-I`/usr/local/apache/bin/apxs -q INCLUDEDIR` `$(APXS) -q CFLAGS` #-DLAYOUT_FILEOWNER_NAME
LD_SHLIB=`/usr/local/apache/bin/apxs -q LDFLAGS_SHLIB`
save the file Makefile and then

E. make
F. make install
G. edit httpd.conf
And added LayoutHeader and LayoutFooter Directive as below.

<Virtualhost www.domainname.com>
LayoutHeader “<P> This is the beginning of things<P>”
LayoutFooter “<P> This is the tail end of things<P>”
</virtualhost>

You are done….

Thursday, October 02nd, 2008 | Author: Angelo

Hello,

Below are the tricks to secure mysql service on your cpanel server.

A. Change MySQL Default port :: Suppose if you want to configure mysql on port 5123 then edit my.cnf and configure 5123 as given below

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
port=5123

B. Restrict access to MySQL service for specific ips :: Add remote server ip in cPanel >> Mysql >> Access host

C. Encrypt the information transferred between them :: Configure secured port for mysql you can configure it as 5124 in the file stunnel.conf but make sure this file should be exist on both servers (your server and remote server to which you wish to give access).