Skip to main content
การติดตั้ง Web Server บน CentOS 6.5

1. ทำการติดตั้งด้วยคำสั่ง groupinstall ดังนี้

[root@ldap SYSADMIN]# yum groupinstall 'Web Server' -y
[root@ldap SYSADMIN]# yum groupinstall 'PHP Support' -y
[root@ldap SYSADMIN]# yum groupinstall 'Perl Support' -y

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink | 3.5 kB 00:00
* base: mirrors.thzhost.com
* epel: mirror.nus.edu.sg
* extras: mirrors.thzhost.com
* updates: mirrors.thzhost.com
epel | 4.4 kB 00:00
epel/primary_db | 6.1 MB 00:13
Setting up Group Process
Checking for new repos for mirrors
base/group_gz | 220 kB 00:00
epel/group_gz | 237 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package crypto-utils.x86_64 0:2.4.1-24.2.el6 will be installed
--> Processing Dependency: perl(Newt) for package: crypto-utils-2.4.1-24.2.el6.x86_64
---> Package httpd.x86_64 0:2.2.15-30.el6.centos will be installed
--> Processing Dependency: httpd-tools = 2.2.15-30.el6.centos for package: httpd-2.2.15-30.el6.centos.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-30.el6.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-30.el6.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-30.el6.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-30.el6.centos.x86_64
---> Package httpd-manual.noarch 0:2.2.15-30.el6.centos will be installed
---> Package mod_perl.x86_64 0:2.0.4-11.el6_5 will be installed
--> Processing Dependency: perl(ExtUtils::MakeMaker) for package: mod_perl-2.0.4-11.el6_5.x86_64
--> Processing Dependency: perl(BSD::Resource) for package: mod_perl-2.0.4-11.el6_5.x86_64
---> Package mod_ssl.x86_64 1:2.2.15-30.el6.centos will be installed
---> Package mod_wsgi.x86_64 0:3.2-3.el6 will be installed
---> Package webalizer.x86_64 0:2.21_02-3.3.el6 will be installed
--> Processing Dependency: libpng12.so.0()(64bit) for package: webalizer-2.21_02-3.3.el6.x86_64
--> Processing Dependency: libgd.so.2()(64bit) for package: webalizer-2.21_02-3.3.el6.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package gd.x86_64 0:2.0.35-11.el6 will be installed
--> Processing Dependency: libjpeg.so.62()(64bit) for package: gd-2.0.35-11.el6.x86_64
--> Processing Dependency: libfreetype.so.6()(64bit) for package: gd-2.0.35-11.el6.x86_64
--> Processing Dependency: libfontconfig.so.1()(64bit) for package: gd-2.0.35-11.el6.x86_64
--> Processing Dependency: libXpm.so.4()(64bit) for package: gd-2.0.35-11.el6.x86_64
--> Processing Dependency: libX11.so.6()(64bit) for package: gd-2.0.35-11.el6.x86_64
---> Package httpd-tools.x86_64 0:2.2.15-30.el6.centos will be installed
---> Package libpng.x86_64 2:1.2.49-1.el6_2 will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
---> Package perl-BSD-Resource.x86_64 0:1.29.03-3.el6 will be installed
---> Package perl-ExtUtils-MakeMaker.x86_64 0:6.55-136.el6 will be installed
--> Processing Dependency: perl-devel for package: perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64
--> Processing Dependency: perl(Test::Harness) for package: perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64
---> Package perl-Newt.x86_64 0:1.08-26.el6 will be installed
--> Running transaction check
---> Package fontconfig.x86_64 0:2.8.0-3.el6 will be installed
---> Package freetype.x86_64 0:2.3.11-14.el6_3.1 will be installed
---> Package libX11.x86_64 0:1.5.0-4.el6 will be installed
--> Processing Dependency: libX11-common = 1.5.0-4.el6 for package: libX11-1.5.0-4.el6.x86_64
--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.5.0-4.el6.x86_64
---> Package libXpm.x86_64 0:3.5.10-2.el6 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.1-3.el6_5 will be installed
---> Package perl-Test-Harness.x86_64 0:3.17-136.el6 will be installed
---> Package perl-devel.x86_64 4:5.10.1-136.el6 will be installed
--> Processing Dependency: perl(ExtUtils::ParseXS) for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Processing Dependency: glibc-devel for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Processing Dependency: gdbm-devel for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Processing Dependency: db4-devel for package: 4:perl-devel-5.10.1-136.el6.x86_64
--> Running transaction check
---> Package db4-devel.x86_64 0:4.7.25-18.el6_4 will be installed
--> Processing Dependency: db4-cxx = 4.7.25-18.el6_4 for package: db4-devel-4.7.25-18.el6_4.x86_64
--> Processing Dependency: libdb_cxx-4.7.so()(64bit) for package: db4-devel-4.7.25-18.el6_4.x86_64
---> Package gdbm-devel.x86_64 0:1.8.0-36.el6 will be installed
---> Package glibc-devel.x86_64 0:2.12-1.132.el6_5.1 will be installed
--> Processing Dependency: glibc-headers = 2.12-1.132.el6_5.1 for package: glibc-devel-2.12-1.132.el6_5.1.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.132.el6_5.1.x86_64
---> Package libX11-common.noarch 0:1.5.0-4.el6 will be installed
---> Package libxcb.x86_64 0:1.8.1-1.el6 will be installed
--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.8.1-1.el6.x86_64
---> Package perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-136.el6 will be installed
--> Running transaction check
---> Package db4-cxx.x86_64 0:4.7.25-18.el6_4 will be installed
---> Package glibc-headers.x86_64 0:2.12-1.132.el6_5.1 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.132.el6_5.1.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.132.el6_5.1.x86_64
---> Package libXau.x86_64 0:1.0.6-4.el6 will be installed
--> Running transaction check
---> Package kernel-headers.x86_64 0:2.6.32-431.17.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
crypto-utils x86_64 2.4.1-24.2.el6 base 76 k
httpd x86_64 2.2.15-30.el6.centos updates 821 k
httpd-manual noarch 2.2.15-30.el6.centos updates 784 k
mod_perl x86_64 2.0.4-11.el6_5 updates 3.2 M
mod_ssl x86_64 1:2.2.15-30.el6.centos updates 91 k
mod_wsgi x86_64 3.2-3.el6 base 66 k
webalizer x86_64 2.21_02-3.3.el6 base 128 k
Installing for dependencies:
apr x86_64 1.3.9-5.el6_2 base 123 k
apr-util x86_64 1.3.9-3.el6_0.1 base 87 k
apr-util-ldap x86_64 1.3.9-3.el6_0.1 base 15 k
db4-cxx x86_64 4.7.25-18.el6_4 base 588 k
db4-devel x86_64 4.7.25-18.el6_4 base 6.6 M
fontconfig x86_64 2.8.0-3.el6 base 186 k
freetype x86_64 2.3.11-14.el6_3.1 base 359 k
gd x86_64 2.0.35-11.el6 base 142 k
gdbm-devel x86_64 1.8.0-36.el6 base 25 k
glibc-devel x86_64 2.12-1.132.el6_5.1 updates 978 k
glibc-headers x86_64 2.12-1.132.el6_5.1 updates 608 k
httpd-tools x86_64 2.2.15-30.el6.centos updates 73 k
kernel-headers x86_64 2.6.32-431.17.1.el6 updates 2.9 M
libX11 x86_64 1.5.0-4.el6 base 584 k
libX11-common noarch 1.5.0-4.el6 base 192 k
libXau x86_64 1.0.6-4.el6 base 24 k
libXpm x86_64 3.5.10-2.el6 base 51 k
libjpeg-turbo x86_64 1.2.1-3.el6_5 updates 174 k
libpng x86_64 2:1.2.49-1.el6_2 base 182 k
libxcb x86_64 1.8.1-1.el6 base 110 k
mailcap noarch 2.1.31-2.el6 base 27 k
perl-BSD-Resource x86_64 1.29.03-3.el6 base 35 k
perl-ExtUtils-MakeMaker x86_64 6.55-136.el6 base 293 k
perl-ExtUtils-ParseXS x86_64 1:2.2003.0-136.el6 base 45 k
perl-Newt x86_64 1.08-26.el6 base 72 k
perl-Test-Harness x86_64 3.17-136.el6 base 231 k
perl-devel x86_64 4:5.10.1-136.el6 base 423 k

Transaction Summary
================================================================================
Install 34 Package(s)

Total download size: 20 M
Installed size: 55 M
Downloading Packages:
(1/34): apr-1.3.9-5.el6_2.x86_64.rpm | 123 kB 00:00
(2/34): apr-util-1.3.9-3.el6_0.1.x86_64.rpm | 87 kB 00:00
(3/34): apr-util-ldap-1.3.9-3.el6_0.1.x86_64.rpm | 15 kB 00:00
(4/34): crypto-utils-2.4.1-24.2.el6.x86_64.rpm | 76 kB 00:00
(5/34): db4-cxx-4.7.25-18.el6_4.x86_64.rpm | 588 kB 00:01
(6/34): db4-devel-4.7.25-18.el6_4.x86_64.rpm | 6.6 MB 00:11
(7/34): fontconfig-2.8.0-3.el6.x86_64.rpm | 186 kB 00:00
(8/34): freetype-2.3.11-14.el6_3.1.x86_64.rpm | 359 kB 00:00
(9/34): gd-2.0.35-11.el6.x86_64.rpm | 142 kB 00:00
(10/34): gdbm-devel-1.8.0-36.el6.x86_64.rpm | 25 kB 00:00
(11/34): glibc-devel-2.12-1.132.el6_5.1.x86_64.rpm | 978 kB 00:01
(12/34): glibc-headers-2.12-1.132.el6_5.1.x86_64.rpm | 608 kB 00:01
(13/34): httpd-2.2.15-30.el6.centos.x86_64.rpm | 821 kB 00:01
(14/34): httpd-manual-2.2.15-30.el6.centos.noarch.rpm | 784 kB 00:01
(15/34): httpd-tools-2.2.15-30.el6.centos.x86_64.rpm | 73 kB 00:00
(16/34): kernel-headers-2.6.32-431.17.1.el6.x86_64.rpm | 2.9 MB 00:05
(17/34): libX11-1.5.0-4.el6.x86_64.rpm | 584 kB 00:01
(18/34): libX11-common-1.5.0-4.el6.noarch.rpm | 192 kB 00:00
(19/34): libXau-1.0.6-4.el6.x86_64.rpm | 24 kB 00:00
(20/34): libXpm-3.5.10-2.el6.x86_64.rpm | 51 kB 00:00
(21/34): libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm | 174 kB 00:00
(22/34): libpng-1.2.49-1.el6_2.x86_64.rpm | 182 kB 00:00
(23/34): libxcb-1.8.1-1.el6.x86_64.rpm | 110 kB 00:00
(24/34): mailcap-2.1.31-2.el6.noarch.rpm | 27 kB 00:00
(25/34): mod_perl-2.0.4-11.el6_5.x86_64.rpm | 3.2 MB 00:05
(26/34): mod_ssl-2.2.15-30.el6.centos.x86_64.rpm | 91 kB 00:00
(27/34): mod_wsgi-3.2-3.el6.x86_64.rpm | 66 kB 00:00
(28/34): perl-BSD-Resource-1.29.03-3.el6.x86_64.rpm | 35 kB 00:00
(29/34): perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64.rpm | 293 kB 00:00
(30/34): perl-ExtUtils-ParseXS-2.2003.0-136.el6.x86_64.r | 45 kB 00:00
(31/34): perl-Newt-1.08-26.el6.x86_64.rpm | 72 kB 00:00
(32/34): perl-Test-Harness-3.17-136.el6.x86_64.rpm | 231 kB 00:00
(33/34): perl-devel-5.10.1-136.el6.x86_64.rpm | 423 kB 00:00
(34/34): webalizer-2.21_02-3.3.el6.x86_64.rpm | 128 kB 00:00
--------------------------------------------------------------------------------
Total 540 kB/s | 20 MB 00:37
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : apr-1.3.9-5.el6_2.x86_64 1/34
Installing : apr-util-1.3.9-3.el6_0.1.x86_64 2/34
Installing : 2:libpng-1.2.49-1.el6_2.x86_64 3/34
Installing : freetype-2.3.11-14.el6_3.1.x86_64 4/34
Installing : fontconfig-2.8.0-3.el6.x86_64 5/34
Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 6/34
Installing : httpd-tools-2.2.15-30.el6.centos.x86_64 7/34
Installing : libXau-1.0.6-4.el6.x86_64 8/34
Installing : libxcb-1.8.1-1.el6.x86_64 9/34
Installing : mailcap-2.1.31-2.el6.noarch 10/34
Installing : httpd-2.2.15-30.el6.centos.x86_64 11/34
Installing : db4-cxx-4.7.25-18.el6_4.x86_64 12/34
Installing : db4-devel-4.7.25-18.el6_4.x86_64 13/34
Installing : libX11-common-1.5.0-4.el6.noarch 14/34
Installing : libX11-1.5.0-4.el6.x86_64 15/34
Installing : libXpm-3.5.10-2.el6.x86_64 16/34
Installing : perl-Newt-1.08-26.el6.x86_64 17/34
Installing : perl-BSD-Resource-1.29.03-3.el6.x86_64 18/34
Installing : gdbm-devel-1.8.0-36.el6.x86_64 19/34
Installing : kernel-headers-2.6.32-431.17.1.el6.x86_64 20/34
Installing : glibc-headers-2.12-1.132.el6_5.1.x86_64 21/34
Installing : glibc-devel-2.12-1.132.el6_5.1.x86_64 22/34
Installing : perl-Test-Harness-3.17-136.el6.x86_64 23/34
Installing : perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64 24/34
Installing : 1:perl-ExtUtils-ParseXS-2.2003.0-136.el6.x86_64 25/34
Installing : 4:perl-devel-5.10.1-136.el6.x86_64 26/34
Installing : libjpeg-turbo-1.2.1-3.el6_5.x86_64 27/34
Installing : gd-2.0.35-11.el6.x86_64 28/34
Installing : webalizer-2.21_02-3.3.el6.x86_64 29/34
Installing : mod_perl-2.0.4-11.el6_5.x86_64 30/34
Installing : crypto-utils-2.4.1-24.2.el6.x86_64 31/34
Installing : 1:mod_ssl-2.2.15-30.el6.centos.x86_64 32/34
Installing : httpd-manual-2.2.15-30.el6.centos.noarch 33/34
Installing : mod_wsgi-3.2-3.el6.x86_64 34/34
Verifying : mod_perl-2.0.4-11.el6_5.x86_64 1/34
Verifying : httpd-2.2.15-30.el6.centos.x86_64 2/34
Verifying : glibc-headers-2.12-1.132.el6_5.1.x86_64 3/34
Verifying : libxcb-1.8.1-1.el6.x86_64 4/34
Verifying : libXpm-3.5.10-2.el6.x86_64 5/34
Verifying : apr-util-ldap-1.3.9-3.el6_0.1.x86_64 6/34
Verifying : httpd-tools-2.2.15-30.el6.centos.x86_64 7/34
Verifying : glibc-devel-2.12-1.132.el6_5.1.x86_64 8/34
Verifying : 1:mod_ssl-2.2.15-30.el6.centos.x86_64 9/34
Verifying : fontconfig-2.8.0-3.el6.x86_64 10/34
Verifying : libjpeg-turbo-1.2.1-3.el6_5.x86_64 11/34
Verifying : gd-2.0.35-11.el6.x86_64 12/34
Verifying : kernel-headers-2.6.32-431.17.1.el6.x86_64 13/34
Verifying : 4:perl-devel-5.10.1-136.el6.x86_64 14/34
Verifying : freetype-2.3.11-14.el6_3.1.x86_64 15/34
Verifying : httpd-manual-2.2.15-30.el6.centos.noarch 16/34
Verifying : apr-util-1.3.9-3.el6_0.1.x86_64 17/34
Verifying : gdbm-devel-1.8.0-36.el6.x86_64 18/34
Verifying : perl-BSD-Resource-1.29.03-3.el6.x86_64 19/34
Verifying : perl-Test-Harness-3.17-136.el6.x86_64 20/34
Verifying : perl-Newt-1.08-26.el6.x86_64 21/34
Verifying : apr-1.3.9-5.el6_2.x86_64 22/34
Verifying : perl-ExtUtils-MakeMaker-6.55-136.el6.x86_64 23/34
Verifying : libX11-common-1.5.0-4.el6.noarch 24/34
Verifying : db4-cxx-4.7.25-18.el6_4.x86_64 25/34
Verifying : webalizer-2.21_02-3.3.el6.x86_64 26/34
Verifying : mod_wsgi-3.2-3.el6.x86_64 27/34
Verifying : db4-devel-4.7.25-18.el6_4.x86_64 28/34
Verifying : 2:libpng-1.2.49-1.el6_2.x86_64 29/34
Verifying : mailcap-2.1.31-2.el6.noarch 30/34
Verifying : 1:perl-ExtUtils-ParseXS-2.2003.0-136.el6.x86_64 31/34
Verifying : libXau-1.0.6-4.el6.x86_64 32/34
Verifying : crypto-utils-2.4.1-24.2.el6.x86_64 33/34
Verifying : libX11-1.5.0-4.el6.x86_64 34/34

Installed:
crypto-utils.x86_64 0:2.4.1-24.2.el6
httpd.x86_64 0:2.2.15-30.el6.centos
httpd-manual.noarch 0:2.2.15-30.el6.centos
mod_perl.x86_64 0:2.0.4-11.el6_5
mod_ssl.x86_64 1:2.2.15-30.el6.centos
mod_wsgi.x86_64 0:3.2-3.el6
webalizer.x86_64 0:2.21_02-3.3.el6

Dependency Installed:
apr.x86_64 0:1.3.9-5.el6_2
apr-util.x86_64 0:1.3.9-3.el6_0.1
apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1
db4-cxx.x86_64 0:4.7.25-18.el6_4
db4-devel.x86_64 0:4.7.25-18.el6_4
fontconfig.x86_64 0:2.8.0-3.el6
freetype.x86_64 0:2.3.11-14.el6_3.1
gd.x86_64 0:2.0.35-11.el6
gdbm-devel.x86_64 0:1.8.0-36.el6
glibc-devel.x86_64 0:2.12-1.132.el6_5.1
glibc-headers.x86_64 0:2.12-1.132.el6_5.1
httpd-tools.x86_64 0:2.2.15-30.el6.centos
kernel-headers.x86_64 0:2.6.32-431.17.1.el6
libX11.x86_64 0:1.5.0-4.el6
libX11-common.noarch 0:1.5.0-4.el6
libXau.x86_64 0:1.0.6-4.el6
libXpm.x86_64 0:3.5.10-2.el6
libjpeg-turbo.x86_64 0:1.2.1-3.el6_5
libpng.x86_64 2:1.2.49-1.el6_2
libxcb.x86_64 0:1.8.1-1.el6
mailcap.noarch 0:2.1.31-2.el6
perl-BSD-Resource.x86_64 0:1.29.03-3.el6
perl-ExtUtils-MakeMaker.x86_64 0:6.55-136.el6
perl-ExtUtils-ParseXS.x86_64 1:2.2003.0-136.el6
perl-Newt.x86_64 0:1.08-26.el6
perl-Test-Harness.x86_64 0:3.17-136.el6
perl-devel.x86_64 4:5.10.1-136.el6

Complete!

2. ทำการเปิดบริการเว็บเซิร์ฟเวอร์
[root@ldap ~]# service httpd start
Starting httpd: [ OK ]

3 กำหนดให้เว็บเซิร์ฟเวอร์ทำงานตอนบู๊ธระบบ
[root@ldap ~]# chkconfig httpd on

4. ทดสอบเรียนใช้งานจากเครื่องลูกข่าย
http://IP_Server/
เช่น
http://192.168.1.20/