apache win下安装

有很长时间没有在windows下安装过apache了,遇到些问题,记录如下:

启动时提示报错:the requested operation has failed

如果apache的配置文件httpd.conf不正确,启动时会报上述错误,但没有具体提示,不利于排错。
可以用命令行模式启动apache,并带上参数,apache会提示你哪句有误,然后就可以针对性的解决。
检查错误方法:cmd 进入 Apache安装目录\bin> httpd.exe -w -n "Apache2.2" -k start
(服务名在系统服务里面可以找)

错误提示见下面的原文。

 

apache本身不提供已编译的windows安装包,只提供源码,如果自己无法编译,可以选择这些官方推荐的第三方提供编译的网站。
其中后两个是有名的wamp以及xampp集成环境,如果只想下载apache可以选择前三个网站,如ApacheHaus。

下载的版本仍然不是以往的安装包,解压后直接使用,但是要自行配制,如加入服务等。

具体见这里:http://jingyan.baidu.com/article/29697b912f6539ab20de3cf8.html

如何从Apache官网下载windows版apache服务器

 

E:\www\Apache22\bin>httpd -k install
Installing the Apache2.2 service
The Apache2.2 service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
httpd: Syntax error on line 35 of E:/www/Apache22/conf/httpd.conf: ServerRoot mu
st be a valid directory

E:\www\Apache22\bin> httpd.exe -w -n "Apache2.2" -k start
httpd.exe: Syntax error on line 35 of E:/www/Apache22/conf/httpd.conf: ServerRoot must be a valid directory
Note the errors or messages above, and press the <ESC> key to exit.  0....
E:\www\Apache22\bin>
E:\www\Apache22\bin>
E:\www\Apache22\bin> httpd.exe -w -n "Apache2.2" -k start
Syntax error on line 110 of E:/www/Apache22/conf/extra/httpd-ahssl.conf:
SSLCertificateFile: file 'E:/Apache22/conf/ssl/server.crt' does not exist or is empty
Note the errors or messages above, and press the <ESC> key to exit.  0....
E:\www\Apache22\bin>
E:\www\Apache22\bin>
E:\www\Apache22\bin> httpd.exe -w -n "Apache2.2" -k start

E:\www\Apache22\bin>

 

posted @ 2016-01-13 23:19  山河水  阅读(629)  评论(0编辑  收藏  举报