您的位置:首页 > 运维架构 > Apache

Windows下Apache的安装

2015-12-01 10:23 453 查看
Apache的官网现在只提供源代码,并不提供Apache的下载包,但是会给出其他网站编译好的安装包下载。

记得同时下载相应的Microsoft Visual C++ 2012 Update 4 Redistributable Package并安装,不然接下去配置PHP后启动时会提示无法加载PHP的DLL。

下载后命令行进入到apache目录下的bin目录(注意用管理员权限运行cmd),输入httpd -k install 把apache安装成windows后台服务,然后利用ApacheMonitor启动apache服务,提示“The requested operation has failed!”,回到命令行窗口,输入httpd.exe -w -n "apache2.4" -k start 发现提示报错“httpd.exe:Syntax error on line 39 of C:Program Files/Apache24/conf/httpd.conf:ServerRoot
must be a valid directory”,去conf/httpd.conf中找到第39行,发现第38行 Define SRVROOT "/Apache24" 路径并不正确,改成现在Apache的解压目录即可。

在浏览器栏里输入127.0.0.1,显示页面“it works!”

修改httpd.conf,查找DirectoryIndex index.html,修改为DirectoryIndex index.html index.php index.htm,可以支持更多的默认页
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: