Jul
24
เรียบเรียงขั้นตอนการเปลี่ยน Server
หลังจากได้ Dell มาแล้ว และจะทำการย้ายเวบไซต์ต่างๆ จาก Chenbro มา ควรทำดังต่อไปนี้
1. ติดตั้ง Fedora Core 2 ลงที่ Dell และตั้งชื่อ Server ว่า srv01.filmily.com กำหนด IP เครื่องเป็น 203.146.252.244
2. ติดตั้ง Ensim Pro 4.0.3 FC2 ลงที่เครื่องใหม่
3. ติดตั้ง APF
4. ติดตั้ง MRTG
5. ติดตั้ง rkhunter
6. Upgrade MySQL
สามารถทำได้เอง โดยใช้เวลาประมาณ 1-2 ชั่วโมงครับ
ข้อมูลจาก
Ensim Supportให้คุณ Login เป็น root ทาง SSH ก่อน
หลังจากนั้น ให้สร้าง Directory สำหรับเก็บไฟล์ต่างๆ ที่เราจะใช้งาน แล้ว cd เข้าไปในนั้น# mkdir mysqlrpm
# cd mysqlrpmหลังจากนั้น ให้คุณ Download MySQL rpm จาก
http://dev.mysql.com/downloads/mysql/4.0.html
ให้เลือก Package ให้ถูกต้องนะครับ
เครื่องผมเป็น Pentium4 : 2.8c
ผมใช้ Linux x86 RPMrpm ที่เราจะ Download มาใช้ในการ Upgrade มี
Server Benchmark/test suites Client programs Libraries and header files Dynamic client libraries Embedded server Dynamic client libraries (including 3.23.x libraries) สั่ง wget มาทีละตัวเลยครับ
ตั้วอย่าง
# wget http://dev.mysql.com/get/Downloads/MySQL-4…ng.in.th/mysql/หลังจากนั้นลองสั่ง ls ดู จะมีประมาณนี้ครับ
# ls
MySQL-bench-4.0.24-0.i386.rpm MySQL-devel-4.0.24-0.i386.rpm MySQL-server-4.0.24-0.i386.rpm MySQL-shared-compat-4.0.24-0.i386.rpm
MySQL-client-4.0.24-0.i386.rpm MySQL-embedded-4.0.24-0.i386.rpm MySQL-shared-4.0.24-0.i386.rpmสั่งหยุดการทำงานของ MySQL
# service mysqld stopคุณอาจเจอ Warning บ้างนะครับ
ผมเจอประมาณนี้
แต่ก็ Upgrade ผ่านครับ
egrep: /home/virtual/site6/info/current/mysql: No such file or directory
Stopping MySQL: [ OK ]หลังจากนั้น สั่ง Upgrade rpm ครับ
# rpm -Uvh *.rpmเมื่อลง rpm เสร็จแล้ว ให้สั่งตามนี้ครับ
# set_pre_maintenance
# set_maintenance
# set_post_maintenance
# service webppliance restartเมื่อสั่ง webppliance restart แล้ว ระบบจะจัดการ maintenance ให้ และจะใช้เวลาพอสมควร
คุณควร Plan เรื่องเวลาสำหรับส่วนนี้ไว้ด้วยนะครับ
เวบไซต์ทั้งหมดบน Server จะ Down ประมาณ 5-15 นาทีหลังจากที่การ maintenance ผ่านเรียบร้อยแล้ว
ทุกอย่างจะกลับมาทำงานตามปกติ
ให้ทำการ fix ตารางต่างๆ ของ MySQL ด้วยครับ
ใช้คำสั่งดังนี้
# mysql_fix_privilege_tables
# mysqlcheck -o -u root -p –all-databasesหลังจากนั้น ลองตรวจสอบสถานะล่าสุดของ MySQL ดูครับ
# mysql -u root -pแล้วสั่ง Status ดูครับ ที่ mysql prompt
mysql> status
————–
mysql Ver 12.22 Distrib 4.0.24, for pc-linux-gnu (i686)เท่าที่ผมลอง Upgrade ดู พบว่า หลังเสร็จกิจแล้ว ควร Restart MySQL อีกครั้งครับ
ไม่งั้นจะใช้ phpMyAdmin ไม่ได้ครับ
จะทำผ่าน Commandline หรือทางหน้า Webppliance ก็ได้ครับก่อนจะทำการ Upgrade อย่าลืม Backup Database ไว้ก่อนนะครับ
# mysqldump –all-databases -u root -p > backup.sql
7. Patch ต่างๆ จาก http://www.ensim.com/support/pro/linux/errata.html
Upgrade mysql from v3.23 to v 4.x
Ensim Pro v 4.0.2 is released with “mysql” version 3.23. After manually upgrading the “mysql” rpm from 3.23 to 4.x, securityvulnerability is seen. This hot fix script when run, closes this vulnerability.
The patch contains the following files: UpdatemysqlDb
Download : ftp://ftp.ensim.com/outgoing/kb/4.0.2/UpdatemysqlDb (MD5: 6264fe89b566f55ed7ed731a4327b36f)
Installation :
1. Download the above file and copy it to “/usr/bin” directory, with the permissions: 744 and ownership as root:root (owner:group).
2. Execute the downloaded file “UpdatemysqlDb” and give the upgraded mysql’s bin directory path when asked for.
Hotfix for Spamassassin v3.0.2 Fixes language changing issue in Squirrelmail Fixes Maillog errors after spamassassin upgrade Fixes syntax difference between Spamassassin v2.6.x and 3.0.x Fixes multiple issues Fixes language changing issue in Squirrelmail on FC1 only Disappearing commas in email aliases Sendmail error due to SMTP Authentication failure MailScanner conf gets overwritten Global subdomain map is not updated on removal of aliases Subdomain files not downloadable
8. Fix ปัญหา Squirrel Mail ภาษาไทยก่อน Restore Site
ข้อมูลจาก Hotfix : แก้ปัญหาต้องมาแก้ Thai ใน Sqmail เอง
หลังจากที่ได้ทำการสอบถามไปยัง Ensim ผมว่าวิธีการที่จะทำให้ Sqmail ใช้งานภาษาไทยได้โดยการ1) Untar the attached folder and place it
/etc/virtualhosting/templates/sqmail/var/www/squirrelmail/locales/
2) Edit the file
/etc/virtualhosting/templates/sqmail/var/www/squirrelmail/functions/i18n.php and uncomment the block$languages['th_TH']['NAME'] = ‘Thai’;
$languages['th_TH']['CHARSET'] = ’tis-620′;
$languages['th_TH']['LOCALE'] = ‘th_TH.TIS-620′;
$languages['th']['ALIAS'] = ‘th_TH’;3) Edit the files
sqmail.pkgtemplates.list
sqmail.templates.list
and add the lines/var/www/squirrelmail/locale/th_TH/LC_MESSAGES/squirrelmail.mo
/var/www/squirrelmail/locale/th_TH/LC_MESSAGES/squirrelmail.po4) Run the system thru maintenance mode.
เท่านี้ก็จะสามารถใช้งานภาษาไทยได้แล้วครับ
9. ทยอย Restore Site เล็กๆ จาก Chenbro ให้ได้ก่อน แล้วค่อยดึง Site ใหญ่ๆ มา
10. แก้ IP ของ ns1.filmily.com / ns2.filmily.com เป็น 203.146.252.244