EVO Hosting
  • Economic Hosting
    • Extra Hosting
    • Extreme Hosting
    • Exclusive Hosting
  • Business Hosting
  • VPS Hosting
    • VPS Linux Hosting
    • VPS Windows Hosting
    • VPS SSD Linux Hosting
  • Domain
    • ตรวจสอบโดเมนเนม
    • โดเมนเนม สกุล .th
    • เอกสารสำหรับจดโดเมนเนม .th
    • เอกสารสำหรับย้ายโดเมนเนม .th
  • Co-Location
  • การแจ้งชำระเงิน
    • วิธีการชำระค่าบริการ
    • ชำระเงินผ่านระบบ LINE Pay
    • แจ้งชำระค่าบริการ
    • Contact US
Select Menu
  • Economic Hosting
    • Extra Hosting
    • Extreme Hosting
    • Exclusive Hosting
  • Business Hosting
  • VPS Hosting
    • VPS Linux Hosting
    • VPS Windows Hosting
    • VPS SSD Linux Hosting
  • Domain
    • ตรวจสอบโดเมนเนม
    • โดเมนเนม สกุล .th
    • เอกสารสำหรับจดโดเมนเนม .th
    • เอกสารสำหรับย้ายโดเมนเนม .th
  • Co-Location
  • การแจ้งชำระเงิน
    • วิธีการชำระค่าบริการ
    • ชำระเงินผ่านระบบ LINE Pay
    • แจ้งชำระค่าบริการ
    • Contact US

วิธีติดตั้ง XCache บน Server

Make Difference Make It Easy
You are here:  Home › เรื่องอื่น ๆ › วิธีติดตั้ง XCache บน Server

วิธีติดตั้ง XCache บน Server

Nov 19th, 2013 In : เรื่องอื่น ๆ By : EVOHosting 0 Comments

XCache

Module Cache Opcode ของ PHP โดยปรกติ PHP จะทำงานแบบ Interpreter หรือแปลชุดคำสั่งเป็นภาษาเครื่อง แล้วจึงประมวลผลคำสั่ง และสั่งการทำงาน แต่ XCache จะช่วยแปลคำสั่งให้อยู่ในรูปของ opcode เมื่อมีการเรียกใช้งาน Script ชุดเดิม ก็ไม่ต้องแปลคำสั่งซ้ำอีก ทำให้ PHP สามารถทำงานได้เร็วขึ้น และทำให้ประหยัดทรัพยากร CPU และ Memory (Ram) ของระบบอย่างมาก โดยไม่ต้องประมวลผลภาษา PHP แบบซ้ำ ๆ ช่วยเพิ่มประสิทธิภาพในการโหลดหน้าเว็บได้ดีขึ้น

 

เรามาดูวิธีการติดตั้ง XCaxhe สำหรับ โฮสติ้ง หรือ VPS Hosting กันครับ

1. เลือก ดาวน์โหลด XCache เวอร์ชั่น ล่าสุดได้ที่

http://xcache.lighttpd.net/#Downloads (แนะนำให้เลือก Stable Version เท่านั้น)

# wget http://xcache.lighttpd.net/pub/Releases/3.1.0/xcache-3.1.0.tar.gz

2. ทำการแตกไฟล์ ที่ดาวน์โหลดมา

# tar -xzvf xcache-3.1.0.tar.gz

3. เข้าไปยัง folder ที่แตกไฟล์

# cd xcache-3.1.0

4. ทำการติดตั้ง

phpize
./configure --enable-xcache
make && make install
cat xcache.ini >> /etc/php.ini

5. การปรับแต่ง และตั้งค่า Config XCache

;; this is an example, it won't work unless properly configured into php.ini
[xcache-common] ;; non-Windows example:
extension = /usr/local/lib/php/extensions/no-debug-non-zts-20090626/xcache.so
;; Windows example:
; extension = php_xcache.dll

[xcache.admin] xcache.admin.enable_auth = On
xcache.admin.user = "mOo"
; set xcache.admin.pass = md5($your_password)
; login use $your_password
xcache.admin.pass = ""

[xcache] ; ini only settings, all the values here is default unless explained

; select low level shm 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 = 60M
; 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 = 4M
xcache.var_count = 1
xcache.var_slots = 8K
; default value for $ttl parameter of xcache_*() functions
xcache.var_ttl = 0
; hard limit ttl that cannot be exceed by xcache_*() functions. 0=unlimited
xcache.var_maxttl = 0
xcache.var_gc_interval = 300

; mode:0, const string specified by xcache.var_namespace
; mode:1, $_SERVER[xcache.var_namespace] ; mode:2, uid or gid (specified by xcache.var_namespace)
xcache.var_namespace_mode = 0
xcache.var_namespace = ""

; N/A for /dev/zero
xcache.readonly_protection = Off
; for *nix, xcache.mmap_path is a file path, not directory. (auto create/overwrite)
; Use something like "/tmp/xcache" instead of "/dev/*" if you want to turn on ReadonlyProtection
; different process group of php won't share the same /tmp/xcache
; for win32, xcache.mmap_path=anonymous map name, not file path
xcache.mmap_path = "/dev/zero"
; Useful when XCache crash. leave it blank(disabled) or "/tmp/phpcore/" (writable by php)
xcache.coredump_directory = ""
; Windows only. leave it as 0 (default) until you're told by XCache dev
xcache.coredump_type = 0

; disable cache after crash
xcache.disable_on_crash = Off

; enable experimental documented features for each release if available
xcache.experimental = Off

; per request settings. can ini_set, .htaccess etc
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off

[xcache.coverager] ; enabling this feature will impact performance
; enabled only if xcache.coverager == On && xcache.coveragedump_directory == "non-empty-value"

; per request settings. can ini_set, .htaccess etc
; enable coverage data collecting and xcache_coverager_start/stop/get/clean() functions
xcache.coverager = Off
xcache.coverager_autostart = On

; set in php ini file only
; make sure it's readable (open_basedir is checked) by coverage viewer script
xcache.coveragedump_directory = ""

xcache.size ขนาดของ cache
xcache.count จำนวน Concurrency หรือ จำนวนของ CPU Core
xcache.slots ขนาด slot ในการเก็บ cache

6. เมื่อปรับแต่งค่า Config เรียบร้อยแล้ว ให้ทำการ Restart Service

# service httpd restart

7. ตรวจสอบ Version XCache
# php -v

ปฏิทิน

December 2020
S M T W T F S
 12345
6789101112
13141516171819
20212223242526
2728293031  
« Nov    

คลังความรู้

  • วิธี Upgrade VestaCP php 7.2 November 18, 2019
  • Symbolic Link November 16, 2019
  • วิธีการติดตั้ง CMS June 11, 2019
  • วิธีติดตั้ง fail2ban กับ DirectAdmin April 2, 2019
  • วิธีแก้ไขปัญหา Let’s Encrypt HTTP/1.1 400 Bad Request September 13, 2018
  • การตั้งค่า SSL ให้ Domain Name June 25, 2018
  • วิธีการ rewrite url http to https June 25, 2018
  • วงจรอายุโดเมน Domain Life Cycle June 4, 2018
  • แก้ไข letsencrypt does not match current agreement December 10, 2017
  • เพิ่มประสิทธิภาพให้ ClamAV Anti Malwere สำหรับ PHP December 10, 2017
  • วิธีการใช้งานโปรแกรม WinSCP November 8, 2016
  • วิธีเปลี่ยน Port Remote Desktop July 4, 2016
  • Upgrade clamav June 5, 2016
  • How to yum groupinstall June 5, 2016
  • วิธีแก้ไข หากขอ SSL Let’s encrypt แล้ว Error May 28, 2016
  • วิธีการติดตั้ง Let’s Encrypt automated free SSL certificate April 24, 2016
  • เมนูต่าง ๆ ของ User ใน DirectAdmin (DA) February 24, 2016
  • การขอใบรับรอง (SSL) ของ Let’s Encrypt February 22, 2016
  • การสร้างอีเมลแอคเค้าท์ January 20, 2016
  • การเพิ่มฐานข้อมูล ใน DirectAdmin January 13, 2016
  • การเปลี่ยนชื่อโดเมนเนม ในระบบ DirectAdmin January 13, 2016
  • เพิ่มโดเมนใหม่ ในระบบ DirectAdmin January 13, 2016
  • วิธีติดตั้ง mod_ruid2 November 20, 2014
  • การยืนยันตัวตน ของ ระบบ Domain Name July 23, 2014
  • วิธีติดตั้ง CSF Firewall on CentOS 6 + DirectAdmin July 11, 2014
  • วิธีติดตั้ง XCache บน Server November 19, 2013
  • 5 ขั้นตอน ติดตั้ง DirectAdmin October 9, 2013
  • ความแตกต่างระหว่าง Economic Hosting Plan กับ Business Hosting Plan July 3, 2013
  • 5 เหตุผลที่ไม่ควรใช้ Facebook แทน Website July 3, 2013
  • การติดตั้ง OpenCart June 28, 2013
  • การติดตั้ง Forum SMF June 27, 2013
  • การติดตั้ง WordPress June 25, 2013
  • ยกเลิกการแสดง error ใน php June 25, 2013
  • ขั้นตอนการอัพโหลดไฟล์ผ่านโปรแกรม ftp ขึ้นโฮสติ้ง June 23, 2013
  • RAID คืออะไร June 21, 2013
  • มัลแวร์ กับ โฮสติ้ง (Malware กับ Hosting) June 21, 2013
  • เกี่ยวกับ อีโว โฮสติ้ง June 6, 2013
  • ความหมายของ Web Hosting June 1, 2013
  • รายการฟังก์ชั่นที่มีการยกเลิก ใน PHP 5.3 April 9, 2013
  • การแก้ไข Error Deprecated: Function mysql_db_query() is deprecated April 8, 2013

คลังความรู้

Extra Hosting

Extra Hosting 10
Extra Hosting 20
Extra Hosting 30
Extra Hosting 40
Extra Hosting 50

Extreme Hosting

Extreme Hosting 10
Extreme Hosting 20
Extreme Hosting 30
Extreme Hosting 40
Extreme Hosting 50

Exclusive_Hosting

Exclusive Hosting 10
Exclusive Hosting 20
Exclusive Hosting 30
Exclusive Hosting 40
Exclusive Hosting 50

Business Hosting

Prestige Hosting
Silver Hosting
Gold Hosting
Platinum Hosting
Diamond Hosting

VPS Hosting

TH VPS 10
TH VPS 20
TH VPS 30
TH VPS 40
TH VPS 50

Copyright © 2009 - 2018 EVOHosting.in.th Web Hosting All right reserved.
| ทะเบียนพาณิชย์ | IDC | Server Spec | Terms Of Service | Privacy Policy |
| EVO.in.th | evoHosting.in.th | evoVPS.in.th |