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>