linux下xcache的安裝

來源:互聯網
上載者:User

標籤:discuz   blog   http   io   ar   檔案   2014   div   art   

建立了一個discuz論壇,後台想開啟記憶體最佳化,參考了各種意見後選擇xcache作為最佳化工具。

折騰了半天才搞定。特此記錄下,方便以後參考。

一、安裝Xcache

# wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz
# tar zxvf xcache-1.3.0.tar.gz
# cd xcache-1.3.0
# /usr/local/php/bin/phpize
# ./configure --enable-xcache --enable-xcache-coverager --enable-xcache-optimizer --with-php-config=/usr/bin/php-config
# make && make install 註:

--enable-xcache 表示啟用Xcache支援;

--enable-xcache-coverager 表示包含用於測量加速器功效的附加特性;

--enable-xcache-optimizer表示啟用作業碼優

  安裝完畢後系統會提示xcache.so模組產生路徑,本次產生路徑為/usr/lib64/php/modules/ 二、組態管理Xcache 1、修改php設定檔 # vi /etc/php.ini 在底部添加如下內容 [xcache-common]

extension = /usr/lib64/php/modules/xcache.so

[xcache.admin]
xcache.admin.enable_auth = On
xcache.admin.user = "admin"
; xcache.admin.pass = md5($your_password)
xcache.admin.pass = "e10adc3949ba59abbe56e057f20f883e"

[xcache]
xcache.shm_scheme = "mmap"
xcache.mmap_path = "/tmp/xcache"
xcache.readonly_protection = Off
xcache.size = 64M
xcache.count = 1
xcache.slots = 8k
xcache.ttl = 3600
xcache.gc_interval = 300
xcache.test = Off
xcache.readonly_protection = On
xcache.coredump_directory =""
xcache.cacher = On
xcache.stat = On
xcache.optimizer =Off
xcache.var_size = 4M
xcache.var_count = 1
xcache.var_slots = 8k
xcache.var_gc_interval = 300
xcache.var_ttl = 0
xcache.var_maxttl = 0

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

 2、產生Xcache快取檔案 # touch /tmp/xcache# chmod 777 /tmp/xcache 3、產生Xcache管理員的秘密(MD5密文) # echo -n "123456" | md5sum e10adc3949ba59abbe56e057f20f883e   然後將上述產生的MD5密文粘貼到php.ini檔案中xcache.admin.pass = ""選項,xcache.admin.pass= "e10adc3949ba59abbe56e057f20f883e" 4、拷貝Xcache管理程式到網站根目錄下 # cp -a xcache-1.3.0/admin/  /usr/local/nginx/html/bbs/ 5、重新讀取php.iniservice spawn-fcgi restart 或者通過php-fpm reload的方式應該也行(沒試過) 最後訪問http://url/admin ,使用者名稱為admin 密碼為123456;另外,還可以通過phpinfo來驗證PHP是否支援Xcache

linux下xcache的安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.