http://www.ioncube.com/loaders.php
uname -a 查看linux服务器是32 还是64位的。
下载对应的版本,我这里是vps cnetos5.8 32
wget -c http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
tar zxvf ioncube_loaders_lin_x86.tar.gz

Site error: the file /home/wwwroot/whmcs/index.php requires the ionCube PHP Loader ioncube_loader_lin_5.3.so to be installed by the website operator. If you are the website operator please use the ionCube Loader Wizard to assist with installation.

根据提示 选用对应版本的文件。

mv ioncube /usr/local/php/lib/php/extensions/

编辑php.ini

加入

;ionCube
[ionCube Loader]
zend_extension=/usr/local/php/lib/php/extensions/ioncube/ioncube_loader_lin_5.3.so

 

重启 php

 

 

 

 

libevent-2.0.20-stable.tar.gz (http://monkey.org/~provos/libevent/)

memcache-2.2.3.tgz (http://pecl.php.net/package/memcache)

memcached-1.4.15.tar.gz (http://www.danga.com/memcached/)

wget https://github.com/downloads/libevent/libevent/libevent-2.0.20-stable.tar.gz
tar zxvf libevent-2.0.20-stable.tar.gz
cd libevent-2.0.20-stable
./configure --prefix=/usr
make && make install
ls -al /usr/lib | grep libevent
cd ..
wget http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz
tar zxvf memcached-1.4.15.tar.gz
cd memcached-1.4.15
./configure --with-libevent=/usr
make && make install

/usr/local/bin/memcached -d -m 128 -u root -l 127.0.0.1 -p 11211 -c 128 -P /tmp/memcached.pid

-d选项是启动一个守护进程,
-m是分配给Memcache使用的内存数量,单位是MB,我这里是128MB,按照你服务器的可提供内存数来设定,
-u是运行Memcache的用户,我这里是root,
-l是监听的服务器IP地址,如果有多个地址的话,我这里指定了服务器的IP地址127.0.0.1,
-p是设置Memcache监听的端口,我这里设置了11211,最好是1024以上的端口,
-c选项是最大运行的并发连接数,默认是1024,我这里设置了128,按照你服务器的负载量来设定,
-P是设置保存Memcache的pid文件,我这里是保存在 /tmp/memcached.pid

# The following options will be passed to all MySQL clients
[client]
#password    = your_password
character-set-server = utf8
port        = 3306
socket        = /tmp/mysql.sock
 
# The MySQL server
[mysqld]
#user    = mysql
port        = 3306
socket        = /tmp/mysql.sock
basedir = /usr/local/mysql
datadir = /home/mysql/data
#启用错误日志
#log-error = mysql-bin.err
log-error = /home/mysql/mysql_error.log
pid-file = /home/mysql/mysql.pid
open_files_limit    = 10240
back_log = 600
#全局最大并发
max_connections = 5000
#单账户最大并发
max_user_connections=3000
max_connect_errors = 6000
table_cache = 614
external-locking = FALSE
#skip-external-locking
max_allowed_packet = 32M
sort_buffer_size = 1M
join_buffer_size = 1M
thread_cache_size = 300
#thread_concurrency = 8
query_cache_size = 512M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
default-storage-engine = MyISAM
thread_stack = 192K
transaction_isolation = READ-COMMITTED
tmp_table_size = 246M
max_heap_table_size = 246M
long_query_time = 3
log-slave-updates
binlog_cache_size = 4M
#启用二进制日志
#log-bin = mysql-bin
log-bin = /home/mysql/binlog/mysql-bin
# 二进制格式日志三种类型 Mixed,Statement,Row
#binlog_format = “STATEMENT”
#binlog_format = “ROW”
binlog_format = MIXED
max_binlog_cache_size = 8M
max_binlog_size = 1G
relay-log-index = /home/mysql/relaylog/relaylog
relay-log-info-file = /home/mysql/relaylog/relaylog
relay-log = /home/mysql/relaylog/relaylog
expire_logs_days = 30
key_buffer_size = 256M
read_buffer_size = 1M
read_rnd_buffer_size = 16M
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover
 
log-slow-queries = /home/mysql/slow.log
long_query_time = 5
 
 
interactive_timeout = 120
wait_timeout = 120
 
#replicate-ignore-db = mysql
replicate-ignore-db = test
replicate-ignore-db = information_schema
 
#设置服务器id
server-id = 2
#复制所有库除了
#binlog_ignore_db = mysql,test
#仅复制
#binlog_do_db = mysql,test
 
skip-name-resolve
#master-connect-retry = 10
slave-skip-errors = 1032,1062,126,1114,1146,1048,1396
 
#master-host     =   192.168.1.2
#master-user     =   username
#master-password =   password
#master-port     =  3306
 
 
 
# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/var
#innodb_data_file_path = ibdata1:256M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/var
# You can set .._buffer_pool_size up to 50 – 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 512M
#innodb_additional_mem_pool_size = 16M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 126M
#innodb_log_buffer_size = 16M
#innodb_flush_log_at_trx_commit = 2
#innodb_lock_wait_timeout = 120
 
#innodb_file_io_threads = 4
#innodb_thread_concurrency = 8
#innodb_log_files_in_group = 3
#innodb_max_dirty_pages_pct = 90
#innodb_file_per_table = 0
 
[mysqldump]
quick
max_allowed_packet = 32M

tar zxvf xcache-2.0.1.tar.gz
cd xcache-2.0.1
phpize
./configure --with-php-config=/usr/local/php/bin/php-config --enable-xcache --enable-xcache-optimizer
make
make install
这步完成后出现的路径请记下来,后面的配置会用到
[root@web2 xcache-2.0.1]# make install
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
[root@web2 xcache-2.0.1]#

算出密码的MD5字串,用于设置管理密码
echo -n "123456" | md5sum

配置php.ini支持XCache
vi /usr/local/php/etc/php.ini

[xcache-common]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/xcache.so
[xcache.admin]
; Change xcache.admin.user to your preferred login name
xcache.admin.user = "admin"
; Change xcache.admin.pass to the MD5 fingerprint of your password
; Use md5 -s "your_secret_password" to find the fingerprint
xcache.admin.pass = "e10adc3949ba59abbe56e057f20f883e"
[xcache]
; Change xcache.size to tune the size of the opcode cache
xcache.size = 24M
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 = Off
[xcache.coverager]
xcache.coverager = On
xcache.coveragedump_directory = ""

重启php-fpm

[root@web2 ]# /etc/init.d/php-fpm restart

Gracefully shutting down php-fpm . done
Starting php-fpm  done
[root@web2 ]#

查看phpinfo显出的信息
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with XCache v2.0.1, Copyright (c) 2005-2012, by mOo
或者用探针查看是否已经支持xcache

更多信息请查看xcache官网~

http://xcache.lighttpd.net/

安装从机rsync
 
yum install rsync

vi /etc/rsyncd.conf 

uid=root
gid=root
max connections=100
use chroot=no
log file=/var/log/rsyncd.log
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsyncd.lock
[tongbu1] #和sersync相关内容对应
path=/home/wwwroot
#uid = root
comment = tongbu1
ignore errors = yes
read only = no
hosts allow = 10.96.0.48
hosts deny = *

 
 
启动服

rsync –daemon
ps -ef | grep rsync