2022年用Apache构建HTTP服务器整理 .pdf
《2022年用Apache构建HTTP服务器整理 .pdf》由会员分享,可在线阅读,更多相关《2022年用Apache构建HTTP服务器整理 .pdf(12页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、(最近更新日:2006/08/26)前言对于大多数的网络服务器,最广泛的功能就是开通HTTP 服务,达到开放和发布网站的目的。目前绝大多数的网络交互程序,例如论坛、社区等等也是基于HTTP 而建立的。在这里,我们通过Web 服务器软件中使用量超过半数的自由软件Apache,来构建一台能够满足实际要求的多功能Web 服务器,使它能够在我们发布网页的基础上,实现可以运行 Perl、PHP 的等等语言编写的交互程序,以及在虚拟主机、保密方面的功能。安装 HTTP(Apache)服务器及相关组件首先来安装Apache 服务器及相关组件。这里使用yum 命令来在线安装。rootsample#yum-y
2、install httpd 在线安装 httpdSetting 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 Enterpris
3、e 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
4、.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 Resol
5、ution with new changes.-Populating transaction set with selected packages.Please wait.-Downloading header for apr to pack into transaction set.名师资料总结-精品资料欢迎下载-名师精心整理-第 1 页,共 12 页 -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
6、 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
7、to be updated-Running transaction checkDependencies 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
8、 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
9、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 0 x443E1821 CentOS-4 key 名师资料总结-精品资料欢迎下载-名师精心整理-第 2 页,共 12 页 -Key imported succes
10、sfully 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.i
11、386 0:0.9.4-21 httpd-suexec.i386 0:2.0.52-28.ent.centos4 Complete!为了使服务器开通HTTP 服务后能够运行PHP 编写的交互程序,接下来安装PHP。rootsample#yum-y install php 在线安装 PHPSetting up Install Process Setting up repositories Reading repository metadata in from local files Reducing Dag RPM Repository for Red Hat Enterprise Linux
12、to included packages only Finished Parsing package install arguments Resolving Dependencies-Populating transaction set with selected packages.Please wait.-Downloading header for php to pack into transaction set.php-4.3.9-3.15.i386.rpm 100%|=|23 kB 00:00-Package php.i386 0:4.3.9-3.15 set to be update
13、d-Running transaction check-Processing Dependency:php-pear for package:php-Restarting Dependency Resolution with new changes.-Populating transaction set with selected packages.Please wait.-Downloading header for php-pear to pack into transaction set.php-pear-4.3.9-3.15.i386.100%|=|33 kB 00:00-Packag
14、e php-pear.i386 0:4.3.9-3.15 set to be updated-Running transaction check Dependencies Resolved=名师资料总结-精品资料欢迎下载-名师精心整理-第 3 页,共 12 页 -=Package Arch Version Repository Size=Installing:php i386 4.3.9-3.15 update 1.3 M Installing for dependencies:php-pear i386 4.3.9-3.15 update 266 k Transaction Summary=
15、Install 2 Package(s)Update 0 Package(s)Remove 0 Package(s)Total download size:1.6 M Downloading Packages:(1/2):php-pear-4.3.9-3.1 100%|=|266 kB 00:00(2/2):php-4.3.9-3.15.i38 100%|=|1.3 MB 00:01 Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installi
16、ng:php#1/2 Installing:php-pear#2/2 Installed:php.i386 0:4.3.9-3.15 Dependency Installed:php-pear.i386 0:4.3.9-3.15 Complete!为了使 PHP 应用程序的执行效率大幅度提高,我们安装Zend。rootsample#wget http:/ 下载 Zend 的源代码-13:19:06-http:/ Resolving .66.98.224.81 Connecting to |66.98.224.81|:80.connected.名师资料总结-精品资料欢迎下载-名师精心整理-第 4
17、 页,共 12 页 -HTTP request sent,awaiting response.200 OK Length:6,358,090(6.1M)application/gzip 100%=6,358,090 240.53K/s ETA 00:00 13:19:33(238.15 KB/s)-ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz saved 6358090/6358090 rootsample#tar zxvf ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz 展开被压缩的源代码rootsam
18、ple#cd ZendOptimizer*进入 Zend 的源代码目录rootsample ZendOptimizer-3.0.1-linux-glibc21-i386#./install.sh 运行安装脚本然后会出现对话方式的安装向导,图样如下:1 选择 OK,进入安装向导。2 阅读协议后,选择EXIT。3 选择 Yes 同意使用协议。4 设置安装目录,这里以默认的/usr/local/Zend为例,然后选择OK 进入下一步。5 设置 PHP 配置文件所在的位置,一般为/etc(默认),如果 PHP 的配置文件在别处的话,请根据实际情况设置。6 被询问是否使用Apache 服务器,这里选择Y
19、es。7 设置 Apache 的路径,这里保持默认,选择OK 进入下一步。8 选择 OK 进入下一步。9 然后开始安装稍等片刻,安装完成后,提示安装成功,选择OK 进入下一步。10 选择 No,不重新启动HTTP 服务(由于Apache 也刚刚安装完毕,还没有被启动过。为了安全,等我们将 Apache 配置完毕后,再启动 HTTP 服务。)。然后会出现命令行-Zend Optimizer 安装完毕。rootsample ZendOptimizer-3.0.1-linux-glibc21-i386#cd 回到 root 根目录rootsample#rm-rf ZendOptimizer*删除安装
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年用Apache构建HTTP服务器整理 2022 年用 Apache 构建 HTTP 服务器 整理
限制150内