Install OpenMeetings บน CentOS 5.5

58
Install OpenMeetings CentOS 5.5 ผมเคยเขยนบทความเกยวกบการใชงาน OpenMeetings โดยใช User จาก Active Directory ในบทความน http://noc.rmutl.ac.th/main/?p=838 แตมคน ใหความสนใจสอบถามเกยวกบการตดตง OpenMeeting วา มขนตอนอยางไร วนนสบโอกาสทจะทาการอพเกรด เวอรชน (ผมลงใหมเลยครบ) ใหทนสมย อกทงยง ม Mod ตวใหมสาหรบ Moodle ดวย ดงนนผมจะทาการ ตดตงไปพรอมกนเลยครบ เอาแบบ Step by Step กนเลย ทเดยว ขอมลเบองตน สาหรบการตดตง 1. CentOS 5.5 amd 64 ตดตงเฉพาะแพคเกจ Server เทา นน อยางอนไมเอาครบ 2. openmeetings_1_6_rc1_r3621.zip ขนาด 82.6 MB 3. Mod ของ Moodle ทชอวา openmeetings_moodle_v_1_0.zip ขนาด 86.7 KB

Transcript of Install OpenMeetings บน CentOS 5.5

Install OpenMeetings บนCentOS 5.5

ผมเคยเขียนบทความเกี่ยวกับการใช้งานOpenMeetings โดยใช้ User จาก ActiveDirectory ในบทความนี้ http://noc.rmutl.ac.th/main/?p=838 แต่มีคน

ให้ความสนใจสอบถามเกี่ยวกับการติดตั้ง OpenMeeting ว่ามีขั้นตอนอย่างไร วันนี้สบโอกาสที่จะทําการอัพเกรดเวอร์ชั่น (ผมลงใหม่เลยครับ) ให้ทันสมัย อีกทั้งยังมี Mod ตัวใหม่สําหรับ Moodle ด้วย ดังนั้นผมจะทําการติดตั้งไปพร้อมกันเลยครับ เอาแบบ Step by Step กันเลยทีเดียว

ข้อมูลเบื้องต้น สําหรับการติดตั้ง

1. CentOS 5.5 amd 64 ติดตั้งเฉพาะแพ็คเก็จ Server เท่านั้น อย่างอื่นไม่เอาครับ

2. openmeetings_1_6_rc1_r3621.zip ขนาด 82.6 MB

3. Mod ของ Moodle ที่ชื่อว่า openmeetings_moodle_v_1_0.zipขนาด 86.7 KB

เริ่มการติดตั้ง

1. ทําการติดตั้ง mysql-server โดยใช้คําสั่ง yum ดังนี้

[root@opt src]#yum -y install mysql-server

[root@opt src]# service mysqld start

[root@opt src]# mysqladmin -u root password 123456 < หมายเหตุ กําหนดพาสเวิร์ดเป็น 123456

[root@opt src]# vi /etc/my.cnf[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=mysql# Default to using old password format for compatibility withmysql 3.x# clients (those using the mysqlclient10 compatibilitypackage).old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted

security risks;# to do so, uncomment this line:# symbolic-links=0default-character-set=utf8 < เพิ่มเข้าไปครับcharacter-set-server=utf8

[mysqld_safe]log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pid~~“/etc/my.cnf” 17L, 494C written[root@opt src]# service mysqld restartStopping MySQL: [ OK ]Starting MySQL: [ OK ][root@opt src]#

[root@opt src]# mysql -u root -pEnter password:xxxxxxxWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.0.77 Source distribution

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> create database openmeetings; < สร้างฐานข้อมูลที่ชื่อว่า openmeetingsQuery OK, 1 row affected (0.00 sec)

mysql> show databases;+——————–+| Database |+——————–+| information_schema || mysql |

| openmeetings || test |+——————–+4 rows in set (0.00 sec)

mysql> exitBye[root@opt src]#

2. ติดตั้ง java ซึ่งจําเป็นจําหรับการใช้งานopenmeeting ดังนี้

[root@opt src]#yum -y install java

3. ติดตั้งแพ็คเก็จที่สําเป็นสําหรับ openmeeting ดังนี้

root@opt src]# wgethttp://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm[root@opt src]# rpm -Uvh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpmwarning: rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm: HeaderV3 DSA signature: NOKEY, key ID 6b8d79e6Preparing… ########################################### [100%]1:rpmforge-release ########################################### [100%]

[root@opt src]#yum -y install freetype freetype-develfontconfig fontconfig-devel java-1.6.0-openjdk-devel libtifflibtiff-devel libjpeg-devel libjpeg giflib giflib-devellibpaper libpaper-devel xml-commons-apis libpng libpng-devellibxml2 libxml2-devel fftw3 fftw3-devel cairo cairo-develflac flac-devel wavpack wavpack-devel libsndfile libsndfile-devel libmad libmad-devel yasm-devel yasm gcc gcc-c++

[root@opt src]#yum -y groupinstall ‘Office/Productivity’

[root@opt src]#yum -y install openoffice.org-headless

4. แก้ไขไฟล์ rc.local โดยการเพิ่มข้อความเข้าไปดังนี้

[root@opt src]# find / -name ‘soffice’ < ค้นหาที่อยู่ของOpen Office/usr/lib64/openoffice.org3/program/soffice/usr/bin/soffice

[root@opt src]# vi /etc/rc.local

.

.

/usr/lib64/openoffice.org3/program/soffice “-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager” -nologo -headless -nofirststartwizard &

.

.

5. ลบแพ็คเก็จเดิมที่ CentOS ติดตั้งมา (เพื่อติดตั้งแพ็คเก็จที่ใหม่กว่าเข้าแทนที่) **สําหรับคนที่ต้องการติดตั้งแพ็คเก็จ โดยการคอมไพล์เท่านั้นนะครับถ้าจะใช้ yum ก็ข้ามขั้นตอนนี้ ไปขั้นตอนที่ 6 เลยครับ**

แพ็คเก็จที่จะลบออกมี 3 ตัวด้วยกันคือ ghostscript ,ImageMagick , sox

[root@opt src]# rpm -qa|grep ghostscript < ทําการค้นหาแพ็คเก็จ โดยค้นหาทั้ง 3 ตัว (ในตัวอย่างผมค้นหาแค่ghostscript นะครับ) ถ้ามีการติดตั้งให้ใช้คําสั่งyum remove ดังนี้

[root@opt src]# yum -y remove ghostscript

6. ติดตั้งแพ็คเก็จที่ใหม่กว่าดังนี้ (จะใช้ yumให้ใช้คําสั่งดังต่อไปนี้ yum -y install ghostscriptlame swftools ImageMagick ffmpeg sox ) **ถ้าใครต้องการคอมไพล์แพ็คเก็จเอง ก็ตามขั้นตอนด้านล่างครับ**

cd /usr/src[root@opt src]# wget wgethttp://ghostscript.com/releases/ghostscript-9.01.tar.gz[root@opt src]# wgethttp://sourceforge.net/projects/lame/files/lame/3.98.4/lame-3.98.4.tar.gz/download?use_mirror=cdnetworks-kr-2#[root@opt src]# wgethttp://www.swftools.org/swftools-0.9.1.tar.gz[root@opt src]# wgetftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick-6.6.7-9.tar.gz[root@opt src]# wgethttp://downloads.sourceforge.net/project/sox/sox/14.3.1/sox-14.3.1.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsox%2Ffiles%2Fsox%2F14.3.1%2F&ts=1298364869&use_mirror=cdnetworks-kr-1[root@opt src]# wgethttp://www.ffmpeg.org/releases/ffmpeg-0.6.1.tar.gz

[root@opt src]# cd /usr/src[root@opt src]# tar xvfz ghostscript-9.01.tar.gz[root@opt ghostscript-9.01]# ./configure –prefix=/usr[root@opt ghostscript-9.01]# mkdir obj[root@opt ghostscript-9.01]# mkdir bin[root@opt ghostscript-9.01]# make all[root@opt ghostscript-9.01]# make install

[root@opt ghostscript-9.01]# cd /usr/src[root@opt lame-3.98.4]# tar xvfz lame-3.98.4.tar.gz[root@opt lame-3.98.4]# cd lame-3.98.4[root@opt lame-3.98.4]# ./configure –prefix=/usr[root@opt lame-3.98.4]# make all[root@opt lame-3.98.4]# make install

[root@opt lame-3.98.4]# cd /usr/src/[root@opt src]# tar xvfz swftools-0.9.1.tar.gz[root@opt src]# cd swftools-0.9.1[root@opt src]# make all[root@opt src]# make install

[root@opt src]# cd /usr/src[root@opt src]# tar xvfz ImageMagick-6.6.7-9.tar.gz[root@opt src]# cd ImageMagick-6.6.7-9[root@opt ImageMagick-6.6.7-9]# ./configure –prefix=/usr[root@opt ImageMagick-6.6.7-9]# make all[root@opt ImageMagick-6.6.7-9]# make install

[root@opt ImageMagick-6.6.7-9]# cd /usr/src/[root@opt src]# tar xvfz ffmpeg-0.6.1.tar.gz[root@opt src]# cd ffmpeg-0.6.1[root@opt ffmpeg-0.6.1]# ./configure –enable-libmp3lame–enable-postproc –enable-gpl –enable-pthreads –enable-avfilter –prefix=/usr[root@opt ffmpeg-0.6.1]# make all[root@opt ffmpeg-0.6.1]# make install

[root@opt ffmpeg-0.6.1]# cd /usr/src/[root@opt src]# tar xvfz sox-14.3.1.tar.gz[root@opt src]# cd sox-14.3.1[root@opt sox-14.3.1]# ./configure –prefix=/usr[root@opt sox-14.3.1]# make all[root@opt sox-14.3.1]# make install

7. ก๊อปปี้ไฟล์ openmeetings_1_6_rc1_r3621.zip และopenmeetings_moodle_v_1_0.zip ไปไว้ใน /usr/src

หรือ จะทําการใช้คําสั่ง wget มาก็ได้ครับ ดังนี้

[root@opt src]#cd /usr/src

[root@opt src]#wgethttp://openmeetings.googlecode.com/files/openmeetings_1_6_rc1

_r3621.zip

8. เมื่อก๊อปปี้เสร็จเรียบร้อยแล้ว ให้ทําการแตกไฟล์ออกมา โดยใช้คําสั่ง unzip ดังนี้

[root@opt src]#unzip openmeetings_1_6_rc1_r3621.zip

[root@opt src]# lsdebug kernels openmeetings_1_6_rc1_r3621.zip red5

9.เข้าไปตั้งค่าไฟล์คอนฟิกของ openmeeting ก่อนทําการติดตั้ง

[root@opt src]# cd /usr/src/red5/webapps/openmeetings/conf

[root@opt conf]# mv hibernate.cfg.xml hibernate.cfg.xml.old[root@opt conf]# cp mysql_hibernate.cfg.xml hibernate.cfg.xml

10. แก้ไขไฟล์ hibernate ดังนี้

[root@opt conf]# vi hibernate.cfg.xml

.

.

<!– User / Password –><property name=”connection.username”>root</property><property name=”connection.password”>123456</property>

<!– Database Settings –><propertyname=”connection.driver_class”>com.mysql.jdbc.Driver</property><!– for performance reasons changed to MyISAM fromorg.hibernate.dialect.MySQLInnoDBDialect –><propertyname=”dialect”>org.hibernate.dialect.MySQLMyISAMDialect</property>

<propertyname=”connection.url”>jdbc:mysql://localhost/openmeetings?autoReconnect=true&amp;useUnicode=true&amp;createDatabaseIfNotExist=true&amp;characterEncoding=utf-8</property>

.

.

11. ดําเนินการให้ red5 ทํางานทุกครั้งที่รีสตาร์ทเครื่อง อ้ออย่าลืมให้ mysqld ทํางานตอนบูตเครื่องด้วยละครับเช่นสั่งใน ntsysv

[root@opt]# cd /etc/rc.d[root@opt rc.d]# vi rc.red5#!/bin/sh <– พิมพ์เพิ่มเข้าไปทั้ง 3บรรทัดครับexport RED5_HOME=/usr/src/red5//usr/src/red5/red5.sh &

[root@opt rc.d]# vi rc.local/etc/rc.d/rc.red5/sbin/iptables -F..[root@opt rc.d]# chmod 755 rc.red5

[root@opt rc.d]#chkconfig mysqld on <– หรือจะใช้คําสั่ง ntsysv แล้วเลือก mysqld ก้ได้ครับ

[root@opt rc.d]#/etc/rc.d/rc.red5 <– หลังจากรันคําสั่งนี้แล้ว จะมีข้อความขึ้นเต็มจอด ไม่ต้องตกใจครับเป็นข้อความปกติ

12. ติดตั้งผ่านทางเว็บไซต์

http://ipaddress:5080/openmeetings/install

ระบบจะแจ้งให้ตรวจสอบการคอนฟิก user & password และชื่อ database ในไฟล์ hibernate.conf.xml หากแน่ใจแล้วว่าถูกต้องหมดแล้ว ก็ให้คลิ๊กที่ Continue with STEP 1เพื่อดําเนินการต่อไป

ระบบจะให้กรอกรายละเอียด ในส่วนชื่อที่ใช้งานเป็นอันดับแรก (ผู้ดูแลระบบ) ที่ต้องการใช้งาน ในที่นี้ผมใช้ชื่อของผมนะครับ

ให้กรอกรายละเอียดของ mail server ถ้าต้องการให้ระบบทําการส่ง e-mail ให้กับผู้เข้าใช้งานโปรแกรม เช่นการสมัครใช้งาน การเชิญเข้าร่วมประชุมทาง e-mailซึ่งตรงนี้จะเป็นออปชั่นครับ ไม่จําเป็นต้องกรอกหรือสามารถกรอกในภายหลังได้ครับ

พาร์ทของซอฟแวร์เสริม ที่เราได้ทําการติดตั้งไปก่อนหน้านี้ครับ ซึ่งใครจําไม่ได้ว่าอยู่ตรงไหน สามารถใช้คําสั่ง find ในการค้นหาได้ครับ ดังนี้

[root@opt usr]# find / -name ‘convert’ ##สําหรับ ImageMagick/usr/bin/convert[root@opt usr]# find / -name ‘pdf2swf’/usr/bin/pdf2swf/usr/src/swftools-0.9.1/src/pdf2swf

[root@opt usr]# find / -name ‘sox’/usr/lib/sox/usr/bin/sox/usr/src/sox-14.3.1/src/.libs/sox/usr/src/sox-14.3.1/src/sox[root@opt usr]# find / -name ‘ffmpeg’/usr/share/ffmpeg/usr/bin/ffmpeg/usr/src/ffmpeg-0.6.1/ffmpeg

เซ้ตพาร์ทของตัวโปรแกรมให้ตรงกับความเป็นจริง (ตามที่ใช้คําสั่งค้นหาตามด้านบน)

เมื่อกรอกข้อมูลครบถ้วนแล้ว ให้คลิ๊กที่ Install ตรงด้านล่างสุดของหน้าเว็บไซต์ครับ รอซักครู่ หากไม่มีอะไรผิดพลาด ระบบจะแจ้งว่า ทําการติดตั้งเรียบร้อย

ตัวอย่างที่แสดงว่าทําการติดตั้งเรียบร้อยแล้ว สามารถคลิ๊กที่ Enter the Application เพื่อเข้าสู่หน้า loginได้ครับ

หน้าล็อกอินของระบบครับ ให้กรอกชื่อที่เราได้ทําการคอนฟิกตอนติดตั้ง ซึ่งชื่อนี้จะมีสิทธิของผู้ดูแลระบบครับ

หน้าตาเว็บไซต์ หลังจากที่ล็อกอินไปแล้ว ถ้าต้องการแก้ไขไฟล์คอนฟิก หรือปรับแต่งค่าต่าง ๆ ให้คลิ๊กที่“การบริหารงาน” ซึ่งในบทความนี้ผมขอไม่พูดถึงครับขอหาเวลาว่าง ๆ อีกซักนิดก็แล้วกันครับ

ผมได้ทดสอบเข้าไปยังห้องประชุม โดยคลิ๊กที่ Room ครับ

การใช้งาน ก็ไม่ถึงกับซับซ้อนอะไรมากครับ บางคนยังชมว่าใช้งานง่ายด้วยซํ้าไปครับ หากมีข้อสงสัยสามารถส่ง e-mail ปรึกษาได้ครับ ที่ หรือ

ปล. ผมขอติดการเชื่อมต่อกับ moodle ไว้ก่อนนะครับไม่ยากครับ แต่รับปากว่าจะเขียนในตอนหน้าครับ อีกไม่นานครับผม

หมายเหตุ แก้ไข บางข้อความ ที่สื่อสารผิดพลาดทําให้เข้าใจสับสนบ้างเล็กน้อยครับ เช่นการติดตั้งด้วย yum กับการคอมไพล์เอง

WordPress MU กับ Active

Directoryนานมาแล้ว ผมได้เขียนบทความเกี่ยวกับการใช้งาน WordPress กับ Active Directory ซึ่งมีหลายท่านได้นําไปใช้ และก็สอบถามถึงเรื่องการใช้งานร่วมกับ WPMU ซึ่งจริง ๆ แล้วมันก็สามารถใช้งานได้ดีระดับหนึ่ง แต่อย่าง

ว่าแหละครับ บางอย่างมันก็ทําไม่ได้ เช่น ต้องการให้มันสร้าง Site ให้เองโดยอัตนโนมัติ ปลั๊กอินตัวเดิมมันก็ทําไม่ได้ (คงเพราะมันเอา username เป็น[email protected]) เลยต้องมองหาตัวใหม่ นั่นก็คือWPMU-LDAP นั่นเอง

ระบบที่ทําการทดสอบ

1. CentOS release 5.5 (Final) amd 64

2. wpmu 3.0.5 ทําการติดตั้งลักษณะของ sub domain

3. wpmu-ldap plugin

เริ่มทําการทดสอน

1. ดาวน์โหลดปลั๊กอินจากที่นี่ครับhttp://sourceforge.net/projects/wpmu-ldap/files/wpmu-ldap/เลือกเวอร์ชั่นล่าสุด หรือเวอร์ชั่นที่สามารถใช้งานกับ wpmu ของเราได้ ณ ตอนนี้ผมเลือกปลั๊กอินเวอร์ชั่น3.0 ครับ

2. ทําการแตกไฟล์ของปลั๊กอินจะพบไฟล์และโฟลเดอร์อย่างละ 1 อันดังนี้

ldap ldap_auth.php

3. ทําการก๊อปปี้ไฟล์และโฟลเดอร์ดังกล่าว ไปไว้ใน/var/www/html/wp-content/mu-plugins (สมมุติว่า /var/www/htmlเป็น DocumentRoot นะครับ)

4. ล็อกอินเข้า wpmu ด้วย admin หรือ user ที่มีสิทธิ

เทียบเท่า admin จากนั้นจะพบส่วนจัดการ ในกลุ่มของSuper Admin ที่บอกว่า LDAP Options โดยตั้งค่าออปชั่นต่าง ๆ ให้เป็นดังนี้

LDAP-Authentication : enable

Server Encryption: none หรือเลือกตามการตั้งค่าของเซิร์ฟเวอร์นะครับ

Server Address : university.local ให้ใส่ตามชื่อ domainตามจริง

Server Port : 389

Search DN: dc=university,dc=local ตําแหน่งที่ต้องการให้ค้นหารายชื่อSearch User DN: cn=noreply,cn=users,dc=university,dc=localชื่อที่มีสิทธิในการค้นหา และต้องมีรายชื่อนี้อยู่จริงSearch User Password : xxxxxxxxxx รหัสผ่านของ user noreplyที่ทําการกรอกไว้ด้านบนLDAP Type: windowsTest Connection: yes แค่การทดสอบครั้งแรกครับ ถ้าผ่านแล้ว ก็ไม่จําเป็นต้องทดสอบอีก

5. จากนั้นให้คลิ๊กที่ Save Optins เพื่อบันทึกและทดสอบการเชื่อมต่อไปยัง AD ตามที่ระบุไว้

6. หากการเชื่อมต่อสําเร็จจะปรากฏข้อความดังต่อไปนี้ (หากไม่สําเร็จต้องกลับมาดูการคอนฟิกอีกครั้งครับ ส่วนใหญ่น่าจะเกิดจาก user ที่ระบุครับ บางครั้งไม่ตรงตามความเป็นจริง จําพวก cn,dc ประมาณนั้นครับ)

LDAP Connection Test: Successful!Saved Options!

7. ในส่วนของ General Settings ให้ตั้งค่าดังนี้

Use Single Sign-On? : noAuto-Create WPMU Accounts? : yesAuto-Create WPMU Blogs? : yesCreate local users?: noAllow blog admins to add users?: yesAllow blog admins to bulk add?: noDisable Public Signup?: no

ที่เหลือเลือกตามใจชอบได้เลยครับ

8. Attribute Mapping ให้ใช้ตามค่ามาตรฐานที่ตั้งไว้ครับ

9. Group Settings จะปล่อยว่างก็ได้ครับ ซึ่งจะทําให้ทุกคนใน AD สามารถล็อกอินได้ทั้งหมด แต่ถ้าเราจะกําหนดสิทธิให้ใช้งานได้เฉพาะกลุ่มก็สามารถทําได้โดยมีตัวเลือกให้ 2 แบบคือ

9.1 Allow Login: คือ ยอมรับเฉพาะกลุ่มที่ทําการระบุ

9.2 Deny Login: คือ ไม่ยอมรับกลุ่มที่ทําการระบุ

การระบุนั้นสามารถระบุได้หลายกลุ่ม โดยกําหนดกลุ่มละบรรทัด ในที่นี้ผมกําหนดให้ยอมรับเฉพาะกร๊ปadministrators โดยเอาใส่ในที่ Allow Login ดังนี้

cn=administrators,cn=builtin,dc=university,dc=local

10. จากนั้นทําการ Save Groups แล้วลองทดสอบโดยการล็อกอินครับ

11. เมื่อทุกอย่างผ่านไปด้วยดี ระบบจะทําการสร้างSite ให้โดยอัตโนมัติครับ

12. ทดสอบเข้าไซต์ของเราเองครับ โดยจะเป็นhttp://username.domainname.xx.xx

ติดตั้ง Mail Server ด้วยZimbra 7

Zimbra เป็น Open Source ที่สามารถนํามาใช้งานได้ฟรี ซึ่งตัว Zimbra ไม่ได้มีหน้าที่แค่ mail แต่ยังมีส่วนประกอบของ email ที่จําเป็นเช่น contacts , group calendaring และยังมีส่วนที่เป็น Zimbra Desktop ที่

ทําหน้าที่คล้ายกับ Microsoft Outlook อีกด้วย

ความต้องการของระบบ

Servers• Minimum – 32-bit OS with Intel/AMD 2.0 GHZ+ CPU Recommended– 64-bit OS• Minimum – 2 GB RAM Recommend minimum – 4 GB RAM• Temp file space for installs and upgrades*• 10 GB free disk space for software and logs (SATA or SCSIfor performance, and RAID/Mirroring for redundancy)• Additional disk space for mail storage

Operating System Network Edition• Red Hat® Enterprise Linux• SUSE Linux Enterprise Server• Ubuntu 10.04 LTS Server Edition

File Systems ext3 file system for Linux deployments

the following:• Internet Explorer 7.0 or 8.0• Firefox 3.0, 3.5 or 3.6• Safari 4 or 5• Google Chrome 2.1, 2.2, or 2.3Mac OS X 10.4, 10.5 or 10.6 with one of the following:• Firefox 3.0, 3.5 or 3.6• Safari 4 or 5• Google Chrome 2.1, 2.2, or 2.3

Linux (Red Hat, Ubuntu, Debian, Fedora, or SUSE)with one of the following:• Firefox 3.0, 3.5 or 3.6• Google Chrome 2.1, 2.2, or 2.3

ขั้นตอนการติดตั้ง

** เครื่องแม่ข่ายที่ทําการติดตั้งเป็น CentOS 5.5 amd 64

1. ดาวน์โหลด Zimbra ได้จากhttp://www.zimbra.com/downloads/os-downloads.html โดยเลือกให้ตรงกับ OS ที่ต้องการติดตั้ง

2. ทําการแตกไฟล์ออกมาโดยใช้คําสั่ง tar xvfz

[root@mail ~]# tar xvfzzcs-7.0.0_GA_3077.RHEL5_64.20110127201852.tgz

3. เข้าไปยังโฟลเดอร์ที่ทําการแตกไฟล์

[root@mail ~]# lsanaconda-ks.cfg install.log.syslog zcs-7.0.0_GA_3077.RHEL5_64.20110127201852install.log mbox zcs-7.0.0_GA_3077.RHEL5_64.20110127201852.tgz[root@mail ~]# cd zcs-7.0.0_GA_3077.RHEL5_64.20110127201852[root@mail zcs-7.0.0_GA_3077.RHEL5_64.20110127201852]# lsbin data docs install.sh packages readme_binary_en_US.txt readme_source_en_US.txt README.txt util[root@mail zcs-7.0.0_GA_3077.RHEL5_64.20110127201852]#

4. ทําการติดตั้งโดยเรียกใช้ไฟล์ install.sh ดังนี้ (หมายเหตุ แพ็คเก็จนี้เป็นของ RH ซึ่ง OS ของเราตอนนี้เป็น CentOS ดังนั้นมันจะไม่ยอมให้ติดตั้ง เราต้องเพิ่มออปชั่น –platform-override ในการติดตั้งเข้าไปด้วย)

[root@mail zcs-7.0.0_GA_3077.RHEL5_64.20110127201852]#./install.sh –platform-override

5. ตัว Zimbra จะทําการสอบถามข้อมูลสําหรับการติดตั้งซึ่งส่วนใหญ่ให้เลือกเป็น Yes (แล้วแต่ความเหมาะสมกับการใช้งานนะครับ)

Operations logged to /tmp/install.log.2223Checking for existing installation…zimbra-ldap…NOT FOUNDzimbra-logger…NOT FOUNDzimbra-mta…NOT FOUNDzimbra-snmp…NOT FOUNDzimbra-store…NOT FOUNDzimbra-apache…NOT FOUNDzimbra-spell…NOT FOUNDzimbra-convertd…NOT FOUNDzimbra-memcached…NOT FOUNDzimbra-proxy…NOT FOUNDzimbra-archiving…NOT FOUNDzimbra-cluster…NOT FOUNDzimbra-core…NOT FOUND

PLEASE READ THIS AGREEMENT CAREFULLY BEFORE USING THESOFTWARE.ZIMBRA, INC. (“ZIMBRA”) WILL ONLY LICENSE THIS SOFTWARE TOYOU IF YOUFIRST ACCEPT THE TERMS OF THIS AGREEMENT. BY DOWNLOADING ORINSTALLINGTHE SOFTWARE, OR USING THE PRODUCT, YOU ARE CONSENTING TO BEBOUND BYTHIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS OFTHISAGREEMENT, THEN DO NOT DOWNLOAD, INSTALL OR USE THE PRODUCT.

License Terms for the Zimbra Collaboration Suite:http://www.zimbra.com/license/zimbra_public_eula_2.1.html

Do you agree with the terms of the software licenseagreement? [N] y

Checking for prerequisites…FOUND: NPTLFOUND: sudo-1.7.2p1-9FOUND: libidn-0.6.5-1.1FOUND: gmp-4.1.4-10FOUND: /usr/lib64/libstdc++.so.6Checking for suggested prerequisites…FOUND: perl-5.8.8MISSING: sysstat does not appear to be installed.FOUND: sqlite

###WARNING###

The suggested version of one or more packages is notinstalled.This could cause problems with the operation of Zimbra.

Do you wish to continue? [N] yPrerequisite check complete.

Checking for installable packages

Found zimbra-coreFound zimbra-ldapFound zimbra-loggerFound zimbra-mtaFound zimbra-snmpFound zimbra-storeFound zimbra-apacheFound zimbra-spellFound zimbra-memcachedFound zimbra-proxy

Select the packages to install

Install zimbra-ldap [Y] y

Install zimbra-logger [Y] y

Install zimbra-mta [Y] y

Install zimbra-snmp [Y] y

Install zimbra-store [Y] y

Install zimbra-apache [Y] y

Install zimbra-spell [Y] y

Install zimbra-memcached [N] y

Install zimbra-proxy [N] yChecking required space for zimbra-corechecking space for zimbra-store

Installing:zimbra-corezimbra-ldapzimbra-loggerzimbra-mtazimbra-snmpzimbra-storezimbra-apachezimbra-spellzimbra-memcachedzimbra-proxy

You appear to be installing packages on a platform differentthan the platform for which they were built.

This platform is CentOS5_64Packages found: RHEL5_64This may or may not work.

Using packages for a platform in which they were not designedformay result in an installation that is NOT usable. Your

supportoptions may be limited if you choose to continue.

Install anyway? [N] y

The system will be modified. Continue? [N] y

Removing /opt/zimbraRemoving zimbra crontab entry…done.done.Cleaning up zimbra init scripts…done.Cleaning up /etc/ld.so.conf…done.Cleaning up /etc/prelink.conf…done.Cleaning up /etc/security/limits.conf…done.

Finished removing Zimbra Collaboration Suite.

Installing packages

zimbra-core……zimbra-core-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…donezimbra-ldap……zimbra-ldap-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…donezimbra-logger……zimbra-logger-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…donezimbra-mta……zimbra-mta-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…donezimbra-snmp……zimbra-snmp-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…donezimbra-store……zimbra-store-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…donezimbra-apache……zimbra-apache-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…donezimbra-spell……zimbra-spell-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…donezimbra-memcached……zimbra-memcached-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…donezimbra-proxy……zimbra-

proxy-7.0.0_GA_3077.RHEL5_64-20110127201852.x86_64.rpm…doneOperations logged to /tmp/zmsetup.02142011-111650.logInstalling LDAP configuration database…done.Setting defaults… MX: mx.fakemx.net (46.4.35.23)

Interface: 10.0.1.211Interface: 127.0.0.146.4.35.2346.4.35.23

DNS ERROR – none of the MX records for mail.rmutl.comresolve to this hostChange domain name? [Yes] n <– กรณีที่ต้องการเปลี่ยนชื่อโดเม็นเช่น @test.comdone.Checking for port conflictsPort conflict detected: 25 (zimbra-mta)Port conflicts detected! – Any key to continue

Main menu

1) Common Configuration:2) zimbra-ldap: Enabled3) zimbra-store: Enabled+Create Admin User: yes+Admin user to create: [email protected]******* +Admin Password UNSET+Anti-virus quarantine user: [email protected]+Enable automated spam training: yes+Spam training user: [email protected]+Non-spam(Ham) training user: [email protected]+SMTP host: mail.rmutl.com+Web server HTTP port: 80+Web server HTTPS port: 443+Web server mode: http

+IMAP server port: 7143+IMAP server SSL port: 7993+POP server port: 7110+POP server SSL port: 7995+Use spell check server: yes+Spell server URL: http://mail.rmutl.com:7780/aspell.php+Enable version update checks: TRUE+Enable version update notifications: TRUE+Version update notification email: [email protected]+Version update source email: [email protected]

4) zimbra-mta: Enabled5) zimbra-snmp: Enabled6) zimbra-logger: Enabled7) zimbra-spell: Enabled8) zimbra-proxy: Enabled9) Default Class of Service Configuration:r) Start servers after configuration yess) Save config to filex) Expand menuq) Quit

Address unconfigured (**) items (? – help) 3 ให้กดหมายเลขด้านหน้า ตามที่ต้องการ ตอนนี้ต้องการเปลี่ยนพาสเวิร์ดให้กดเลข 3

Store configuration

1) Status: Enabled2) Create Admin User: yes3) Admin user to create: [email protected]** 4) Admin Password UNSET5) Anti-virus quarantine user: [email protected]) Enable automated spam training: yes7) Spam training user:

[email protected]) Non-spam(Ham) training user: [email protected]) SMTP host: mail.rmutl.com10) Web server HTTP port: 8011) Web server HTTPS port: 44312) Web server mode: http13) IMAP server port: 714314) IMAP server SSL port: 799315) POP server port: 711016) POP server SSL port: 799517) Use spell check server: yes18) Spell server URL: http://mail.rmutl.com:7780/aspell.php19) Enable version update checks: TRUE20) Enable version update notifications: TRUE21) Version update notification email: [email protected]) Version update source email: [email protected]

Select, or ‘r’ for previous menu [r] 4 กดหมายเลข 4 เพื่อเปลี่ยนรหัสผ่าน

Password for [email protected] (min 6 characters):[dKt1QlWQf] zaqwsx ใส่รหัสผ่านที่ต้องการใช้งาน

Store configuration

1) Status: Enabled2) Create Admin User: yes3) Admin user to create: [email protected]) Admin Password set5) Anti-virus quarantine user: [email protected]) Enable automated spam training: yes7) Spam training user:

[email protected]) Non-spam(Ham) training user: [email protected]) SMTP host: mail.rmutl.com10) Web server HTTP port: 8011) Web server HTTPS port: 44312) Web server mode: http13) IMAP server port: 714314) IMAP server SSL port: 799315) POP server port: 711016) POP server SSL port: 799517) Use spell check server: yes18) Spell server URL: http://mail.rmutl.com:7780/aspell.php19) Enable version update checks: TRUE20) Enable version update notifications: TRUE21) Version update notification email: [email protected]) Version update source email: [email protected]

Select, or ‘r’ for previous menu [r] กด r เพื่อไปเมนูก่อนหน้านี้

Main menu

1) Common Configuration:2) zimbra-ldap: Enabled3) zimbra-store: Enabled4) zimbra-mta: Enabled5) zimbra-snmp: Enabled6) zimbra-logger: Enabled7) zimbra-spell: Enabled8) zimbra-proxy: Enabled9) Default Class of Service Configuration:r) Start servers after configuration yess) Save config to filex) Expand menu

q) Quit

*** CONFIGURATION COMPLETE – press ‘a’ to applySelect from menu, or press ‘a’ to apply config (? – help)a กด a เพื่อนําค่าที่ตั้งไว้ไปใช้งานSave configuration data to a file? [Yes]Save config in file: [/opt/zimbra/config.10246]Saving config in /opt/zimbra/config.10246…done.The system will be modified – continue? [No] yesOperations logged to /tmp/zmsetup.02142011-111650.logSetting local config values…done.Setting up CA…done.Deploying CA to /opt/zimbra/conf/ca …done.Creating SSL certificate…done.Installing mailboxd SSL certificates…done.Initializing ldap…done.Setting replication password…done.Setting Postfix password…done.Setting amavis password…done.Setting nginx password…done.Creating server entry for mail.rmutl.com…done.Saving CA in ldap …done.Saving SSL Certificate in ldap …done.Setting spell check URL…done.Setting service ports on mail.rmutl.com…done.Adding mail.rmutl.com to zimbraMailHostPool in defaultCOS…done.Installing webclient skins…twilight…done.bones…done.lavender…done.tree…done.steel…done.pebble…done.oasis…done.lake…done.carbon…done.

smoke…done.beach…done.lemongrass…done.hotrod…done.sand…done.waves…done.sky…done.bare…done.Finished installing webclient skins.Setting zimbraFeatureTasksEnabled=TRUE…done.Setting zimbraFeatureBriefcasesEnabled=TRUE…done.Setting MTA auth host…done.Setting TimeZone Preference…done.Initializing mta config…done.Setting services on mail.rmutl.com…done.Creating domain mail.rmutl.com…done.Setting default domain name…done.Creating domain mail.rmutl.com…already exists.Creating admin account [email protected]…done.Creating root alias…done.Creating postmaster alias…done.Creating user [email protected]…done.Creating user [email protected]…done.Creating user [email protected]…done.Setting spam training and Anti-virus quarantineaccounts…done.Initializing store sql database…done.Setting zimbraSmtpHostname for mail.rmutl.com…done.Configuring SNMP…done.Checking for default IM conference room…not present.Initializing default IM conference room…done.Setting up syslog.conf…done.

You have the option of notifying Zimbra of your installation.This helps us to track the uptake of the Zimbra CollaborationSuite.The only information that will be transmitted is:

The VERSION of zcs installed (7.0.0_GA_3077_CentOS5_64)The ADMIN EMAIL ADDRESS created ([email protected])

Notify Zimbra of your installation? [Yes] no กด no เพื่อไม่ให้ส่งข้อมูลไปยังผู้พัฒนาNotification skippedStarting servers…done.Installing common zimlets…com_zimbra_attachcontacts…done.com_zimbra_bulkprovision…done.com_zimbra_url…done.com_zimbra_linkedin…done.com_zimbra_srchhighlighter…done.com_zimbra_adminversioncheck…done.com_zimbra_attachmail…done.com_zimbra_cert_manager…done.com_zimbra_email…done.com_zimbra_webex…done.com_zimbra_social…done.com_zimbra_dnd…done.com_zimbra_phone…done.com_zimbra_date…done.Finished installing common zimlets.Restarting mailboxd…done.Setting up zimbra crontab…done.

Moving /tmp/zmsetup.02142011-111650.log to /opt/zimbra/log

Configuration complete – press return to exit

[root@mail zcs-7.0.0_GA_3077.RHEL5_64.20110127201852]#

6. ลองเปิดเว็บเบราเซอร์เพื่อเข้าใช้งาน โดยพิมพ์ที่่ Address bar ให้เป็นไอพีแอดเดรสของ server หรือจะพิมพ์เป็นชื่อก็ได้ หากได้ทําการตั้งค่า dns ไว้ก่อนแล้ว

http://mail.rmutl.com สําหรับสมาชิกใช้งานทั่วไป

(admin ถ้า login ตรงนี้ก็ถือว่าเป็นผู้ใช้งานทั่วไปนะครับ)

https://mail.rmutl.com:7071 สําหรับผู้ดูแลระบบ ในส่วนนี้ จะสามารถแก้ไขปรับแต่งค่าได้ตามใจชอบเลยครับ

7. ตัวอย่าง หน้าเว็บของสมาชิกทั่วไป

8. ตัวอย่างหน้าเว็บไซต์สําหรับผู้ดูแลระบบ

9. หากใครที่เข้าหน้าเว็บไม่ได้ ให้ไปดู iptablesด้วยนะครับ

10. การรับ e-mail ขึ้นอยู่กับ mx ของโดเม็น หากรับไม่ได้ ต้องเช็คที่ mx ก่อนนะครับ

Linux Terminal Server ProjectLinux Terminal Server Projectเป็นโครงการที่พัฒนาระบบแม่ข่าย Linuxเพื่อให้รองรับการบริการผ่านเทอมินอลโดยเครื่องเทอมินอลสามารถจะใช้บริการโปรแกรมต่าง ๆ จากเครื่องแม่ข่าย ผ่านเครื่องเทอมินอลได้ โดยการประมวลผลจะ

ประมวลผลที่เครื่องแม่ข่ายทั้งสิ้น

ซึ่งทําให้ประหยัดทรัพยากรด้านฮาร์ดแวร์ได้เป็นอย่างดีอีกทั้งขั้นตอนการติดตั้งไม่ยาก จึงทําให้ได้รับความนิยมอย่างมาก

การติดตั้งสามารถทําได้ตามขั้นตอนดังนี้ (PDF)

ดาวน์โหลดคู่มือการติดตั้งได้ที่นี่ [download id=”31″]

วงจรคอนเฟอเร้นทร์ ไปเขตพื้นที่พิษณุโลกขัดข้อง

เมื่อเวลา 04.30 น. ของเช้าวันที่ 11กุมภาพันธ์ 2554 วงจรคอนเฟอเร้นทร์เขตพื้นที่พิษณุโลกขัดข้อง ซึ่งได้แจ้งไปยังผู้ประสานงานของ 3BB และทําการแก้ไขเสร็จ

เรียบร้อยแล้วที่เวลา 10.15 น.

ขณะนี้สามารถใช้งานได้ตามปกติ

รวมระยะเวลา 6 ชั่วโมง 45 นาที

OpenVPN บน CentOS 5.5 amd 64มีหลาย ๆ ท่านสอบถามมาเยอะเหลือเกินครับว่าจะทํา Linux เป็น VPN Server ได้หรือเปล่า ถ้าทําได้ ทํายังไง เพราะหลาย ๆท่านยังคงคุ้นเคยกับหน้ากราฟฟิคของระบบ

ปฏิบัติการวินโดว์ พอมาเจอ Text Mode ถึงกับตกใจกันเป็นแถว

ตัวที่ใช้ทํา vpnserver ก็คือ openvpn นั่นเอง (พูดถึงเรื่องนี้แล้ว ผมเห็นแพ็คเก็จ openvpn-as เลยลองติดตั้งดู โอว มันเป็น vpn ที่บริหารจัดการผ่านเว็บได้เลย แต่เสียดาย ให้ใช้งานได้แค่ 2 user เท่านั้นเอง)ขั้นตอนการติดตั้งก็ไม่ยากเท่าไหร่ ซึ่งผมก็อาศัยrpmforge เป็นตัวช่วยในการติดตั้ง

ข้อมูลเบื้องต้นสําหรับการติดตั้งในครั้งนี้

1. Linux CentOS 5.5 amd 64 ติดตั้งเฉพาะกรุ๊ปแพ็คเก็จServer เท่านั้น อื่น ๆ ไม่เอาทั้งสิ้น

2. IP Server 192.168.1.10

3. Client เป็น Windows 7 (32bit อืม ลืมบอกไปอย่างผมทดสอบกับ 64 bit ไม่ผ่านนะครับ) ไอพีอะไรก็ได้ ขอให้ Ping เจ้า Server นี่ให้เจอก็พอครับ

ที่เครื่อง Server

1. ดาวน์โหลด repo ได้จากที่นี่ครับ http://packages.sw.be/rpmforge-release/ เลือกให้ตรงกับ OSของเรา

[root@vpn ~]# wgethttp://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

2. ทําการติดตั้ง repo โดยใช้คําสั่ง rpm

[root@vpn ~]# lsanaconda-ks.cfg install.log install.log.syslog mbox rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm[root@vpn ~]# rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpmwarning: rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm: Header

V3 DSA signature: NOKEY, key ID 6b8d79e6Preparing… ########################################### [100%]1:rpmforge-release ########################################### [100%][root@vpn ~]#

3. ทําการทดลองค้นหาแพ็คเก็จโดยใช้คําสั่ง yum

[root@vpn ~]# yum search openvpnLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile* addons: mirror.issp.co.th* base: mirror.issp.co.th* extras: mirror.issp.co.th* rpmforge: fr2.rpmfind.net* updates: mirror.issp.co.th=============================== Matched: openvpn===============================kvpnc.x86_64 : Frontend for various VPN clientsopenvpn.x86_64 : secure tunneling daemon

4. เมื่อเจอแพ็คเก็จที่ต้องการแล้ว ก็ให้ทําการติดตั้งได้ทันที ซึ่งการใช้คําสั่ง yum นั้น นอกจากจะติดตั้งแพ็คเก็จที่เราต้องการแล้ว ตัว yum ยังสามารถไปดึงแพ็คเก็จอื่น ๆ ตามที่มันต้องการอีกด้วย ทําให้สะดวกอย่างมากในการติดตั้งซอฟแวร์ต่าง ๆ

[root@vpn ~]# yum -y install openvpnLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile* addons: mirror.issp.co.th* base: mirror.issp.co.th* extras: mirror.issp.co.th* rpmforge: apt.sw.be* updates: mirror.issp.co.thrpmforge

| 1.1 kB 00:00rpmforge/primary | 2.1 MB 00:02rpmforge 10272/10272Setting up Install ProcessResolving Dependencies–> Running transaction check—> Package openvpn.x86_64 0:2.1.4-1.el5.rf set to be updated–> Processing Dependency: lzo for package: openvpn–> Processing Dependency: liblzo2.so.2()(64bit) for package:openvpn–> Running transaction check—> Package lzo.x86_64 0:2.04-1.el5.rf set to be updated–> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================Package Arch Version Repository Size=====================================================================================Installing:openvpn x86_64 2.1.4-1.el5.rf rpmforge 442 kInstalling for dependencies:lzo x86_64

2.04-1.el5.rf rpmforge 139 k

Transaction Summary=====================================================================================Install 2 Package(s)Upgrade 0 Package(s)

Total download size: 581 kDownloading Packages:(1/2):lzo-2.04-1.el5.rf.x86_64.rpm | 139 kB 00:01(2/2):openvpn-2.1.4-1.el5.rf.x86_64.rpm | 442 kB 00:01————————————————————————————————————————————————————Total 187 kB/s | 581 kB 00:03Running rpm_check_debugRunning Transaction TestFinished Transaction TestTransaction Test SucceededRunning TransactionInstalling :lzo 1/2Installing :openvpn 2/2

Installed:

openvpn.x86_64 0:2.1.4-1.el5.rf

Dependency Installed:lzo.x86_64 0:2.04-1.el5.rf

Complete![root@vpn ~]#

5. เมื่อติดตั้งเสร็จแล้วจะมีไฟล์ตัวอย่างคอนฟิกบางส่วนอยู่ที่ /usr/share/doc/openvpn-2.1.4/

[root@vpn ~]# cd /usr/share/doc/openvpn-2.1.4/[root@vpn openvpn-2.1.4]# lsAUTHORS COPYRIGHT.GPL PORTS README.pluginsChangeLog easy-rsa README sample-config-filescontrib INSTALL README.auth-pam sample-keysCOPYING NEWS README.down-root sample-scripts[root@vpn openvpn-2.1.4]#

6. OpenVPN มีความจําเป็นต้องใช้ Certificate ในการยืนยันความน่าเชื่อถือทั้ง Server และ Client ดังนั้นจึงต้องสร้าง Cert ขึ้นมาก่อน โดยทําตามขั้นตอนดังนี้

root@vpn openvpn-2.1.4]# cd easy-rsa/2.0/[root@vpn 2.0]# lsbuild-ca build-inter build-key-pass build-key-server build-req-pass inherit-inter Makefile openssl.cnf README sign-req whichoopensslcnfbuild-dh build-key build-key-pkcs12 build-req clean-all list-crl openssl-0.9.6.cnf pkitool revoke-full vars

[root@vpn 2.0]# vi vars

7. แก้ไขไฟล์ vars สําหรับการสร้าง Cert (เฉพาะส่วนที่

จําเป็น อยู่ล่างสุดของไฟล์) อาจจะใช้ vi ในการแก้ไข หรือ pico ก็แล้วแต่ถนัดครับ เมื่อแก้ไขเสร็จแล้วก็บันทึกแล้วออกจากไฟล์ครับ

# These are the default values for fields# which will be placed in the certificate.# Don’t leave any of these fields blank.export KEY_COUNTRY=”TH”export KEY_PROVINCE=”Chiangmai”export KEY_CITY=”Chiangmai”export KEY_ORG=”RMUTL”export KEY_EMAIL=”[email protected]

8. เปลี่ยนโหมดของไฟล์ให้สามารถรันได้ดังนี้

[root@vpn 2.0]# chmod +x *

9. สร้าง Cert โดยทําตามขั้นตอนดังต่อไปนี้ มันยาวไปหน่อย ผมจะไฮไลท์ สีแดงกับนํ้าเงินให้นะครับ สีแดงคือคําสั่ง สีนํ้าเงิน คือสิ่งที่ต้องกรอกครับ

[root@vpn 2.0]# source ./varsNOTE: If you run ./clean-all, I will be doing a rm -rf on/usr/share/doc/openvpn-2.1.4/easy-rsa/2.0/keys[root@vpn 2.0]# ./clean-all[root@vpn 2.0]# ls -l keys/total 4-rw-r–r– 1 root root 0 Feb 10 13:21 index.txt-rw-r–r– 1 root root 3 Feb 10 13:21 serial[root@vpn 2.0]# ./build-caGenerating a 1024 bit RSA private key………………..++++++……………………………………………………..++++++writing new private key to ‘ca.key’—–You are about to be asked to enter information that will beincorporated

into your certificate request.What you are about to enter is what is called a DistinguishedName or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter ‘.’, the field will be left blank.—–Country Name (2 letter code) [TH]:State or Province Name (full name) [Chiangmai]:Locality Name (eg, city) [Chiangmai]:Organization Name (eg, company) [RMUTL]:Organizational Unit Name (eg, section) []:RMUTLCommon Name (eg, your name or your server’s hostname) [RMUTLCA]:vpn.rmutl.ac.thName []:vpn.rmutl.ac.thEmail Address [[email protected]]:[root@vpn 2.0]# ls -l keys/total 12-rw-r–r– 1 root root 1424 Feb 10 13:22 ca.crt-rw——- 1 root root 891 Feb 10 13:22 ca.key-rw-r–r– 1 root root 0 Feb 10 13:21 index.txt-rw-r–r– 1 root root 3 Feb 10 13:21 serial[root@vpn 2.0]# ./build-key-server vpn.rmutl.ac.thGenerating a 1024 bit RSA private key………………………………………………..++++++………………………….++++++writing new private key to ‘vpn.rmutl.ac.th.key’—–You are about to be asked to enter information that will beincorporatedinto your certificate request.What you are about to enter is what is called a DistinguishedName or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,If you enter ‘.’, the field will be left blank.—–

Country Name (2 letter code) [TH]:State or Province Name (full name) [Chiangmai]:Locality Name (eg, city) [Chiangmai]:Organization Name (eg, company) [RMUTL]:Organizational Unit Name (eg, section) []:RMUTLCommon Name (eg, your name or your server’s hostname)[vpn.rmutl.ac.th]:Name []:vpn.rmutl.ac.thEmail Address [[email protected]]:

Please enter the following ‘extra’ attributesto be sent with your certificate requestA challenge password []:An optional company name []:Using configuration from /usr/share/doc/openvpn-2.1.4/easy-rsa/2.0/openssl.cnfCheck that the request matches the signatureSignature okThe Subject’s Distinguished Name is as followscountryName :PRINTABLE:’TH’stateOrProvinceName :PRINTABLE:’Chiangmai’localityName :PRINTABLE:’Chiangmai’organizationName :PRINTABLE:’RMUTL’organizationalUnitName:PRINTABLE:’RMUTL’commonName :PRINTABLE:’vpn.rmutl.ac.th’name :PRINTABLE:’vpn.rmutl.ac.th’emailAddress :IA5STRING:’[email protected]’Certificate is to be certified until Feb 7 06:23:57 2021 GMT(3650 days)Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]yWrite out database with 1 new entriesData Base Updated[root@vpn 2.0]#

[root@vpn 2.0]# ls -l keys/total 48

-rw-r–r– 1 root root 4200 Feb 10 13:24 01.pem-rw-r–r– 1 root root 1424 Feb 10 13:22 ca.crt-rw——- 1 root root 891 Feb 10 13:22 ca.key-rw-r–r– 1 root root 148 Feb 10 13:24 index.txt-rw-r–r– 1 root root 21 Feb 10 13:24 index.txt.attr-rw-r–r– 1 root root 0 Feb 10 13:21 index.txt.old-rw-r–r– 1 root root 3 Feb 10 13:24 serial-rw-r–r– 1 root root 3 Feb 10 13:21 serial.old-rw-r–r– 1 root root 4200 Feb 10 13:24 vpn.rmutl.ac.th.crt-rw-r–r– 1 root root 745 Feb 10 13:23 vpn.rmutl.ac.th.csr-rw——- 1 root root 887 Feb 10 13:23 vpn.rmutl.ac.th.key[root@vpn 2.0]# cat keys/vpn.rmutl.ac.th.key—–BEGIN RSA PRIVATE KEY—–MIICXQIBAAKBgQC3FvB9xhcMjFXl/H9cCA5fteVmHwu+BzioudyNMj33zRF11WGKwYmtp1C2biSHtsm66y4JqE3t6/oNBhKHhtAwpYmDHuHXPo15VKmH/DkaeouROrbcCYy/eF0dmKc0ugOj4WwjY7233611mKY5wM9acGyEfbVQJioF1mjGV13oTwIDAQABAoGAAzlSLsTILx5hfNU/YN17c0/+pBez2zrBUqdDLPFPigeAYTTKrOjPhdFGaI/z8LfVQYdWnjDqfmADXStYNC65h7oh/Ll5n4jM9nVLPf3ROB1zqGeP7k1ZuzfrQNm0yGsl870a3vDXUUiLs0A7GsQ4BvNnkb5acLCHjgnEY0oazgECQQDeHY4biDrwtaBJcHKNlDo80hl4RpV55pFB6kxtgi03XnixCjlwHEYM97Gklw37/MPoNfIs7gINLDKyMK2BvaDPAkEA0wVHNkuh+lJ3YOsn1N080fZIdZvJKScp2oDYDfGJFBaNcz33U2gu288ZmQb2rZNTqdEovP6Ico85VkKCw2oggQJBAJJ9XZcM7wqITzGARxzXEN3CF2g67SSbi1u0wjlLLLUiymjA/IbTLuQojHGn6mIyH6bLxXAafSHg74KUFirGPQMCQEWygpjOVkulnURnpxpJkGMQ41HlCIYNJ2fCEppYYpw97q5Xky77RC7Zsmy2vhcKiCGYscnqkAq2f4ucIDCHBwECQQDIWxF7c4QIFdaf4ZWUZGOuo7LO/dsjPiUuyg0FBsA1

lOFAhiCH8ZRErTejC3mLB/HdYL43futnhvix/YEDqoxr—–END RSA PRIVATE KEY—–[root@vpn 2.0]# cat keys/vpn.rmutl.ac.th.crtCertificate:Data:Version: 3 (0x2)Serial Number: 1 (0x1)Signature Algorithm: sha1WithRSAEncryptionIssuer: C=TH, ST=Chiangmai, L=Chiangmai, O=RMUTL, OU=RMUTL,CN=vpn.rmutl.ac.th/name=vpn.rmutl.ac.th/[email protected] Before: Feb 10 06:23:57 2011 GMTNot After : Feb 7 06:23:57 2021 GMTSubject: C=TH, ST=Chiangmai, L=Chiangmai, O=RMUTL, OU=RMUTL,CN=vpn.rmutl.ac.th/name=vpn.rmutl.ac.th/[email protected] Public Key Info:Public Key Algorithm: rsaEncryptionRSA Public Key: (1024 bit)Modulus (1024 bit):00:b7:16:f0:7d:c6:17:0c:8c:55:e5:fc:7f:5c:08:0e:5f:b5:e5:66:1f:0b:be:07:38:a8:b9:dc:8d:32:3d:f7:cd:11:75:d5:61:8a:c1:89:ad:a7:50:b6:6e:24:87:b6:c9:ba:eb:2e:09:a8:4d:ed:eb:fa:0d:06:12:87:86:d0:30:a5:89:83:1e:e1:d7:3e:8d:79:54:a9:87:fc:39:1a:7a:8b:91:3a:b6:dc:09:8c:bf:78:5d:1d:98:a7:34:ba:03:a3:e1:6c:23:63:bd:b7:df:ad:75:98:a6:39:c0:cf:5a:70:6c:84:7d:b5:50:26:2a:05:d6:68:c6:57:5d:e8:4fExponent: 65537 (0x10001)X509v3 extensions:X509v3 Basic Constraints:CA:FALSENetscape Cert Type:SSL ServerNetscape Comment:

Easy-RSA Generated Server CertificateX509v3 Subject Key Identifier:9B:37:63:86:89:D8:F5:9A:D6:A4:5F:8A:50:3A:E2:67:25:0D:18:14X509v3 Authority Key Identifier:keyid:8A:E7:4E:11:35:25:94:5E:F8:D3:E9:62:8E:E4:7B:00:32:57:80:5FDirName:/C=TH/ST=Chiangmai/L=Chiangmai/O=RMUTL/OU=RMUTL/CN=vpn.rmutl.ac.th/name=vpn.rmutl.ac.th/[email protected]:FC:A0:4D:C7:BE:EB:70:EA

X509v3 Extended Key Usage:TLS Web Server AuthenticationX509v3 Key Usage:Digital Signature, Key EnciphermentSignature Algorithm: sha1WithRSAEncryption5a:13:d3:d6:95:8c:5e:38:0e:1c:7a:a2:5d:8f:e2:40:0d:ab:5d:6f:6b:bc:09:fe:bb:97:fc:35:d0:e4:76:e2:1c:6c:c8:75:60:3f:44:e9:c2:ce:27:08:e4:18:b2:b2:5b:63:9c:6d:c5:36:7f:5a:5f:d4:b3:dd:5e:2f:35:04:09:c8:11:92:12:a7:64:50:56:18:cb:4a:f2:8d:b5:6d:b0:11:db:b8:1d:bb:44:9b:ec:11:99:27:3c:01:8e:b6:a6:b3:ba:26:d1:a9:69:cc:7d:31:2d:bc:d4:57:10:89:3a:8a:02:a9:da:fc:ca:94:0e:b8:d4:ac:3c:00:c3:ce—–BEGIN CERTIFICATE—–MIIETzCCA7igAwIBAgIBATANBgkqhkiG9w0BAQUFADCBrDELMAkGA1UEBhMCVEgxEjAQBgNVBAgTCUNoaWFuZ21haTESMBAGA1UEBxMJQ2hpYW5nbWFpMQ4wDAYDVQQKEwVSTVVUTDEOMAwGA1UECxMFUk1VVEwxGDAWBgNVBAMTD3Zwbi5ybXV0bC5hYy50aDEYMBYGA1UEKRMPdnBuLnJtdXRsLmFjLnRoMSEwHwYJKoZIhvcNAQkBFhJ0ZXBwYXBAcm11dGwuYWMudGgwHhcNMTEwMjEwMDYyMzU3WhcNMjEwMjA3MDYyMzU3WjCBrDELMAkGA1UEBhMCVEgxEjAQBgNVBAgTCUNoaWFuZ21haTESMBAGA1UEBxMJQ2hp

YW5nbWFpMQ4wDAYDVQQKEwVSTVVUTDEOMAwGA1UECxMFUk1VVEwxGDAWBgNVBAMTD3Zwbi5ybXV0bC5hYy50aDEYMBYGA1UEKRMPdnBuLnJtdXRsLmFjLnRoMSEwHwYJKoZIhvcNAQkBFhJ0ZXBwYXBAcm11dGwuYWMudGgwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALcW8H3GFwyMVeX8f1wIDl+15WYfC74HOKi53I0yPffNEXXVYYrBia2nULZuJIe2ybrrLgmoTe3r+g0GEoeG0DCliYMe4dc+jXlUqYf8ORp6i5E6ttwJjL94XR2YpzS6A6PhbCNjvbffrXWYpjnAz1pwbIR9tVAmKgXWaMZXXehPAgMBAAGjggF9MIIBeTAJBgNVHRMEAjAAMBEGCWCGSAGG+EIBAQQEAwIGQDA0BglghkgBhvhCAQ0EJxYlRWFzeS1SU0EgR2VuZXJhdGVkIFNlcnZlciBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUmzdjhonY9ZrWpF+KUDriZyUNGBQwgeEGA1UdIwSB2TCB1oAUiudOETUllF740+lijuR7ADJXgF+hgbKkga8wgawxCzAJBgNVBAYTAlRIMRIwEAYDVQQIEwlDaGlhbmdtYWkxEjAQBgNVBAcTCUNoaWFuZ21haTEOMAwGA1UEChMFUk1VVEwxDjAMBgNVBAsTBVJNVVRMMRgwFgYDVQQDEw92cG4ucm11dGwuYWMudGgxGDAWBgNVBCkTD3Zwbi5ybXV0bC5hYy50aDEhMB8GCSqGSIb3DQEJARYSdGVwcGFwQHJtdXRsLmFjLnRoggkA/KBNx77rcOowEwYDVR0lBAwwCgYIKwYBBQUHAwEwCwYDVR0PBAQDAgWgMA0GCSqGSIb3DQEBBQUAA4GBAFoT09aVjF44Dhx6ol2P4kANq11va7wJ/ruX/DXQ5HbiHGzIdWA/ROnCzicI5BiysltjnG3FNn9aX9Sz3V4vNQQJyBGSEqdkUFYYy0ryjbVtsBHbuB27RJvsEZknPAGOtqazuibRqWnMfTEtvNRXEIk6igKp2vzKlA641Kw8AMPO—–END CERTIFICATE—–[root@vpn 2.0]#

[root@vpn 2.0]#[root@vpn 2.0]#[root@vpn 2.0]# ./build-dhGenerating DH parameters, 1024 bit long safe prime, generator2This is going to take a long time………………………………………………………………++*++*++*[root@vpn 2.0]#[root@vpn 2.0]# ls -l keys/total 52-rw-r–r– 1 root root 4200 Feb 10 13:24 01.pem-rw-r–r– 1 root root 1424 Feb 10 13:22 ca.crt-rw——- 1 root root 891 Feb 10 13:22 ca.key-rw-r–r– 1 root root 245 Feb 10 13:25 dh1024.pem-rw-r–r– 1 root root 148 Feb 10 13:24 index.txt-rw-r–r– 1 root root 21 Feb 10 13:24 index.txt.attr-rw-r–r– 1 root root 0 Feb 10 13:21 index.txt.old-rw-r–r– 1 root root 3 Feb 10 13:24 serial-rw-r–r– 1 root root 3 Feb 10 13:21 serial.old-rw-r–r– 1 root root 4200 Feb 10 13:24 vpn.rmutl.ac.th.crt-rw-r–r– 1 root root 745 Feb 10 13:23 vpn.rmutl.ac.th.csr-rw——- 1 root root 887 Feb 10 13:23 vpn.rmutl.ac.th.key[root@vpn 2.0]#

[root@vpn 2.0]# ./build-key clientGenerating a 1024 bit RSA private key…………..++++++………………………….++++++writing new private key to ‘client.key’—–You are about to be asked to enter information that will beincorporatedinto your certificate request.What you are about to enter is what is called a DistinguishedName or a DN.There are quite a few fields but you can leave some blankFor some fields there will be a default value,

If you enter ‘.’, the field will be left blank.—–Country Name (2 letter code) [TH]:State or Province Name (full name) [Chiangmai]:Locality Name (eg, city) [Chiangmai]:Organization Name (eg, company) [RMUTL]:Organizational Unit Name (eg, section) []:RMUTLCommon Name (eg, your name or your server’s hostname)[client]:Name []:Email Address [[email protected]]:

Please enter the following ‘extra’ attributesto be sent with your certificate requestA challenge password []:An optional company name []:Using configuration from /usr/share/doc/openvpn-2.1.4/easy-rsa/2.0/openssl.cnfCheck that the request matches the signatureSignature okThe Subject’s Distinguished Name is as followscountryName :PRINTABLE:’TH’stateOrProvinceName :PRINTABLE:’Chiangmai’localityName :PRINTABLE:’Chiangmai’organizationName :PRINTABLE:’RMUTL’organizationalUnitName:PRINTABLE:’RMUTL’commonName :PRINTABLE:’client’emailAddress :IA5STRING:’[email protected]’Certificate is to be certified until Feb 7 06:27:42 2021 GMT(3650 days)Sign the certificate? [y/n]:y

1 out of 1 certificate requests certified, commit? [y/n]yWrite out database with 1 new entriesData Base Updated[root@vpn 2.0]#

10. ทําการคัดลอก Cert ที่สร้างเสร็จแล้วไปยัง/etc/openvpn/

[root@vpn 2.0]# cp -rf /usr/share/doc/openvpn-2.1.4/easy-rsa/2.0/keys/* /etc/openvpn/

11. ทําการคัดลอกไฟล์ตัวอย่างคอนฟิกของ Server ไปไว้ที่ /etc/openvpn/

[root@vpn 2.0]# cd /etc/openvpn/

[root@vpn openvpn]# cp /usr/share/doc/openvpn-2.1.4/sample-config-files/server.conf /etc/openvpn/

12. ทําการแก้ไขไฟล์ server.conf ที่คัดลอกมาให้เข้ากับเครื่องแม่ข่ายที่ตั้งไว้ (ในการทดสอบนี้ ของ่าย ๆ ก่อนนะครับ ดังนั้นจะแก้แค่ cert

เท่านั้น)

# Any X509 key manateppapgement system can be used.# OpenVPN can also use a PKCS #12 formatted key file# (see “pkcs12” directive in man page).ca ca.crtcert vpn.rmutl.ac.th.crtkey vpn.rmutl.ac.th.key # This file should be kept secret

# Diffie hellman parameters.# Generate your own with:# openssl dhparam -out dh1024.pem 1024# Substitute 2048 for 1024 if you are using# 2048 bit keys.dh dh1024.pem

13. สั่งให้ openvpn ทํางานโดยใช้คําสั่งดังนี้

[root@vpn openvpn]# service openvpn startStarting openvpn: [

OK ][root@vpn openvpn]#

15. ตรวจสอบ Interface จะสังเกตุว่ามี Tun เพิ่มขึ้นมา

[root@vpn openvpn]# ifconfigeth0 Link encap:Ethernet HWaddr C2:DE:48:D6:36:24inet addr:192.168.1.10 Bcast:10.0.1.255 Mask:255.255.255.0inet6 addr: fe80::c0de:48ff:fed6:3624/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:76748 errors:0 dropped:0 overruns:0 frame:0TX packets:8380 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:6582338 (6.2 MiB) TX bytes:997841 (974.4 KiB)

lo Link encap:Local Loopbackinet addr:127.0.0.1 Mask:255.0.0.0inet6 addr: ::1/128 Scope:HostUP LOOPBACK RUNNING MTU:16436 Metric:1RX packets:8 errors:0 dropped:0 overruns:0 frame:0TX packets:8 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:0RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

tun0 Link encap:UNSPEC HWaddr00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:100RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

[root@vpn openvpn]#

16. ทําการเปิดไฟวอล UTP 1194 (หรือจะลองปิดไปก่อนด้วยคําสั่ง iptables -F สําหรับทดลองใช้งานก่อนก็ได้

ครับ

ที่เครื่องลูกข่าย

1. ดาวน์โหลดซอฟแวร์ openvpn client ได้จากที่นี่http://openvpn.se/download.html (เลือกตัว openvpn-2.0.9-gui-1.0.3-install.exe นะครับ)

2. ทําการติดตั้งตามขั้นตอนปกติ

3. เปิด windows explorer ไปที่ C:\ProgramFiles\OpenVPN\sample-config

4. คัดลอกไฟล์ client.vpn ไปไว้ที่ C:\ProgramFiles\OpenVPN\config

5. คัดลอกไฟล์ client.crt , client.key และ ca.crt ที่สร้างจากเครื่องแม่ข่ายไปไว้ยัง C:\ProgramFiles\OpenVPN\config

6. ทําการแก้ไขไฟล์ C:\ProgramFiles\OpenVPN\config\client.vpn โดยใช้ text editor และทําการแก้ไขดังนี้

.

.

.

# The hostname/IP and port of the server.# You can have multiple remote entries# to load balance between the servers.remote 192.168.1.10 1194 หมายเหตุ 192.168.1.10 คือไอพีของเครื่องแม่ข่าย;remote my-server-2 1194

.

.

.

# SSL/TLS parms.# See the server config file for more# description. It’s best to use# a separate .crt/.key file pair# for each client. A single ca# file can be used for all clients.ca ca.crt ชื่อของไฟล์ ทั้ง 3ไฟล์ ต้องตรงกับที่คัดลอกมาจาก servercert client.crtkey client.key

7. ที่ system tray จะมีไอคอนของ openvpn คลิ๊กขวาแล้วเลือก connect

8. ถ้าไม่มีข้อผิดพลาด จะปรากฏไอคอนของ openvpn กลายเป็นสีเขียว และแสดงไอพีที่ทําการเชื่อมต่อออกมา

สร้างถังขยะสําหรับ LinuxCommand

เมื่อวานนี้รุ่นน้องผมโทรศัพท์มาหาผมด้วยเสียงประหม่าเล็กน้อย พูดกับผมว่าพี่ครับ ผมเผลอลบไฟล์ใน Linux ผมจะrestore กลับมาได้ยังไงครับ ผมก็เลยสอบถามข้อมูลเบื้องต้น ก็ได้ใจความว่าเครื่องเซิร์ฟเวอร์ เป็น SCSI ต่อ RAID กันอีก คงถอด HD ออกมาไม่ได้แน่ แถมยัง

เป็น Text mode อีก คงเอากลับมาได้ลําบากแน่ ๆ (ใครมีวิธีที่ดีกว่า บอกผมด้วยนะครับ อยากรู้เหมือนกัน)

ผมก็แนะนําให้ใช้ซอฟต์แวร์อื่นในการจัดการแล้ว ไม่รู้ว่าจะได้ผลยังไงเหมือนกันนะครับ

ในเมื่อเรารู้ว่าปัญหามันอาจจะต้องเกิดแบบนี้แล้วเราหาวิธีป้องกันดีกว่า โดยการสร้างถังขยะสําหรับ

Linux Command ไว้ เผื่อว่าเผลอลบมันอีกจะได้เอาคืนกลับมาได้ง่าย ๆ หน่อย ถังขยะ ที่ว่าคือ Trash-Cliครับ

root@Linux:~# apt-cache search trash-clitrash-cli – command line trashcan utilityroot@Linux:~# apt-get install trash-cliReading package lists… DoneBuilding dependency treeReading state information… DoneThe following packages were automatically installed and areno longer required:binutils-staticUse ‘apt-get autoremove’ to remove them.The following NEW packages will be installed:trash-cli0 upgraded, 1 newly installed, 0 to remove and 23 notupgraded.Need to get 0B/14.5kB of archives.After this operation, 143kB of additional disk space will beused.Selecting previously deselected package trash-cli.(Reading database … 81890 files and directories currentlyinstalled.)Unpacking trash-cli (from …/trash-cli_0.10.r55-0ubuntu1_all.deb) …Processing triggers for man-db …Setting up trash-cli (0.10.r55-0ubuntu1) …

Processing triggers for python-support …

root@Linux:~#

จากนั้นก็สร้าง Alias สําหรับถังขยะดังนี้

root@Linux:~#alias rm=trash

เรียบร้อยแล้วครับทดสอบการทํางานดังนี้ครับ ผมสร้างไฟล์ 12345.txt ไว้ที่ /root/12345.txt

จากนั้นก็ใช้คอมมานด์ rm ในการลบครับ rm/root/12345.txt

root@Linux:~# touch 12345.txtroot@Linux:~# ls12345.txtroot@Linux:~# rm 12345.txtroot@Linux:~# lsroot@Linux:~#

สังเกตุได้ว่าไฟล์ถูกลบไปเรียบร้อยแล้วนะครับ

ถ้าเราจะเอาคืนกลับมาก็ใช้คําสั่ง restore-trash ดังนี้

root@Linux:~# restore-trash0 2011-02-07 08:46:23 /root/12345.txtWhat file to restore [0..0]: 0 <– เลขศูนย์ คือ ลําดับของไฟล์ที่ต้องการ restoreroot@Linux:~# ls12345.txtroot@Linux:~#

เพียงเท่านี้ ก็จะได้ไฟล์กลับมาแล้วครับ