ทาง Linuxgray อนุญาติให้ copy บทความได้ แต่กรุณาอ้างอิง ชื่อผู้เขียน และทำ Link มาที่ http://www.linuxgray.com ขอบคุณครับ
โดย
มนตรี สีเทา ( RHCT , RHCE )
( Last update 12/02/2011 )
http://www.linuxgray.com
บทความนี้เป็นตัวอย่าง แนะนำการติดตั้ง Web Server
1. ติดตั้ง Package httpd
[root@www ~]# yum install httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.i386 0:2.2.3-43.el5.centos.3 set to be updated
--> Processing Dependency: libapr-1.so.0 for package: httpd
--> Processing Dependency: libaprutil-1.so.0 for package: httpd
--> Running transaction check
---> Package apr.i386 0:1.2.7-11.el5_5.3 set to be updated
---> Package apr-util.i386 0:1.2.7-11.el5_5.2 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================
Package Arch Version Repository Size
============================================================================
Installing:
httpd i386 2.2.3-43.el5.centos.3 updates 1.2 M
Installing for dependencies:
apr i386 1.2.7-11.el5_5.3 updates 123 k
apr-util i386 1.2.7-11.el5_5.2 updates 80 k
Transaction Summary
============================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 1.4 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): apr-util-1.2.7-11.el5_5.2.i386.rpm | 80 kB 00:00
(2/3): apr-1.2.7-11.el5_5.3.i386.rpm | 123 kB 00:00
(3/3): httpd-2.2.3-43.el5.centos.3.i386.rpm | 1.2 MB 00:02
----------------------------------------------------------------------------
Total 63 kB/s | 1.4 MB 00:22
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : apr 1/3
Installing : apr-util 2/3
Installing : httpd 3/3
Installed:
httpd.i386 0:2.2.3-43.el5.centos.3
Dependency Installed:
apr.i386 0:1.2.7-11.el5_5.3 apr-util.i386 0:1.2.7-11.el5_5.2
Complete!
2. ลบหน้าทดสอบของ httpd
[root@www ~]# rm -f /etc/httpd/conf.d/welcome.conf
3. ทดสอบสร้างหน้าเว็บ html
[root@www ~]# vi /var/www/html/index.html
<html>
<body>
<H1><center>Test Page</center><H1>
</body>
</html>
4. start service ของ Web Server
[root@www ~]# /etc/rc.d/init.d/httpd start
Starting httpd: [ OK ]
5. Check Config Service ให้ทำงานทุกครั้ง
[root@www ~]# chkconfig httpd on
6. ลองทดสอบการเรียกเว็บผ่าน browser

|