Apache 2.4.7配置问题

1.2、解压 httpd-2.4.7-win64-VC11.zip,复制文件夹 Apache24 到D:\server 下

用命令符模式 CMD-》 f:  ->cd server\Apache24\bin   ->httpd.exe -k install   安装成功!

打开文件时出现错误提示“the requested operation has failed”  (出处:http://www.jb51.net/article/21004.htm)

找到原因:httpd.conf配置错误 
如果apache的配置文件httpd.conf搞错了,在windows里启动它,会提示the requested operation has failed ,这是比较郁闷的事,因为查错要看个半天。 
其实可以用命令行模式启动apache,并带上参数,apache会提示你哪句有误,然后就可以针对性的解决,命令如下: httpd.exe -k start 

安装 Apache 2.4 

1、在 D 盘新建文件夹 server

2、解压 httpd-2.4.9-win32-VC11.zip,复制文件夹 Apache24 到D:\server 下

3、修改配置文件 conf/httpd.conf

复制代码
找到
ServerRoot "c:/Apache24"
修改为
ServerRoot "D:/server/Apache24"

找到
#ServerName www.example.com:80
修改为你本机的IP地址 比如
ServerName 10.0.0.8:80

找到
DocumentRoot "c:/Apache24/htdocs"
<Directory "c:/Apache24/htdocs">
修改为
DocumentRoot "D:/server/wwwroot"
<Directory "D:/server/wwwroot">

找到
ScriptAlias /cgi-bin/ "c:/Apache24/cgi-bin/"
<Directory "c:/Apache24/cgi-bin">
修改为
ScriptAlias /cgi-bin/ "D:/server/Apache24/cgi-bin/"
<Directory "D:/phpserver/Apache24/cgi-bin/">
复制代码

4、以管理员身份运行 CMD,切换目录到 D:/server/Apache24/bin/  运行 httpd -k -install,这会创建一个名为 Apache2.4 的系统服务。

5、拷贝D:/server/Apache24/htdocs/index.html 到 D:/server/wwwroot 下,浏览器访问 http://你的IP地址/index.html。如果显示“ It works!”说明 Apache 已正常安装。

 

posted @ 2014-12-24 02:28  选择了就坚持  阅读(678)  评论(0)    收藏  举报