业界 | 信息 | 基础 | 配置 | 安全 | 系统 | 方案 | 协议 | 硬件 | 下载 | 制度 | 漏洞 | 解密 | 群集 | 论文 | 导购 | 数据库 | 反病毒 | 反黑客 | 白皮书 | 负载均衡 | Windows | Linux | Unix |
热门搜索:  安全  ?务器  IIS  VMWare  微软  企业  网络  黑客  win  sql RSS订阅
服务器安全资讯网

服安最新信息资讯

服务器安全资讯网

服安资讯热点推荐

服务器安全资讯网

服安资讯阅览排行

信息安全法律法规

服务器安全技术资讯

服安解决方案

CentOS下用Apache构建HTTP服务器

来源:服安资讯   时间:2008-12-20  作者:  点击:次  责任编辑:Flyfox
TAG:   服务器 构建 &larr to &lt &quot   服务器安全应急处理中心:让您的服务器更安全!  进入安全讨论社区 

摘要:
对于大多数的网络服务器,最广泛的功能就是开通HTTP服务,达到开放和发布网站的目的。目前绝大多数的网络交互程序,例如论坛、社区等等也是基于HTTP而建立的。在这里,我们通过Web服务器软件中使用量超过半数的自由软件Apache,来构建一台能够满足实际要求的多功能Web服
前  言
  对于大多数的网络服务器,最广泛的功能就是开通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
Resolving 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!

  为了使服务器开通HTTP服务后能够运行PHP编写的交互程序,接下来安装PHP。

[root@sample ~]# yum -y install php  ← 在线安装PHP

Setting up Install Process
Setting up repositories
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
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
顶一下
(0)
0%
踩一下
(0)
0%
服务器安全维护网:为您的服务器安全、稳定运行助航,提供服务器全方面的技术支持服务! 服务器安全资讯网(Fuancn.CN)登载此文仅为传递更多信息之目的,并不意味着赞同其观点或证实其描述。
  • 本文引用地址:双击复制发送给您的朋友!
  • 上一篇:CentOS下no-ip.com动态域名的申请 下一篇:让服务器支持安全HTTP协议(HTTPS)

    - 关于本站 - 网站地图 - 百度新闻 - 版权申明 - 合作伙伴 - 安全服务 - 服安公告 - 常见问题 - 技术Q群 - 在线留言 - 联系我们 -