溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

安裝xcache

發(fā)布時(shí)間:2020-07-01 13:33:13 來(lái)源:網(wǎng)絡(luò) 閱讀:2910 作者:wxdzyylp 欄目:網(wǎng)絡(luò)安全

前提phpphp-fpm、mariadbLAMP環(huán)境已經(jīng)架設(shè)好

 

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/bin/phpize #用phpize生成configure配置文件---------這里的目錄,用which phpize來(lái)找

 

[root@lgq bin]# ln -sv phpize /usr/src/xcache-3.2.0

‘/usr/src/xcache-3.2.0/phpize’ -> ‘phpize

[root@lgq xcache-3.2.0]# phpize

Configuring for:

PHP Api Version:         20100412

Zend Module Api No:      20100525

Zend Extension Api No:   220100525

 

[root@lgq xcache-3.2.0]#./configure --enable-xcache--enable-xcache-coverager --enable-xcache-optimizer --with-php-config=/usr/bin/php-config #配置

 

make #編譯

make install #安裝

安裝完成之后,出現(xiàn)下面的界面,記住以下路徑,后面會(huì)用到。/usr/lib64/php/modules/

/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 #記住類(lèi)似下面一行代碼(md5加密之后的密碼),后面會(huì)用到

c1820eeffb72ef4463aa2a67c65c7b0a

4、拷貝xcache后臺(tái)管理程序到網(wǎng)站根目錄

cp -r /usr/local/src/xcache-3.2.0/htdocs  /var/www/html/xcache

chown apache.apache -R /var/www/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 = "c1820eeffb72ef4463aa2a67c65c7b0a"

[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、測(cè)試

service php-fpm restart#重啟php-fpm

service nginx restart #重啟nginx

瀏覽器打開(kāi)網(wǎng)站根目錄下面的xcache

輸入用戶(hù)名xcache 密碼123456

可以看到如下界面

安裝xcache

 

Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/xcache/cacher/index.phpon line 126Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/xcache/cacher/index.php on line 126

 

是因?yàn)闀r(shí)區(qū)的問(wèn)題引起的

vim /etc/php.ini 去掉date.timezone前面的;號(hào),后面上 Asia/Shanghai,就不會(huì)再提示錯(cuò)誤信息了

date.timezone =Asia/Shanghai


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI