圆月山庄资源网 Design By www.vgjia.com

1,Apache下载

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

选择一个版本,点击Download

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

点击File For Microsoft Windows

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

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

点击ApacheHaus,进入下载页

Windows Apache2.4 VC9(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配置

如果你这使启动服务,一般会出现下面的消息对话框:

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

提示

Windows不能在本地计算机启动Apache2.2。有关更多信息,查阅系统日志文件。如果这是非Microsoft服务,请与厂商联系,并参考特定服务器错误代码1。

确定此问题的原因:

右键 计算机,点击管理->Windows日志->应用程序,显示如下

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

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

这是由于SSL配置不正确所产生的,下面说一下解决办法。

打开Apache程序目录下的conf/extra/httpd-ahssl.conf文件,配置VirtualHost选项,有三处名为VirtualHost的选项,均需修改。

第一个在107行左右。

在110行左右,将其中的SSLCertificateFile改为:Apache所在目录/conf/ssl/server.crt

在111行左右,将SSLCertificateKeyFile改为:Apache所在目录/conf/ssl/server.key

在112行左右,将DocumentRoot改为你的服务器根目录

在126行左右,将CustomLog改为:Apache所在目录/logs/ssl_request.log,这个不改的话也会错。一般会出现如下错误:

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

Apache2.2服务由于下列服务特定错误而终止:函数不正确。

改成的效果:

<VirtualHost _default_:443>
 SSLEngine on
 ServerName localhost:443
 SSLCertificateFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/server.crt
 SSLCertificateKeyFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/server.key
 DocumentRoot F:/

# openssl req -new > server.csr
# openssl rsa -in privkey.pem -out server.key
# openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 2048
<FilesMatch "\.(cgi|shtml|phtml|php)$">
  SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/Apache22/cgi-bin">
  SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]"      nokeepalive ssl-unclean-shutdown      downgrade-1.0 force-response-1.0
CustomLog "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/logs/ssl_request.log"      "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</virtualhost>

主要改上文四处地方

在130行和152行还有另外两个VirtualHost,均需修改上述的四个选项

例:

130行

<VirtualHost *:443>
 SSLEngine on
 ServerName serverone.tld:443
 SSLCertificateFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/serverone.crt
 SSLCertificateKeyFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/serverone.key
 DocumentRoot F:/
# openssl req -new > serverone.csr
# openssl rsa -in privkey.pem -out serverone.key
# openssl x509 -in serverone.csr -out serverone.crt -req -signkey serverone.key -days 2048
<FilesMatch "\.(cgi|shtml|phtml|php)$">
  SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/Apache22/cgi-bin">
  SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]"      nokeepalive ssl-unclean-shutdown      downgrade-1.0 force-response-1.0
CustomLog "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/logs/ssl_request.log"      "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" env=HTTPS
</virtualhost> 

第152行

<VirtualHost *:443>
 SSLEngine on
 ServerName servertwo.tld:443
 SSLCertificateFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/servertwo.crt
 SSLCertificateKeyFile C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/conf/ssl/servertwo.key
 DocumentRoot F:/
# openssl req -new > servertwo.csr
# openssl rsa -in privkey.pem -out servertwo.key
# openssl x509 -in servertwo.csr -out servertwo.crt -req -signkey servertwo.key -days 2048
<FilesMatch "\.(cgi|shtml|phtml|php)$">
  SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/Apache22/cgi-bin">
  SSLOptions +StdEnvVars
</Directory>
BrowserMatch "MSIE [2-5]"      nokeepalive ssl-unclean-shutdown      downgrade-1.0 force-response-1.0
CustomLog "C:/Users/myPC/Downloads/httpd-2.2.31-x86-r3/Apache22/ssl_request.log"      "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</virtualhost> 

上述的两个VirtualHost均需修改四处

这样,Apache就算配置完了,如果还有问题,可能还需配置./conf/extra/httpd-ssl.conf,配置方法和配置VirtualHost的相似

4,启动Apache HTTP Server

使用Windows命令行以管理员身份进入Apache程序的文件夹下的bin文件夹,输入httpd -k install,完成Apache服务的安装。

然后双击bin目录下的ApacheMonitor.exe,点击右边的start启动服务器,如果正常,如下图:

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

测试一下:

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

5,其它

卸载Apache HTTP Server:

管理员身份进入bin目录,使用httpd -k uninstall 移除服务

使用httpd -w -n "Apache2" -k start命令启动服务器 可以显示启动过程中的日志,便于分析错误。

标签:
Apache2.4,VC9

圆月山庄资源网 Design By www.vgjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
圆月山庄资源网 Design By www.vgjia.com

《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线

暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。

艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。

《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。