แสดงบทความที่มีป้ายกำกับ Linux แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ Linux แสดงบทความทั้งหมด

วันศุกร์ที่ 8 เมษายน พ.ศ. 2559

Install Cacti On CentOS 6.5

Install Wget
yum install wget -y

Install required packages
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

Install Apache
yum install httpd httpd-devel -y

Install MySQL
yum install mysql mysql-server -y

Install PHP
yum install php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-mysql -y 

Install PHP-SNMP
yum install php-snmp -y

Install NET-SNMP
yum install net-snmp-utils net-snmp-libs php-pear-Net-SMTP -y

Install RRDtool
yum install rrdtool -y


/etc/init.d/httpd start
/etc/init.d/mysqld start
/etc/init.d/snmpd start


chkconfig httpd on
chkconfig mysqld on
chkconfig snmpd on


Installing Cacti Tool
yum install cacti -y


Configure MySQL
mysql -u root -p
mysql> create database cacti;
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'centos';
mysql> flush privileges;
mysql> exit




rpm -ql cacti | grep cacti.sql
/usr/share/doc/cacti-0.8.8b/cacti.sql


mysql -u cacti -p cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql



vi /etc/cacti/db.php
$database_type = "mysql";
$database_default = "cacti"; ## Name of the Cacti Database ## 
$database_hostname = "localhost";
$database_username = "cacti"; ## Username for Cacti database ##
$database_password = "centos"; ## Database password ##$database_port = "3306";
$database_ssl = false;
:wq


Configure Apache server
vi /etc/httpd/conf.d/cacti.conf


<Directory /usr/share/cacti/>         
<IfModule mod_authz_core.c>                 
# httpd 2.4                 
Require host localhost     
    </IfModule>      
   <IfModule !mod_authz_core.c>         
        # httpd 2.2     
            Order deny,allow   
              Deny from all    
             Allow from 192.168.1.0/24   
      </IfModule> </Directory>

/etc/init.d/httpd restart

vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall 
# Manual customization of this file is not recommended. 
*filter 
:INPUT ACCEPT [0:0] 
:FORWARD ACCEPT [0:0] 
:OUTPUT ACCEPT [0:0] 
-A INPUT -p udp -m state --state NEW --dport 80 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW --dport 80 -j ACCEPT 
-A INPUT -p udp -m state --state NEW --dport 53 -j ACCEPT 
-A INPUT -p tcp -m state --state NEW --dport 53 -j ACCEPT 
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT 
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT 
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT

/etc/init.d/iptables restart

vi /etc/cron.d/cacti

*/5 * * * *     cacti   /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1


Run Cacti installer
http://ip-address/cacti

Ex. http://localhost/cacti

วันอาทิตย์ที่ 13 เมษายน พ.ศ. 2557

Instll OCS Inventory NG Server 2.1 on CentOS 6.5

1.yum update -y

2.rpm -ivH http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

3.yum install -y make wget httpd mysql mysql-server php php-gd php-mysql php-mbstring mod_perl perl-XML-Simple perl-Net-IP perl-SOAP-Lite perl-DBI perl-DBD-MySQL

4.yum install -y --enablerepo=epel perl-Apache-DBI perl-Apache2-SOAP perl-XML-Entities

5.mysql_install_db

6.chkconfig --level 345 mysqld on

7.service mysqld start

8.mysql_secure_installation

9.mysql -u root -p

10.CREATE DATABASE ocs;

11.GRANT ALL PRIVILEGES ON ocs.* to ocs@localhost IDENTIFIED BY '<somepassword>';

12.FLUSH PRIVILEGES;

13.QUIT

14.cd /root/

15.wget https://launchpadlibrarian.net/165057074/OCSNG_UNIX_SERVER-2.1.tar.gz

16.tar -xvzf OCSNG_UNIX_SERVER*.tar.gz

17.cd OCSNG_UNIX_SERVER*

18.sh ./setup.sh

19.vi /etc/httpd/conf.d/z-ocsinventory-server.conf
Change line 26 (OCS_DB_NAME) from 'ocsweb' to 'ocs'
Change line 27 (OCS_DB_LOCAL) from 'ocsweb' to 'ocs'
Change line 31 (OCS_DB_PWD) from 'ocs' to whatever you chose for your MySQL 'ocs' user password

20.vi /etc/sysconfig/iptables

21.-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

22.service iptables restart

23.chkconfig --level 345 httpd on

24.service httpd start

25.vi /etc/selinux/config
SELINUX=disabled

26.reboot

27.http://yourserver/ocsreports
Database: ocs
Username: ocs
Password: <somepassword>
Hostname: localhost

28.rm -f /usr/share/ocsinventory-reports/ocsreports/install.php

29. http://yourserver/ocsreports
Username: admin
Password: admin

วันพฤหัสบดีที่ 19 ธันวาคม พ.ศ. 2556

iSCSI Client and LVM Extend Size + Add disk on network ; Local


ADD Disk ON Network


------------------ iSCSI Client Install and Config ------------------ 
yum install iscsi-initiator-utils
vi /etc/iscsi/iscsid.conf

################
# iSNS settings
################
# Address of iSNS server
isns.address = 192.168.1.100
isns.port = 3260

# *************
# CHAP Settings
# *************

# To enable CHAP authentication set node.session.auth.authmethod
# to CHAP. The default is None.
node.session.auth.authmethod = CHAP

# To set a CHAP username and password for initiator
# authentication by the target(s), uncomment the following lines:
node.session.auth.username = userchapexample
node.session.auth.password = passchapexample

# To enable CHAP authentication for a discovery session to the target
# set discovery.sendtargets.auth.authmethod to CHAP. The default is None.
discovery.sendtargets.auth.authmethod = CHAP

# To set a discovery session CHAP username and password for the initiator
# authentication by the target(s), uncomment the following lines:
discovery.sendtargets.auth.username = userchapexample
discovery.sendtargets.auth.password = passchapexample

/etc/init.d/iscsi start
iscsiadm -m discovery -t sendtargets -p 192.168.1.100
/etc/init.d/iscsi restart
------------------ iSCSI Client Install and Config ------------------ 

------------------ Config New HardDisk------------------ 
fdisk  /dev/sdb

p --print ตรวจสอบ partition
n --create partition (primary 4)
p --create partition primary
1 --partition first
enter 
+100G --partition 1 กำหนดขนาดไซด์ให้เป็น 100 GB
t --เพื่อทำการเปลี่ยน type ของ partition
L --ทำการตรวจสอบ type ของ partition ทั้งหมดว่ามีอะไรบ้าง
8e --ทำการเปลี่ยน type เป็น LVM
w --บันทึกค่าทั้งหมดที่ทำการ set partition มา
------------------ Config New HardDisk------------------ 

------------------ Config PV ------------------ 
pvcreate /dev/sdb1
pvs
------------------ Config PV ------------------ 

------------------ Config VG ------------------ 
vgextend vg_cloud /dev/sdb1 ** จะเป็นการเพิ่ม physical เข้าไปยัง volumgroup
vgs
------------------ Config VG ------------------

------------------ Config LV ------------------
lvextend -L 277G /dev/vg_cloud/LogVol05
resize2fs -p /dev/vg_cloud/LogVol05
df -h 
------------------ Config LV ------------------





ADD Disk ON Local



เพิ่ม hdd บน vm esx ของ guest ที่ต้องการ **เพิ่ม disk ใหม่อีก 100 gb

restart guest 1 ครั้ง  

------------------ Config New HardDisk------------------ 
fdisk  /dev/sdc

p --print ตรวจสอบ partition
n --create partition (primary 4)
p --create partition primary
1 --partition first
enter 
+100G --partition 1 กำหนดขนาดไซด์ให้เป็น 100 GB
t --เพื่อทำการเปลี่ยน type ของ partition
L --ทำการตรวจสอบ type ของ partition ทั้งหมดว่ามีอะไรบ้าง
8e --ทำการเปลี่ยน type เป็น LVM
w --บันทึกค่าทั้งหมดที่ทำการ set partition มา
------------------ Config New HardDisk------------------ 

------------------ Config PV ------------------ 
pvcreate /dev/sdb1
pvs
------------------ Config PV ------------------ 

------------------ Config VG ------------------ 
vgextend vg_cloud /dev/sdb1 ** จะเป็นการเพิ่ม physical เข้าไปยัง volumgroup
vgs
------------------ Config VG ------------------

------------------ Config LV ------------------
lvextend -L 277G /dev/vg_cloud/LogVol05
resize2fs -p /dev/vg_cloud/LogVol05
df -h 
------------------ Config LV ------------------

วันอังคารที่ 17 ธันวาคม พ.ศ. 2556

User On Linux

useradd .... ** ตามด้วยชื่อ user (เพิ่ม user)
useradd user1
userdel .... ** ตามด้วยชื่อ user (ลบ user) ลบแค่ user ไฟล์ข้อมูลของ user ยังอยู่ใน /home
userdel user1
userdel -r ...  ** ตามด้วยชื่อ user (ลบ user) ลบทั้ง user และไฟล์ข้อมูลของ user
userdel -r user1

id ...  ** ตามด้วยชื่อ user (ดูข้อมูลของ user)
id user1
uid=500(user1) gid=500(user1) groups=500(user1)

vi /etc/login.defs **สามารถแก้ไขการตั้งค่าต่างๆของ user... เช่น อายุการใช้งานของ user

usermod -aG ตามด้วยชื่อgroup ตามด้วยชื่อuser
usermod -aG test1 user1

-a จะเป็นการเพิ่มค่าต่อจากค่าเดิมที่เคยมีอยู่
ถ้าไม่ใส่จะลบ group ก่อนหน้าด้วย

usermod -s /sbin/nologin user1
user1 ไม่สามารถ login เข้าสู่ระบบได้

cat /etc/group
ดู list group ว่ามีอะไรบ้าง

Access Control Lists

Access Control Lists เป็นการ Set เพื่อให้ Folder หรือ File นั้นมีสิทธิ์มากกว่า 1 สิทธิ์ในการใช้งาน
เนื่องจาก การ
chgrp
chown
กำหนดได้แค่ 1 user หรือ 1 group เท่านั้นในการจัดการไฟล์
แต่ถ้า Folder หรือ File ที่ต้องมีสิทธิ์ใช้งานมากกว่า 1 จะไม่สามารถจัดการได้
ดังนั้นจึงต้องมีการนำ Access Control Lists เข้ามาช่วย

เช่นถ้า Folder xxx ต้องการให้ group sale,manager,it,account เข้ามาใช้งาน
หรือ ไฟล์ sss ต้องการให้ user a,b,c,d,e เข้ามาใช้งานไฟล์นอกนั้นไม่สามารถใช้งานไฟล์ได้ ก็จะกำหนดไม่ได้จาก chown

เช็ค Package ACL
rpm -q acl

ถ้าไม่มี Package ให้ทำการติดตั้ง
yum install -y acl

โดยหลักๆ ACL จะมีในส่วนของการตั้งค่า และการดูค่า
setfacl  -เซตตามเงื่อนไขที่ต้องการ ตามด้วยสิทธิ์หรือuser group other ตามด้วยชื่อไฟล์หรือโฟลเดอร์
getfacl -เงื่อนไขที่่ต้องการ  ตามด้วยชื่อไฟล์หรือโฟลเดอร์


Ex.
groupadd test1
groupadd test2
useradd user1
useradd user2

mkdir /opt/folder
mkdir /opt/folder/f1
touch /opt/folder/file


getfacl /opt/folder/
# file: opt/folder/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x


getfacl /opt/folder/file
# file: opt/folder/file
# owner: root
# group: root
user::rw-
group::r--

other::r--

setfacl -m g:test1:rw /opt/folder
getfacl /opt/folder/
# file: opt/folder/
# owner: root
# group: root
user::rwx
group::r-x
group:test1:rw-  **เพิ่มขึ้นมา
mask::rwx  
other::r-x

ดังนั้น โฟลเดอร์
 /opt/folder จะมีสิทธิ์ คือ 
owner root rwx
group root r-x
group test1 rw-
ได้

setfacl -dm u:user1:rx /opt/folder
getfacl /opt/folder/
# file: /opt/folder/
# owner: root
# group: root
user::rwx
user:user1:r-x **owner
group::r-x **group
mask::r-x
other::r-x **other
default:user::rwx **owner:root
default:user:user1:r-x **owner:user1
default:group::r-x
default:mask::r-x

default:other::r-x

getfacl /opt/folder/f1 ** เป็นกรณีสร้าง Folder f1 หลังจาก setfacl -dm u:user1:rx /opt/folder ไปแล้ว
# file: /opt/folder/f1
# owner: root
# group: root
user::rwx  **owner
group::r-x  **group
mask::r-x
other::r-x  **other
default:user::rwx  **owner:root
default:user:user1:r-x  **owner:user1
default:group::r-x
default:mask::r-x

default:other::r-x


วันจันทร์ที่ 16 ธันวาคม พ.ศ. 2556

NTP Client

1. yum install -y ntp 
2. service ntpd start
3. vi /etc/ntp.conf
4. server 192.168.x.x  **เพิ่มค่า 
5 .กด esc ตามด้วย wq เพราะเซฟค่าและออกจาก vi
6. service ntpd restart
7. chkconfig ntpd on

8. ntpq -p **เพื่อเช็คดูว่า sync time ให้แล้วหรือยัง
9. ntpdate -u 192.168.x.x **ถ้ายังสามารถ บังคับให้ sync ได้

Permission Linux

owner   rwx        u
group    rwx        g
other     rwx        o
                           a

rwx ให้มองเป็น r = 4, w = 2,x = 1

r   = อ่านไฟล์หรือโฟลเดอร์ได้
w  = เขียนไฟล์หรือโฟลเดอร์ได้
x   = กระทำต่อไฟล์หรือโฟลเดอร์ได้(ใช้ในการรันไฟล์) 

คำสั่งที่เกี่ยวข้องกับเรื่องการเปลี่ยนสิทธิ์ไฟล์ โฟร์เดอร์

chmod ใช้ในการเปลี่ยนสิทธิ์การเข้าถึงไฟล์หรือโฟลเดอร์
chgrp   ใช้ในการเปลี่ยนสิทธิ์ของกลุ่มที่จะเข้าถึงไฟล์หรือโฟลเดอร์
chown  ใช้ในการเปลี่ยนสิทธิ์ของเจ้าของไฟล์หรือโฟลเดอร์

ex. 

สร้างโฟลเดอร์ชื่อว่า folder 
mkdir /opt/folder

โดยสร้างมาครั้งแรกสิทธิ์จะเป็น 
drwxr-xr-x 2 root root 4096 dec 16 09:00 folder

d ย่อยมาจาก directory = เป็นตัวบอกว่าเป็นโฟลเดอร์
rwx เป็นสิทธิ์ของส่วน owner
r-x เป็นสิทธิ์ของ group
r-x เป็นสิทธิ์ของ other

root แรกคือ owner
root ที่สองคือ group


chmod 750 /opt/folder 
จะเป็นการเปลี่ยนสิทธิ์โฟลเดอร์ที่ชื่อว่า folder โดยสิทธิ์จะเป็น owner มีสิทธิ์ rwx ส่วน group จะมีสิทธิ์เป็น r-x และ other จะไม่มีสิทธิ์ทำไรเลย
drwxr-x--- 2 root sales 4096 dec 16 09:00 folder

ถ้าเป็น chmod -R 750 /opt/folder 
จะเป็นการกำหนดสิทธิ์ให้ sub folder ด้านในทั้งหมดให้เป็นสิทธิ์เดียวกัน
ถ้าเทียบในเชิง windows จะเป็นการ inheritance ข้อมูล

groupadd sales
chgrp sales /opt/folder
drwxr-x--- 2 root sales 4096 dec 16 09:00 folder

useradd user1
chown user1
drwxr-x--- 2 user1 sales 4096 dec 16 09:00 folder

user1 สามารถ อ่าน เขียน และรันไฟล์ ในโฟลเดอร์ที่ชื่อว่า folder ได้
group sales สามารถ อ่าน และรันไฟล์ ในโฟลเดอร์ที่ชื่อว่า folder ได้
นอกเหนือจาก user ที่ชื่อว่า user1 และ user ที่ไม่ได้อยู่ใน group ของ sales ไม่สามารถทำไรได้


chmod u+x /opt/folder  เพิ่มสิทธิ์ให้ owner Execute ได้
chmod u-w /opt/folder  ลดสิทธิ์ให้ owner Execute ไม่ได้
chmod a+x     /opt/folder   เพิ่มสิทธิ์ให้ owner group other Execute ได้
chmod g-w /opt/folder   ลดสิทธิ์ให้ group Execute ไม่ได้
chmod o-w /opt/folder  ลดสิทธิ์ให้ other Execute ไม่ได้

วันศุกร์ที่ 13 ธันวาคม พ.ศ. 2556

Config Database Mysql + Alfresco

######################  Config Mysql Database ####################
1. yum -y install mysql-server
2. service mysqld start
3. chkconfig mysqld on
4. /usr/bin/mysql_secure_installation
         hit “enter” to give no password
generate and save a new root password
5. service mysqld restart
6. mysql -u root -p
7. CREATE DATABASE alfresco DEFAULT CHARACTER SET utf8;
8. FLUSH PRIVILEGES;
9. exit
10. vi /etc/my.cnf
      [client]
      default-character-set=utf8
      [mysql]
      default-character-set=utf8
      [mysqld]
      collation-server = utf8_unicode_ci
      init-connect='SET NAMES utf8'
      character-set-server = utf8
11. กด esc ตามด้วย :wq
######################  Config Mysql Database ####################

######################  Config Alfresco ####################
12. wget http://eu.dl.alfresco.com/release/community/build-4848/alfresco-community-4.2.e-installer-linux-x64.bin
13. chmod +x alfresco-community-4.2.e-installer-linux-x64.bin
14. yum install -y libXrender libSM libICE libXext fontconfig cups-libs
15. ./alfresco-community-4.2.e-installer-linux-x64.bin
16.      กด 2 install แบบ Advanced
17. Java [Y/n] :Y
18. PostgreSQL [Y/n] :n
19. Alfresco : Y
20. SharePoint [Y/n] :Y
21. Web Quick Start [y/N] : Y
22. OpenOffice [Y/n] :Y
23. Is the selection above correct? [Y/n]: Y
24. Select a folder [/opt/alfresco-4.0.e]: /opt/alfresco
25. JDBC URL: [jdbc:postgresql://localhost/alfresco]: jdbc:mysql://localhost:3306/alfresco
26. JDBC Driver: [org.postgresql.Driver]: org.gjt.mm.mysql.Driver
27. Database name: [alfresco]:  กด Enter ได้เลย คือเลือกเอา Database name ชื่อ alfresco
28. Username: []: root
29. Password: :
30. Verify: :
31. Web Server domain: [127.0.0.1]:
32. Tomcat Server Port: [8080]: ** สามารถแก้ไข port ได้
33. Tomcat Shutdown Port: [8005]: ** สามารถแก้ไข port ได้
34. Tomcat SSL Port [8443]: ** สามารถแก้ไข port ได้
35. Tomcat AJP Port: [8009]: ** สามารถแก้ไข port ได้
36. Port: [21]: ** สามารถแก้ไข port ได้
37. Port: [50500]: ** สามารถแก้ไข port ได้
38. Admin Password: :
39. Repeat Password: :
40. Install Alfresco Community as a service? [Y/n]: Y
41. OpenOffice Server port [8100]:
42. Do you want to continue? [Y/n]: Y
43. View Readme File [Y/n]: Y
44. Launch Alfresco Community Share [Y/n]: Y
45. wget http://mirror.cogentco.com/pub/mysql/Connector-J/mysql-connector-java-5.1.27.tar.gz
46. tar zxvf mysql-connector-java-5.1.27.tar.gz
47. cp /root/mysql-connector-java-5.1.27/mysql-connector-java-5.1.27-bin.jar /opt/alfresco/tomcat/lib
######################  Config Alfresco ####################


######################  เปิดการกำหนด Quota ####################
48. find / -name 'repository.properties'
49. vi /opt/alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties
50.      กด esc ตามด้วย :/system.usages.enabled
51. system.usages.enabled=true เปลี่ยนจาก false เป็น true
52. service alfresco restart
######################  เปิดการกำหนด Quota ####################

######################   Email inbound  ####################
53. cd /opt/alfresco/tomcat/shared/classes
54. vi alfresco-global.properties
55. # Enable/Disable the inbound email service.  The service could be used by processes other than
# the Email Server (e.g. direct RMI access) so this flag is independent of the Email Service.
#-------------
email.inbound.enabled=true
# Email Server properties
#-------------
email.server.enabled=true
email.server.port=25
email.server.domain=ec2-72-44-49-158.compute-1.amazonaws.com
email.inbound.unknownUser=emailAnon
email.server.connections.max=3
email.server.enableTLS=false
# A comma separated list of email REGEX patterns of allowed senders.
# If there are any values in the list then all sender email addresses
# must match. For example:
#   .*\@alfresco\.com, .*\@alfresco\.org
# Allow anyone:
#-------------
email.server.allowed.senders=.*
56.      กด esc ตามด้วย :/wq
57. service alfresco restart
######################   Email inbound  ####################


######################   Email outbound  ####################
58. cd /opt/alfresco/tomcat/shared/classes
59. vi alfresco-global.properties
60. mail.host=smtp.gmail.com
61. mail.port=465
62. mail.username=user@gmail.com
63. mail.password=password
64. mail.protocol=smtps
65. mail.smtps.starttls.enable=true
66. mail.smtps.auth=true
67. กด esc ตามด้วย :/wq
68. service alfresco restart
######################   Email outbound  ####################



วันอังคารที่ 19 พฤศจิกายน พ.ศ. 2556

install snmp

snmp

yum install net-snmp-utils net-snmp
chkconfig snmpd on
mv /etc/snmp/snmpd.conf /root
touch /etc/snmp/snmpd.conf
vi /etc/snmp/snmpd.conf
rocommunity public

Video Conferece Install

Video Conferece Install

  OS-> CentOS 6.4
  Software -> Openmeeting

install JRE
===============
1. tar xzvf jre-7u45-linux-x64.tar.gz
2. mkdir -p -v /opt/java/64
3.  mv jre1.7.0_45/ /opt/java/64/
4. update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.7.0_45/bin/java" 1
5. update-alternatives --set java /opt/java/64/jre1.7.0_45/bin/java

install openmeeting
===============
1. wget http://www.sai.msu.su/apache/openmeetings/2.1.1/bin/apache-openmeetings-2.1.1.zip
2. mkdir /opt/openmeeting/
3. cd /opt/openmeeting/
4. unzip /root/apache-openmeetings-2.1.1.zip
5. ./red5.sh

http://ip-server:5080/openmeetings/install ทำการติดตั้งและตั้ง user password สำหรับ manage openmeeting

หลังจากนั้น ทำการ ใช้งานได้ปรกติครับ  http://ip-server:5080/openmeetings


** ถ้าจะ shutdown red5
      red5-shutdown .sh

และถ้า Start red5 แล้วมี error ลองแก้ไขไฟล์
vi /etc/hosts ให้ถูกต้องก่อนครับ แล้วลอง run red5.sh อีกที


วันอาทิตย์ที่ 17 พฤศจิกายน พ.ศ. 2556

วิธีแก้ไขปัญหาMysqlพิมภาษาไทยแล้วมีปัญหา(CentOS)

ให้ทำการเข้าไปแก้ไขที่ไฟล์

  vi /etc/my.cnf

[mysqld]

 collation-server = utf8_unicode_ci
 init-connect = 'SET NAMES utf8'
 character-set-server = utf8

IM Server Install

  ขอเกริ่นหน่อยละกันนะครับก่อนที่จะมาบอกขั้นตอน และวิธีในการทำ IM Server
IM -> Instant messaging ก็อย่างที่ทุกๆท่าน เคยใช้งานและคุ้นเคยก็คงจะเป็น MSN, Google Talk, ... แต่ถ้าจะนำมาใช้งานกับภายในองค์กรณ์ หรือนำมาใช้งานกันเอง... แล้วละก็ ก็คงอยากจะทำเป็น Server ของตัวเองใช่ไม

  มาเริ่มกันเลยดีกว่าสำหรับขั้นตอนการทำ IM Server IM -> Instant messaging อันนี้ OS ที่ใช้เป็น CentOS 6.4 Software ที่ใช้เป็น Openfire V.3.8.2

Configure eth0 # # vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"
ONBOOT=yes
BOOTPROTO=static
NAME="System eth0"
IPADDR=192.168.50.200  ...สามารถตั้งได้เองเลยครับ อันนี้ผมเพียงแค่ยกตัวอย่าง IP
NETMASK=255.255.255.0

Configure Default Gateway # #
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=centos6
GATEWAY=192.168.50.254
## Restart Network Interface #
 service network restart
 ## Configure DNS Server # #
vi /etc/resolv.conf
nameserver 192.168.50.2 # Replace with your nameserver ip
nameserver 192.168.50.3 # Replace with your nameserver ip

 yum -y install wget java glibc.i686

 wget http://download.igniterealtime.org/openfire/openfire-3.8.2-1.i386.rpm

 yum -y install ./openfire-3.8.2-1.i386.rpm

 service openfire start

 chkconfig --level 235 openfire on

 yum -y install mysql-server

 service mysqld start

 chkconfig mysqld on

 /usr/bin/mysql_secure_installation

 hit “enter” to give no password generate and save a new root password

 service mysqld restart

 /usr/bin/mysql -u root -p

 CREATE DATABASE openfire;

 INSERT INTO mysql.user (User,Host,Password)

VALUES(‘username’,’127.0.0.1?,PASSWORD(‘securepassword’));

 FLUSH PRIVILEGES;

 GRANT ALL PRIVILEGES ON openfire.* to openfire@127.0.0.1;

 FLUSH PRIVILEGES;

 exit

 service iptables stop

 chkconfig iptables stop

 http://192.168.50.200:9090

 Login : Default จะเป็น User:admin Pass:admin