Apach服务器搭建(一)

本文介绍如何下载并解压Apache2.4.33,详细说明了httpd.conf文件中各项配置参数的意义及设置方法,包括服务器根目录、监听端口、文档根目录、脚本别名等,并提供了让局域网内其他计算机访问的配置指导。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1,下载并且解压Apache2.4.33。
2,配置Apache:
打开 conf/httpd.conf 文件,进行一些修改。

ServerRoot "D:\httpd-2.4.33-Win64-VC15\Apache24"    # 解压后的文件夹
……  
Listen 127.0.0.1:8080    #此处可以修改为本地计算机的IPV4地址,为了避免冲突,端口可改为8088 
……  
ServerName www.example.com:8080      
……  
DocumentRoot "D:\httpd-2.4.33-Win64-VC15\Apache24\htdocs"   #对应apche文件夹下的htdocs文件夹,以下同  

<Directory "D:\httpd-2.4.33-Win64-VC15\Apache24\htdocs">  
……  
ScriptAlias /cgi-bin/ ""D:\httpd-2.4.33-Win64-VC15\Apache24\cgi-bin"  
……  
<Directory "D:\httpd-2.4.33-Win64-VC15\Apache24\cgi-bin">  
    AllowOverride None  
    Options None  
    Require all granted  
</Directory>  

3,继续修改配置,让局域网的计算机可以访问:
确保里面: Require all granted

<Directory "D:\httpd-2.4.33-win64-VC14\Apache24\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.4/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:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted
</Directory>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值