对于大多数的网络服务器,最广泛的功能就是开通 HTTP服务,达到开放和发布网站的目的。目前绝大多数的网络交互程序,例如论坛、社区等等也是基于 HTTP而建立的。
在这里,我们通过 Web服务器软件中使用量超过半数的自由软件 Apache,来构建一台能够满足实际要求的多功能 Web服务器,使它能够在我们发布网页的基础上,实现可以运行 Perl、PHP的等等语言编写的交互程序,以及在虚拟主机、保密方面的功能。
安装HTTP(Apache)服务器及相关组件
首先来安装 Apache服务器及相关组件。这里使用 yum命令来在线安装。
[root@sample ~]# yum -y install httpd ← 在线安装httpd Setting up Install Process Setting up repositories dag 100% |=========================| 1.1 kB 00:00 update 100% |=========================| 951 B 00:00 base 100% |=========================| 1.1 kB 00:00 addons 100% |=========================| 951 B 00:00 extras 100% |=========================| 1.1 kB 00:00 Reading repository metadata in from local files Reducing Dag
RPM
Repository for Red Hat Enterprise Linux to included packages only Finished Parsing package install arguments Resol
ving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for httpd to pack into transaction set. httpd-2.
0.52-28.ent.cento 100% |=========================| 62 kB 00:00 ---> Package httpd.
i386 0:2.0.52-28.ent.centos4 set to be updated --> Running transaction check --> Processing Dependency: libaprutil-0.so.0 for package: httpd --> Processing Dependency: apr >= 0.9.4-24.2 for package: httpd --> Processing Dependency: libapr-0.so.0 for package: httpd --> Processing Dependency: httpd-suexec for package: httpd --> Restarting Dependency Resolution with new changes. --> Populating transaction set with selected packages. Please wait. ---> Downloading header for apr to pack into transaction set. apr-0.9.4-24.5.c4.1.i386. 100% |=========================| 7.5 kB 00:00 ---> Package apr.i386 0:0.9.4-24.5.c4.1 set to be updated ---> Downloading header for httpd-suexec to pack into transaction set. httpd-suexec-2.0.52-28.en 100% |=========================| 22 kB 00:00 ---> Package httpd-suexec.i386 0:2.0.52-28.ent.centos4 set to be updated ---> Downloading header for apr-util to pack into transaction set. apr-util-0.9.4-21.i386.rp 100% |=========================| 5.2 kB 00:00 ---> Package apr-util.i386 0:0.9.4-21 set to be updated --> Running transaction check Dependencies Resolved =========================================================== ================== Package Arch Version Repository Size =========================================================== ================== Installing: httpd i386 2.0.52-28.ent.centos4 update 888 k Installing for dependencies: apr i386 0.9.4-24.5.c4.1 base 88 k apr-util i386 0.9.4-21 base 51 k httpd-suexec i386 2.0.52-28.ent.centos4 update 28 k Transaction Summary =========================================================== ================== Install 4 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 1.0 M Downloading Packages: (1/4): apr-0.9.4-24.5.c4. 100% |=========================| 88 kB 00:00 (2/4): httpd-suexec-2.0.5 100% |=========================| 28 kB 00:00 (3/4): httpd-2.0.52-28.en 100% |=========================| 888 kB 00:02 (4/4): apr-util-0.9.4-21. 100% |=========================| 51 kB 00:00 warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID 443e1821 Public key for apr-0.9.4-24.5.c4.1.i386.rpm is not installed Retrieving GPG key from http://mirror.centos.org/centos/RPM-GPG-KEY-centos4 Importing GPG key 0x443E1821 "
CentOS-4 key <centos-4key@centos.org>" Key imported successfully Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: apr ######################### [1/4] Installing: apr-util ######################### [2/4] Installing: httpd ######################### [3/4] Installing: httpd-suexec ######################### [4/4] Installed: httpd.i386 0:2.0.52-28.ent.centos4 Dependency Installed: apr.i386 0:0.9.4-24.5.c4.1 apr-util.i386 0:0.9.4-21 httpd-suexec.i386 0:2.0.52-28.ent.centos4 Complete!