Author Topic: directadmin opcache cool!  (Read 4780 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
directadmin opcache cool!
« on: ตุลาคม 10, 2015, 02:18:48 PM »
ปกติถ้าท่านใดใช้งาน DA control panel อยู่ และอยากจะใช้ cache system เพื่อลดโหลดเข้ามายังฝั่ง server ให้วิ่งมาเรียกไฟล์ใหม่ทุกครั้ง
สามารถใช้งานตัว cache ช่วยได้ แต่ก็ต้องดูความเหมาะสมด้วยว่า php ที่เราใช้งาน สามารถใช้งานร่วมกันได้หรือเปล่า

ใน DA เวอร์ชั่นใหม่ๆเราสามารถ install opcache เข้าไปร่วมได้ กับ PHP 5.5 เป็นต้นไปครับผม

#cd /usr/local/directadmin/custombuild
#./build set opcache yes
#./build opcache

แล้วก็ลงตัว monitor cache ไว้ด้วย
#cd /home/root/html
#wget https://raw.githubusercontent.com/rlerdorf/opcache-status/master/opcache.php

แล้วก็เขียนกันสิทธิ์เข้าไปดูหน่อยครับ
#htpasswd -c /home/root/html/.htpass  user

#vi .htaccess
AuthName "Secure Area"
AuthType Basic
AuthUserFile /home/root/html/.htpass
require valid-user

แค่นี้ก็เรียบร้อยครับผม  :)


ในกรณีต้องการปรับแต่งค่า ตัวเลข cache เพิ่มเติม
#cd /usr/local/directadmin/custombuild/configure/opcache
#cp opcache.ini opcache.ini_ori
#vi opcache.ini
เปลี่ยนค่าต่างๆตามความเหมาะสม

#cd /usr/local/directadmin/custombuild
#./build opcache
แค่นี้ก็เรียบร้อยครับผม  :)
« Last Edit: ตุลาคม 10, 2015, 02:37:07 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: directadmin opcache cool!
« Reply #1 on: มีนาคม 16, 2018, 01:47:51 PM »
###ติดตั้ง mrtg บน linux on Directadmin ขอบคุณจารย์ icez สำหรับ know how ดีๆ ครับ
yum -y install net-snmp mrtg
wget -4 -O /etc/snmp/snmpd.conf www.icez.net/files/snmpd.conf
wget -4 -O /var/www/mrtg/mrtg-load.sh www.icez.net/files/mrtg-load.sh
chmod a+x /var/www/mrtg/mrtg-load.sh
/etc/init.d/snmpd restart
cfgmaker --global 'WorkDir: /var/www/mrtg' --global 'Options[_]: bits,growright' --no-down --zero-speed=1000000000 --noreversedns --output /var/www/mrtg/mrtg.cfg --ifdesc=name --snmp-options=:::::2 public@localhost
wget -4 -O /tmp/mrtg.cfg www.icez.net/files/mrtg.cfg
cat /tmp/mrtg.cfg >> /var/www/mrtg/mrtg.cfg
/bin/cp -fv /var/www/mrtg/mrtg.cfg /etc/mrtg/mrtg.cfg
echo "Alias /mrtg /var/www/mrtg" > /etc/httpd/conf.d/mrtg.conf
/sbin/chkconfig snmpd on
indexmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
if [ -d /usr/local/directadmin ]; then ln -s /var/www/mrtg /var/www/html/; fi
/etc/init.d/httpd graceful