Apache Httpd在linux环境下安装配置指南

Apache Httpd在linux环境下安装配置指南

一、安装环境

Red Hat AS 5.0

二、安装包准备

httpd-2.2.9.tar.gz

三、安装目录准备

/usr/local/httpd-2.2.9

四、安装步骤

用户:root

将压缩文件:httpd-2.2.9.tar.gz拷贝到/usr/app/下面

解压缩文件

  #cd /usr/app/

  #tar –vzxf httpd-2.2.9.tar.gz

  #cd httpd-2.2.9

创建安装目录

  #mkdir –p /usr/local/httpd-2.2.9

  #chmod –R 777 /usr/local/httpd-2.2.9

  #./configure --prefix=/usr/local/httpd-2.2.9

  #make

  #make install

五、配置

#vi /usr/local/httpd-2.2.9/conf/httpd.conf

序号

属性项

1

ServerRoot "/usr/local/httpd-2.2.9"

默认(httpd安装目录)

2

Listen 80

80为端口,根据实际调整

如:Listen 8090

3

#ServerName www.example.com:80

设为:

ServerName localhost:8090 [端口与Listen一致]

 六、启动/停止

       启动

         #/usr/local/httpd-2.2.9/ bin/apachectl start

      停止

         #/usr/local/httpd-2.2.9/ bin/apachectl stop

      查看服务

         #ps aux|grep httpd  

七、发布测试

     看到此页面说明安装配置成功


八、高级配置

限制IP访问

 找到发布目录信息节点:

<Directory "/usr/local/httpd-2.2.9/htdocs">

    #

    # Possible values for the Options directive are "None", "All",

    # or any combination of:

    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

    #

    # Note that "MultiViews" must be named *explicitly* --- "Options All"

    # doesn't give it to you.

    #

    # The Options directive is both complicated and important.  Please see

    # http://httpd.apache.org/docs/2.2/mod/core.html#options

    # for more information.

    #

    Options Indexes FollowSymLinks

    # AllowOverride controls what directives may be placed in .htaccess files.

    # It can be "All", "None", or any combination of the keywords:

    #   Options FileInfo AuthConfig Limit

    AllowOverride None

    #

    # Controls who can get stuff from this server.

Order allow,deny

# 默认不限制IP访问[all]

#Allow from all

# 只允许0.200.151 二台服务器访问该Web服务

Allow from 192.168.0.20 192.168.0.151

</Directory>

  更多配置请参考

                  http://lamp.linux.gov.cn/Apache/ApacheMenu/ 

                                                                                                                

                                                                                                            整理于:2009-09-15PM   杭州


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值