Linux下安裝php加速軟件Xcache的方法
說明:
php安裝目錄:/usr/local/php
php.ini配置文件路徑:/usr/local/php/etc/php.ini
Nginx安裝目錄:/usr/local/nginx
Nginx網(wǎng)站根目錄:/usr/local/nginx/html
1、安裝xcache
cd /usr/local/src #進(jìn)入軟件包存放目錄
wget http://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz #下載
tar zxvf xcache-3.2.0.tar.gz #解壓
cd xcache-3.2.0 #進(jìn)入安裝目錄
/usr/local/php/bin/phpize #用phpize生成configure配置文件
./configure --enable-xcache--enable-xcache-coverager --enable-xcache-optimizer --with-php-config=/usr/local/php/bin/php-config #配置
make #編譯
make install #安裝
安裝完成之后,出現(xiàn)下面的界面,記住以下路徑,后面會用到。
/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/ #xcache模塊路徑
2、創(chuàng)建xcache緩存文件
touch /tmp/xcache #創(chuàng)建文件
chmod 777 /tmp/xcache #設(shè)置權(quán)限
3、創(chuàng)建xcache管理員密碼為123456
echo -n "123456" | md5sum #記住類似下面一行代碼(md5加密之后的密碼),后面會用到
e10adc3949ba59abbe56e057f20f883e
4、拷貝xcache后臺管理程序到網(wǎng)站根目錄
cp -r /usr/local/src/xcache-3.2.0/htdocs /usr/local/nginx/html/xcache
chown www.www -R /usr/local/nginx/html/xcache #設(shè)置xcache目錄和網(wǎng)站目錄權(quán)限相同
5、配置php支持xcache
vi /usr/local/php/etc/php.ini #編輯配置文件,在最后一行添加以下內(nèi)容
[xcache-common]
extension = xcache.so
[xcache.admin]
xcache.admin.enable_auth = On
xcache.admin.user = "xcache"
xcache.admin.pass = "e10adc3949ba59abbe56e057f20f883e"
[xcache]
xcache.shm_scheme ="mmap"
xcache.size=60M
xcache.count =1
xcache.slots =8K
xcache.ttl=0
xcache.gc_interval =0
xcache.var_size=64M
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 =""
:wq! #保存退出
6、測試
service php-fpm restart #重啟php-fpm
service nginx restart #重啟nginx
瀏覽器打開網(wǎng)站根目錄下面的xcache
輸入用戶名xcache 密碼123456
可以看到如下界面
相關(guān)文章
FOXHIS PMS前臺西軟服務(wù)器端和客戶端安裝教程
網(wǎng)上有很多關(guān)于西軟FOXHIS PMS的安裝教程,但大多沒有詳細(xì)描述并且內(nèi)容非常膚淺粗燥,本特意把自己的安裝過程寫成文檔并記下,后面的數(shù)據(jù)庫操作沒有提供圖片,但是我相信絕對能夠看得懂2017-01-01You don’t have permission to access /index.php on.
運(yùn)行php時提示You don't have permission to access /index.php on.錯誤的解決方法,需要的朋友可以參考下2013-02-02使用iptable和Firewalld工具來管理Linux防火墻連接規(guī)則
今天小編就為大家分享一篇關(guān)于使用iptable和Firewalld工具來管理Linux防火墻連接規(guī)則的文章,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧2018-09-09詳解Centos7.2安裝Nginx實現(xiàn)負(fù)載平衡
本篇文章主要介紹了詳解Centos7.2安裝Nginx實現(xiàn)負(fù)載平衡,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-03-03Linux下模擬http的get/post請求(curl or wget)詳解
這篇文章主要介紹了Linux下模擬http的get/post請求(curl or wget)詳解的相關(guān)資料,需要的朋友可以參考下2017-05-05用DNSPod和Squid打造自己的CDN (六) 編譯并安裝Squid
這篇文章主要介紹centos下編譯并安裝Squid的方法,需要的朋友可以參考下2013-04-04Windows 10 下安裝 Apache 2.4.41的教程
這篇文章主要介紹了Windows 10 下安裝 Apache 2.4.41的教程,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下2020-01-01