[RHEL5企业级Linux服务攻略]--第7季 Apache服务全攻略之常规配置-阿里云开发者社区

开发者社区> 开发与运维> 正文

[RHEL5企业级Linux服务攻略]--第7季 Apache服务全攻略之常规配置

简介:
1.Apache相关软件
httpd-2.2.3-11.el5.i386.rpm :Apache服务的主程序包,服务器端必须安装该软件包
httpd-devel-2.2.3-11.el5.i386.rpm :Apache开发程序包 
httpd-manual-2.2.3-11.el5.i386.rpm :Apache手册文档,包含HTML 格式的Apache 计划的Apache User's Guide 说明指南 
system-config-httpd-1.3.3.1-1.el5.noarch.rpm :Apache配置工具
image
2、Apache软件包安装
httpd-devel-2.2.3-11.el5.i386.rpm包要解决以下两个依赖关系:
apr-devel-1.2.7-11.i386.rpm 
apr-util-devel-1.2.7-6.i386.rpm
system-config-httpd-1.3.3.1-1.el5.noarch.rpm包要解决以下两个依赖关系:
alchemist-1.0.36-2.el5.i386.rpm 
libxslt-python-1.1.17-2.i386.rpm  
[root@rhel5 ~]# ll /mnt/cdrom/Server/ |grep httpd 
-r-xr-xr-x 1 root root  1111795 2007-08-27 httpd-2.2.3-11.el5.i386.rpm 
-r-xr-xr-x 1 root root   149662 2007-08-27 httpd-devel-2.2.3-11.el5.i386.rpm 
-r-xr-xr-x 1 root root   851004 2007-08-27 httpd-manual-2.2.3-11.el5.i386.rpm 
-r-xr-xr-x 1 root root   612538 2007-01-18 system-config-httpd-1.3.3.1-1.el5.noarch.rpm
 
[root@rhel5 ~]# rpm -qa |grep httpd 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/httpd-2.2.3-11.el5.i386.rpm 
warning: /mnt/cdrom/Server/httpd-2.2.3-11.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
Preparing...                ########################################### [100%] 
   1:httpd                  ########################################### [100%] 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/httpd-devel-2.2.3-11.el5.i386.rpm 
warning: /mnt/cdrom/Server/httpd-devel-2.2.3-11.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
error: Failed dependencies: 
        apr-devel is needed by httpd-devel-2.2.3-11.el5.i386 
        apr-util-devel is needed by httpd-devel-2.2.3-11.el5.i386 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/apr-devel-1.2.7-11.i386.rpm 
warning: /mnt/cdrom/Server/apr-devel-1.2.7-11.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
Preparing...                ########################################### [100%] 
   1:apr-devel              ########################################### [100%] 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/apr-util-devel-1.2.7-6.i386.rpm 
warning: /mnt/cdrom/Server/apr-util-devel-1.2.7-6.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
Preparing...                ########################################### [100%] 
   1:apr-util-devel         ########################################### [100%] 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/httpd-devel-2.2.3-11.el5.i386.rpm 
warning: /mnt/cdrom/Server/httpd-devel-2.2.3-11.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
Preparing...                ########################################### [100%] 
   1:httpd-devel            ########################################### [100%] 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/httpd-manual-2.2.3-11.el5.i386.rpm 
warning: /mnt/cdrom/Server/httpd-manual-2.2.3-11.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
Preparing...                ########################################### [100%] 
   1:httpd-manual           ########################################### [100%] 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/system-config-httpd-1.3.3.1-1.el5.noarch.rpm 
warning: /mnt/cdrom/Server/system-config-httpd-1.3.3.1-1.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
error: Failed dependencies: 
        alchemist is needed by system-config-httpd-1.3.3.1-1.el5.noarch 
        libxslt-python is needed by system-config-httpd-1.3.3.1-1.el5.noarch 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/alchemist- 
alchemist-1.0.36-2.el5.i386.rpm        alchemist-devel-1.0.36-2.el5.i386.rpm 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/alchemist-1.0.36-2.el5.i386.rpm 
warning: /mnt/cdrom/Server/alchemist-1.0.36-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
Preparing...                ########################################### [100%] 
   1:alchemist              ########################################### [100%] 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/libxslt-python-1.1.17-2.i386.rpm 
warning: /mnt/cdrom/Server/libxslt-python-1.1.17-2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
Preparing...                ########################################### [100%] 
   1:libxslt-python         ########################################### [100%] 
[root@rhel5 ~]# rpm -ivh /mnt/cdrom/Server/system-config-httpd-1.3.3.1-1.el5.noarch.rpm 
warning: /mnt/cdrom/Server/system-config-httpd-1.3.3.1-1.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 
Preparing...                ########################################### [100%] 
   1:system-config-httpd    ########################################### [100%] 
[root@rhel5 ~]#
3、WEB常规应用配置
案例:
部门内部搭建一台WEB服务器,采用的IP地址和端口为192.168.0.188:80,首页采用index.html文件。管理员E-mail地址为[email]root@michael.com[/email],网页的编码类型采用GB2312,所有网站资源都存放在/var/www/html目录下,并将Apache的根目录设置为/etc/httpd目录。
解决方案:
(1)修改主配置文件httpd.conf
vim /etc/httpd/conf/httpd.conf
设置Apache的根目录为/etc/httpd
设置客户端访问超时时间为120秒
这两个设置为系统默认哈~
image
设置httpd监听端口80,默认哈~
image
设置管理员E-mail地址为[email]root@michael.com[/email]
设置WEB服务器的主机名和监听端口为192.168.1.188:80
image
设置Apache文档目录为/var/www/html,默认哈~
image
设置主页文件为index.html
image
设置服务器的默认编码为GB2312
image
(2)注释掉Apache默认欢迎页面
vim /etc/httpd/conf.d/welcome.conf
 image
将welcome.conf中的四行代码注释掉哈~
image
注意:如果不注释掉,那么在我们测试自己的网站时则会打开RedHat Enterprise Linux Test Page页面,而不是我们自己的网页哈~
 image
(3)重新启动httpd服务
image
(4)将制作好的网页存放在文档目录/var/www/html中
image
(5)测试
在IE地址栏中输入192.168.0.188就可以打开我们制作好的首页,偶借用了下McAfee的首页试试效果,呵呵~~~
image
####################Michael分割线######################
下一季[RHEL5企业级Linux服务攻略]--第7季 Apache服务全攻略之高级配置,敬请期待~~~
####################Michael分割线######################






本文转自redking51CTO博客,原文链接:http://blog.51cto.com/redking/141222,如需转载请自行联系原作者

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

其他文章