ปัญหา เนื่องจากใน Mysql version 5.7 เป็นต้นไปจะมีการเปิดการใช้งาน Function : ONLY_FULL_GROUP_BY และNO_ZERO_DATE โดย Default ส่งผลให้ Website ของลูกค้าไม่สามารถใช้งานได้ วิธีการแก้ไข 1. Access SSH เข้าไปที่ Server ที่ต้องการ 2. ทำการตรวจสอบว่ามีการเปิด Function : ONLY_FULL_GROUP_BY และ NO_ZERO_DATE ไว้อยู่หรือไม่โดยการ Run command : mysql จากนั้นใส่ข้อมูล SELECT @@sql_mode; [root@system ~]# mysql Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 4330Server version: 5.7.25-log MySQL Community Server (GPL) Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>SELECT @@sql_mode; 3. จะแสดงข้อมูล Function ที่มีการเปิดการใช้งานทั้งหมด mysql> SELECT @@sql_mode;+------------------------------------------------------------------------------------------------------------------------+| @@sql_mode |+------------------------------------------------------------------------------------------------------------------------+| ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |+------------------------------------------------------------------------------------------------------------------------+1 row in set (0.00 sec) mysql> 4. หากพบว่ามีการเปิดการใช้งาน Function : ONLY_FULL_GROUP_BY และ NO_ZERO_DATE ให้ทำการปิดโดยให้ไปดำเนินการที่ไฟล์ /etc/my.cnf [root@system ~]# nano -w /etc/my.cnf 5. ทำการเพิ่มข้อมูลตามรายละเอียดด้านล่าง [mysqld]sql_mode = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" 6. ทำการ Restart service mysql [root@system ~]# /scripts/restartsrv_mysql
วิธีติดตั้ง free SSL tool ของ LetsEncrypt บน DirectAdmin 1. สำหรับ Server ที่เป็น CentOS 6 หรือที่ใหม่กว่า จะต้องทำการตั้งค่าให้ DA to allow SNI โดยจะต้องเข้าไปเพิ่มค่า enable_ssl_sni=1 ในไฟล์ /usr/local/directadmin/conf/directadmin.conf 2. ทำการ Enable letsencrypt=1 ในไฟล์ /usr/local/directadmin/conf/directadmin.conf 3. Restart DirectAdmin run command : echo "action=directadmin&value=restart" >> /usr/local/directadmin/data/task.queue; /usr/local/directadmin/dataskq d2000 4. Add the /.well-known Alias cd /usr/local/directadmin/custombuild ./build rewrite_confs 5. จากนั้นให้ run script cd /usr/local/directadmin/custombuild ./build update ./build letsencrypt 6. เมื่อเสร็จแล้วให้ login User Level -> SSL Certificates เข้าไปติดตั้ง อ้างอิง : https://help.directadmin.com/item.php?id=648 https://help.directadmin.com/item.php?id=641&in1=letsencrypt&in2=1
ตรวจสอบที่ Part : /etc/usersdata ก่อนทุกครั้งว่ามีข้อมูลหรือไม่ ปัญหา ไม่สามารถตรวจสอบ Account ของลูกค้าผ่านหน้า WHM >> List account ได้ วิธีการแก้ไข 1. Access SSH เข้าไปที่ Server ที่ต้องการ 2. ทำการย้าย Directory ในส่วนของ /var/cpanel/userdata โดยใช้คำสั่ง [root@vps ~]#mv /var/cpanel/userdata /var/cpanel/userdata.orig 3. ทำการสร้าง Directory ขึ้นมาใหม่โดยใช้คำสั่ง [root@vps ~]# cd /var/cpanel/ [root@vps cpanel]# mkdir /var/cpanel/userdata 4. ทำการ run script เพื่อทำการสร้างข้อมูลของ User ทั้งหมดขึ้นมาใหม่ [root@vps cpanel]# /usr/local/cpanel/bin/userdata_update --reset 5. ทำการตรวจสอบความถูกต้องของการตั้งค่า [root@vps ~]# /usr/local/cpanel/bin/fix_userdata_perms 6. ทำการ Update cache [root@vps ~]# /scripts/updateuserdatacache 7. Rebuild Apache [root@vps ~]# /scripts/rebuildhttpdconf ตรวจสอบการใช้งานอีกครั้งว่าสามารถ list account ได้แล้วหรือไม่
วิธี Config firewall csf & lfd ให้ Allow port 20,21 และ ping เฉพาะ ip ที่ต้องการ เงื่อนไขที่ต้องการ 1. ต้องการปิด Port TCP IN 20 และ 21 แต่จะให้สามารถใช้งาน FTP ด้วย Port 20 และ 21 ได้จาก Ip ที่กำหนดเท่านั้น 2. ต้องการปิด icmp ไม่ให้สามารถ Ping ได้แต่จะอนุญาตแค่เฉพาะ Ip ที่ต้องการสามารถ Ping ได้ วิธีดำเนินการตามเงื่อนไขที่ 1 ต้องการปิด Port TCP IN 20 และ 21 แต่จะให้สามารถใช้งาน FTP ด้วย Port 20 และ 21 ได้จาก Ip ที่กำหนดเท่านั้น 1. Login WHM >> Home >> Plugins >> ConfigServer Security & Firewall >> Firewall Configuration 2. ทำการลบข้อมูลในส่วนของ TCP IN Port 20 และ 21 ออกเพื่อไม่ให้สามารถใช้งาน FTP ได้ 3. ไปที่เมนู Home >> Plugins >> ConfigServer Security & Firewall >> Firewall Allow IPs ทำการเพิ่มข้อมูล tcp|in|d=20_21|s=203.78.98.10 วิธีดำเนินการตามเงื่อนไขที่ 2 ต้องการปิด icmp ไม่ให้สามารถ Ping ได้แต่จะอนุญาตแค่เฉพาะ Ip ที่ต้องการเท่านั้นสามารถ Ping ได้ 1. Login WHM >> Home >> Plugins >> ConfigServer Security & Firewall >> Firewall Configuration 2. ทำการปิดการใช้งาน ICMP_IN และ ICMP_OUT 3. ไปที่เมนู Home >> Plugins >> ConfigServer Security & Firewall >> Firewall Allow IPs ทำการเพิ่มข้อมูล icmp|in|d=ping|s=203.78.98.10
วิธีติดตั้ง zabbix บนเครื่อง FreeNas Server Login to the FreeNAS using SSH ให้ทำการแก้ไขไฟล์ /usr/local/etc/pkg/repos/local.conf nano -w /usr/local/etc/pkg/repos/local.conf จาก local: { url: "file:///usr/ports/packages", enabled: yes} แก้ไข เป็น local: { url: "file:///usr/ports/packages", enabled: false} จากนั้นให้ทำการแก้ไขไฟล์ /usr/local/etc/pkg/repos/FreeBSD.conf nano -w /usr/local/etc/pkg/repos/FreeBSD.conf จาก FreeBSD: { enabled: no} แก้ไขเป็น FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", enabled: yes} จากนั้นให้ RUN pkg update แล้ว RUN root@freenas1:~ # pkg search zabbixpy27-pyzabbix-0.7.4 Zabbix API Python Libraryzabbix2-agent-2.0.21_1 Enterprise-class open source distributed monitoring (agent)zabbix2-java-2.0.21_1 Enterprise-class open source distributed monitoring (java)zabbix2-proxy-2.0.21_1 Enterprise-class open source distributed monitoring (proxy)zabbix2-server-2.0.21_1 Enterprise-class open source distributed monitoring (server)zabbix22-agent-2.2.23 Enterprise-class open source distributed monitoring (agent) LTSzabbix22-java-2.2.23 Enterprise-class open source distributed monitoring (java) LTSzabbix22-libzbxpgsql-1.1.0_1 Zabbix agent module for comprehensive monitoring of PostgreSQL serverszabbix22-proxy-2.2.23 Enterprise-class open source distributed monitoring (proxy) LTSzabbix22-server-2.2.23 Enterprise-class open source distributed monitoring (server) LTSzabbix3-agent-3.0.22 Enterprise-class open source distributed monitoring (agent) LTSzabbix3-frontend-3.0.22 Enterprise-class open source distributed monitoring (frontend) LTSzabbix3-java-3.0.22 Enterprise-class open source distributed monitoring (java) LTSzabbix3-libzbxpgsql-1.1.0_1 Zabbix agent module for comprehensive monitoring of PostgreSQL serverszabbix3-proxy-3.0.22 Enterprise-class open source distributed monitoring (proxy) LTSzabbix3-server-3.0.22 Enterprise-class open source distributed monitoring (server) LTSzabbix32-agent-3.2.11_2 Enterprise-class open source distributed monitoring (agent)zabbix32-frontend-3.2.11_2 Enterprise-class open source distributed monitoring (frontend)zabbix32-java-3.2.11_2 Enterprise-class open source distributed monitoring (java)zabbix32-libzbxpgsql-1.1.0_1 Zabbix agent module for comprehensive monitoring of PostgreSQL serverszabbix32-proxy-3.2.11_2 Enterprise-class open source distributed monitoring (proxy)zabbix32-server-3.2.11_2 Enterprise-class open source distributed monitoring (server)zabbix34-agent-3.4.14 Enterprise-class open source distributed monitoring (agent)zabbix34-frontend-3.4.14 Enterprise-class open source distributed monitoring (frontend)zabbix34-java-3.4.14 Enterprise-class open source distributed monitoring (java)zabbix34-libzbxpgsql-1.1.0_1 Zabbix agent module for comprehensive monitoring of PostgreSQL serverszabbix34-proxy-3.4.14 Enterprise-class open source distributed monitoring (proxy)zabbix34-server-3.4.14 Enterprise-class open source distributed monitoring (server) จากนั้น ให้เลือก package ที่จะทำการ install pkg install zabbix4-agent-4.0.17 เมื่อทำการ install เสร็จแล้ว ให้ทำการเพิ่ม config ใน /etc/rc.conf nano -w /etc/rc.conf # Enable zabbix agentzabbix_agentd_enable="YES" จากนั้นให้ทำการแก้ไข zabbix config cp /etc/local/zabbix4/zabbix_agentd.conf.sample /etc/local/zabbix4/zabbix_agentd.conf nano -w /etc/local/zabbix4/zabbix_agentd.confโดยดำเนินการแก้ไขในส่วนของServer=203.78.103.9ServerActive=203.78.103.9Hostname=[Servername]EnableRemoteCommands=1 เมื่อแก้ไขค่า config แล้วให้ทำการ start zabbix agent ขึ้นมา cd /var/runmkdir zabbixchown zabbix:zabbix zabbixservice -e | grep zabbixservice zabbix_agentd start เสร็จแล้ว ให้ login ไป ที่ https://ezazbweb1.ezyadmin.com/zabbix แล้วให้ทำการ add host เข้าไปแบบ manual ครับ