首页 > 开发 > Apache > 正文

Windows Apache2.4 VC9(ApacheHaus)详细安装配置教程

2020-07-28 15:25:49
字体:
来源:转载
供稿:网友
这篇文章主要介绍了Windows Apache2.4 VC9(ApacheHaus)详细安装配置教程,需要的朋友可以参考下

1,Apache下载

选择一个版本,点击Download

点击File For Microsoft Windows

由于Apache HTTP Server官方不提供二进制(可执行)的发行版,所以我们选择一些贡献者编译完成的版本,我们选择第一个ApacheHaus

点击ApacheHaus,进入下载页

选择其中一个版本,如果你的Windows还没安装对应的VC环境的话,选择对应的VCRedistribute版本下载安装。我选择Apache 2.4VC9版,因为我的电脑中已经安装了VC9的环境。

点击JumpLinks下第一行的某一个版本,下载对应压缩包。

2,配置Apache之一--httpd.conf

解压后进入里面Apache22(最后两位数字可能不同)文件夹,使用文本编辑器(推荐ultraedit)打开conf文件夹中的httpd.conf配置文件

找到ServerRoot选项,设置Apache目录,大约在35行左右,将其改成你的Apache程序的文件夹,例:

ServerRoot "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22"

找到Listen选项,设置端口,大约46行,一般不修改,使用默认80,在开启服务器前请保证80端口未被占用

找到DocumentRoot选项,修改服务器根目录,例:

DocumentRoot "F:/"

请保证此目录存在,否则服务器无法正常启动

修改Directory,保证其与服务器根目录相同,只修改下面的第一行中引号部分

<Directory "F:/">  #  # 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  Allow from all</Directory>

找到ScriptAlias选项,设置服务器脚本目录,大约326行,一般将其设置为Apache目录下的cgi-bin文件夹

ScriptAlias /cgi-bin/ "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/cgi-bin"

找到随后的Directory选项,设置脚本目录,大约342行,需要将其设置为和前面的ScriptAlias目录相同

<Directory "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/cgi-bin">  AllowOverride None  Options None  Order allow,deny  Allow from all</Directory>

3,配置Apache之二--ssl配置

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表