ในส่วนของขั้นตอนการตั้งค่าต่อไปนี้ จะเป็นการตั้งค่าต่างเกี่ยวกับ Server โดยจะนำมาเฉพาะ เมนูที่จำเป็นต่อการใช้งานและความเหมาะสมกับและง่ายการดูแล Server ให้มีประสิทธิภาพ และปลอดภัย ข้อมูลส่วนใหญ่จะเป็นการอ้างอิงจากค่าที่ใช้งานจริง ซึ่งสำหรับผู้ดูแล Server แล้ว ควรจะต้องปรับตามความเหมาะสมของการใช้งานเป็นหลัก Step 0: Check Information for Access WHM เตรียมข้อมูล Username Password สำหรับเข้าใช้งาน WHM ทดสอบ Login เข้าใช้งาน WHM ผ่าน URL https://your-ip-server:2087 หรือ 2086 Step 1: Create a New cPanel Account หากมีการสร้าง cPanel Account ไว้อยู่แล้ว สามารถข้ามขั้นตอนนี้ไปได้เลย ** หากยังไม่มีการสร้าง cPanel Account มาก่อนนั้นสามารถทำการสร้างได้ตามขั้นตอนนี้ ** >> Create a New cPanel Account By WHM << Step 2: Basic WebHost Manager® Setup Home »Server Configuration »Basic WebHost Manager® Setup 1.Contact Information: จะใช้ข้อมูลในส่วนนี้เป็นการแจ้งเตือนหรือแจ้งปัญหาต่างๆที่เกิดบน Server ในส่วนนี้แนะนำให้ใส่เป็นอีเมล์ของผู้ดูแล Server ที่สามารถรับข้อมูลได้2.Nameservers ในส่วนนี้หากต้องการใช้งาน Nameserver เป็นของตัวเองบนเครื่อง Serverสามารถกำหนดตั้งค่าได้ในส่วนนี้ โดยจะต้องทำการ register nameserver ของ Domain ที่จะใช้งานก่อน ซึ่งในส่วนของขั้นตอนการทำนั้น ต้องติดต่อกับผู้ให้บริการโดเมนเป็นคนดำเนินการตัวอย่าง Nameserver Step 3: Server Time Home »Server Configuration »Server Timeตัวอย่างสามารถเลือกTimezone ตามที่เราต้องการใช้งานได้โดยประเทศไทยนั้นจะเลือกเป็น Asia/Bangkok Step 4: Edit System Mail Preferences Home »Server Contacts »Edit System Mail Preferencesขั้นตอนนี้จะเป็นการกำหนดการแจ้งเตือนเหตุการณ์ต่างๆที่เกิดขึ้นบนระบบทั้งหมดของ cPanel/WHMตัวอย่าง Step 5: Password Strength Configuration Home »Security Center »Password Strength Configurationขั้นตอนนี้จะเป็นการกำหนดความยากในการสร้าง Password ต่างๆทั้งหมดของระบบ ซึ่งรวมไปถึงการสร้างอีเมล์ ด้วย โดยการเลือกค่าความยากของ Password ที่เหมาะสมและปลอดภัยนั้น ควรจะมีค่ามากกว่า 70 ขึ้นไป ตัวอย่าง Step 7: shell Fork Bomb Protection Home »Security Center »Shell Fork Bomb Protectionเปิดใช้งาน Service ดังกล่าวเพื่อป้องการการเข้าถึง Server ผ่าน SSH/Telnet ที่ไม่พึงประสงค์โดยทำการคลิก Enablesตัวอย่าง Step 8: Configure ClamAV Scanner Home »cPanel »Manage Pluginsคลิกเลือก ปุ่ม Install "ClamAV for cPanel" ตามตัวอย่างด้านล่างตัวอย่าง สำหรับ plugin นี้จะคอยช่วย Scan file ต่างๆบนระบบที่เข้าข่ายสุ่มเสียงหรือไฟล์แปลกปลอม Step 9: Exim Configuration Manager Home »Service Configuration »Exim Configuration Managerสำหรับในส่วนนี้จะเป็นการตั้งค่าเกี่ยวกับระบบอีเมล์ทั้งหมดซึ่งสามารถตั้งค่าได้ตามความเหมาะสมต่อการใช้งาน โดยพื้นฐานสิ่งที่ควรจะเปิดใช้งานมี 10 อย่างดังนี้ 1.Apache SpamAssassin™ reject spam score threshold = 132.Reject remote mail sent to the server's hostname = On3.Apache SpamAssassin™: ratelimit spam score threshold = 12.54.Ratelimit incoming connections with only failed recipients = On5.Apache SpamAssassin™: bounce spam score threshold = 106.RBL: bl.spamcop.net = On7.RBL: zen.spamhaus.org = On8.Require clients to connect with SSL or issue the STARTTLS command before they are allowed to authenticate with the server. = Off9.Apache SpamAssassin™: Forced Global ON = On10.Apache SpamAssassin™: message size threshold to scan = 200 KB
หลังจากได้เครื่องที่ลง CentOS7 มาแล้วให้ดำเนินการติดตั้งตามขั้นตอนดังนี้
1. Yum Update , Install nano , perl curl
yum update -y
yum install perl nano curl -y
2. Disable NetworkManager
nano -w /etc/sysconfig/network-scripts/.... ifcfg-eth0 and ifcfg-lo
Edit file ifcfg-eth0 and ifcfg-loNM_CONTROLLED=no ONBOOT=yes
systemctl enable network.service
systemctl start network.service
3.Disable SELinux
nano -w /etc/selinux/config
SELINUX=disabled
4. Installation cPanel
cd /home
curl -o latest -L https://securedownloads.cpanel.net/latest
sh latest
https://verify.cpanel.net/app/verify
---END---
5. ทดสอบเรียกใช้งาน ผ่าน https://
ขั้นตอนการ Install PHP Version For DirectAdmin (Custom Build) 1. SSH เข้าที่ server direct admin ที่ใช้งาน 2. ไปที่ Path Custom Build cd /usr/local/directadmin/custombuild 3. ทำการ update Custom build ด้วยคำสั่ง ./build update 4. แก้ไข File: options.conf nano -w options.conf โดยเลือกแก้ไขในส่วนของ PHP Version ที่ต้องการ Install เพิ่มไป โดยใส่เป็นตัวเลข Version ไว้ที่ php1 ตามรูปคือ 5.6 และ mode = suphp (หากมี version ที่ใช้งานอยู่แล้ว ให้เปลี่ยนไปไว้ที่ php2 เพื่อให้ select php เพิ่มเติมได้ ) #PHP Settingsphp1_release=5.6php1_mode=suphp php2_release=7.2php2_mode=suphpphp3_release=nophp3_mode=php-fpmphp4_release=nophp4_mode=php-fpm 5. หลังจากแก้ไขแล้วให้รันคำสั่งเพื่อทำการ Build PHP Version ที่กำหนดไป ./build php n 6.หลังจากนั้นให้ทำการตรวจสอบโดยการรันคำสั่ง php -v จะได้ Main PHP Version ที่ทำการ Build ไป หรือทำการตรวจสอบผ่าน DirectAdmin Control Panel เมนู Domain Setup
ขั้นตอนการติดตั้ง ModSecurity™ Vendors (Comodo WAF) 1. Login เข้าสู่ WHM ที่ใช้งาน 2.ไปที่หมวด "Security Center" > "ModSecurity™ Vendors" หมายเหตุ: จากภาพหากต้องการ Install OWASP ModSecurity Core Rule Set V3.0 สามารถคลิกปุ่ม Install ได้เลย 3.คลิกที่ปุ่ม Add Vendor และใส่ Code ในช่องดังนี้ และ คลิกปุ่ม Load https://waf.comodo.com/doc/meta_comodo_apache.yaml 4.หลักจากนั้นจะได้ข้อมูล ของ Vendor Name และรายละเอียดมา ให้ทำการ คลิกปุ่ม Save เป็นอันเสร็จ
ขั้นตอนการติดตั้ง ClamAV บน server cPanel/WHM 1. เข้าสู่ระบบ WHM ที่ใช้งาน 2. ไปที่ Menu หลัก cPanel > Manage Plugins 3. คลิกเลือก ปุ่ม Install "ClamAV for cPanel" ตามรูปด้านล่าง 4. เสร็จแล้วตรวจสอบ Setting ของ plugin ClamAV ได้ที่ "ClamAV Scanner Configuration"