Home > CentOS | PHP | Tips | UNIX > [PHP]CentOSへXCacheをインストールしたメモ。[XCache]

[PHP]CentOSへXCacheをインストールしたメモ。[XCache]

またインストールメモ。今後、サーバーを作る時用の自分用メモばっか書いてますな、最近。
ということで、CentOS5.2XCacheをインストールしました。

  1. phpizeの為に、php-deveをインストール。
    # yum -y install php-devel
  2. Xcacheの取得 && インストール。
    # cd /usr/local/src
    # wget http://xcache.lighttpd.net/pub/Releases/1.2.2/xcache-1.2.2.tar.gz
    # tar zxvf xcache-1.2.2.tar.gz
    # cd xcache-1.2.2
    # phpize
    # ./configure --enable-xcache --enable-xcache-coverager
    # make
    # make test
    # make install
    

    インストール後、表示されるパスをメモしておく。↓みたいな。

    Installing shared extensions: /usr/lib64/php/modules/
    
  3. XCacheのWebインタフェースを公開ディレクトリへコピー。
    # cp -R admin /var/www/html/
    # cp -R coverager /var/www/html/
    # mv /var/www/html/admin /var/www/html/xcache
    
  4. XCacheの設定。
    # mkdir /tmp/pcov
    # chown apache.apache /tmp/pcov ##←Apache実行ユーザーへ
    # cat xcache.ini >> /etc/php.ini
    # cat /proc/cpuinfo | grep -c processor ##←表示された数値をメモ。
    # echo "< ?php echo md5('pass'); ?>" | php ##←表示された文字列をメモ。
    # vi /etc/php.ini
    

    以下、/etc/php.ini のXCache設定内容。

    • zend_extension = インストール後表示されたパスを指定。
    • xcache.count = # cat /proc/cpuinfo | grep -c processor で表示された数値。
    • xcache.admin.user = “hoge” # 適当なユーザーを指定。
    • xcache.admin.pass = # echo “< ?php echo md5('pass'); ?>” | php で表示された文字列。
    [xcache-common]
    ;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
    ;zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
    zend_extension = /usr/lib64/php/modules/xcache.so
    ; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so
    ;; For windows users, replace xcache.so with php_xcache.dll
    ;zend_extension_ts = c:/php/extensions/php_xcache.dll
    ;; or install as extension, make sure your extension_dir setting is correct
    ; extension = xcache.so
    ;; or win32:
    ; extension = php_xcache.dll
    
    [xcache.admin]
    xcache.admin.enable_auth = On
    xcache.admin.user = "hoge"
    ; xcache.admin.pass = md5($your_password)
    xcache.admin.pass = "******************************"
    
    [xcache]
    ; ini only settings, all the values here is default unless explained
    
    ; select low level shm/allocator scheme implemenation
    xcache.shm_scheme =        "mmap"
    ; to disable: xcache.size=0
    ; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
    xcache.size  =                64M
    ; set to cpu count (cat /proc/cpuinfo |grep -c processor)
    xcache.count =                 1
    ; just a hash hints, you can always store count(items) > slots
    xcache.slots =                8K
    ; ttl of the cache item, 0=forever
    xcache.ttl   =                 0
    ; interval of gc scanning expired items, 0=no scan, other values is in seconds
    xcache.gc_interval =           0
    
    ; same as aboves but for variable cache
    xcache.var_size  =            8M
    xcache.var_count =             1
    xcache.var_slots =            8K
    ; default ttl
    xcache.var_ttl   =           600
    xcache.var_maxttl   =       3600
    xcache.var_gc_interval =     300
    
    xcache.test =                Off
    ; N/A for /dev/zero
    xcache.readonly_protection = Off
    ; for *nix, xcache.mmap_path is a file path, not directory.
    ; Use something like "/tmp/xcache" if you want to turn on ReadonlyProtection
    ; 2 group of php won't share the same /tmp/xcache
    ; for win32, xcache.mmap_path=anonymous map name, not file path
    xcache.mmap_path =    "/tmp/xcache"
    
    ; leave it blank(disabled) or "/tmp/phpcore/"
    ; make sure it's writable by php (without checking open_basedir)
    xcache.coredump_directory =   ""
    
    ; per request settings
    xcache.cacher =               On
    xcache.stat   =               On
    xcache.optimizer =           Off
    
    [xcache.coverager]
    ; per request settings
    ; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
    xcache.coverager =          On
    
    ; ini only settings
    ; make sure it's readable (care open_basedir) by coverage viewer script
    ; requires xcache.coverager=On
    xcache.coveragedump_directory = "/tmp/pcov"
    
  5. Apacheを再起動。
    # /etc/rc.d/init.d/httpd restart
  6. /var/www/html/coveragerディレクトリへ.htaccessを設置。↓内容。
    AuthUserFile /etc/httpd/conf/.htpasswd
    AuthGroupFile /dev/null
    AuthName "XCache Coverage Viewer"
    AuthType Basic
    #require valid-user
    require user hoge
    

以上。

Comments:0

add to hatena hatena.comment (0) add to del.icio.us (0) add to livedoor.clip (0) add to Yahoo!Bookmark (0) Total: 0

Comment Form
Remember personal info

Trackbacks:0

Trackback URL for this entry
http://ore.saizensen.net/archives/113/trackback
Listed below are links to weblogs that reference
[PHP]CentOSへXCacheをインストールしたメモ。[XCache] from おれ最前線ねっと

Home > CentOS | PHP | Tips | UNIX > [PHP]CentOSへXCacheをインストールしたメモ。[XCache]

Search
Feeds
Meta

Return to page top