添加加速器xcache
|
1
2
3
|
# tar xf xcache-3.0.1.tar.bz2# cd xcache-3.0.1# /usr/local/php/bin/phpize |

编译安装
|
1
2
3
4
|
# ./configure --enable-xcache--with-php-config=/usr/local/php/bin/php-config# make && make install |
安装完成时,会显示图中所示路径

编辑php.ini,整合php和xcache
|
1
2
3
|
# mkdir /etc/php.d# cp xcache.ini /etc/php.d/# vim /etc/php.d/xcache.ini |
更改内容为
|
1
|
extension = /usr/local/php/lib/php/extensions/no-debug-zts-20100525/xcache.so |
配置SSL实现加密连接
|
1
2
3
4
5
6
7
8
9
10
11
12
|
CA端生成密钥,完成自签署# (umask 077; openssl genrsa 2048 > private/cakey.pem)# openssl req -new -x509 -keyprivate/cakey.pem -out cacert.pem# echo 01 > serial#touch index.txt服务器端生成密钥,生成证书请求# mkdir /etc/nginx/ssl -pv# cd /etc/nginx/ssl/# (umask 077; openssl genrsa2048 > nginx.key)# openssl req -new -keynginx.key -out nginx.csrca签署证书# openssl ca -in nginx.csr-out nginx.crt -days 3665 |

修改nginx配置文件
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#HTTPS server # server { listen 443; server_name www.test.com; ssl on; ssl_certificate /etc/nginx/ssl/nginx.crt; ssl_certificate_key /etc/nginx/ssl/nginx.key; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location ~ \.php$ { root /web/bbs; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; include fastcgi_params; } location / { root /web/bbs; index index.php index.htmlindex.htm; }} |
重新启动php-fpm
# service php-fpm restart

验证xcache是否成功添加以及是否可以完成ss加密连

好了,现在LNMP的编译安装就完成了并且实现了基于ssl的连接,大家不妨也试一下
