安装过程
1.下载apache2.4版本,文件名是:httpd-2.4.17-x86.zip。解压到D盘server目录下,路径是:D:\server\httpd-2.4.17-x86。
2.修改httpd.conf配置文件,路径:D:\server\httpd-2.4.17-x86\Apache24\conf\httpd.conf
修改目录
#Define SRVROOT “/Apache24”
DefineSRVROOT “D:/server/httpd-2.4.17-x86/Apache24”
3.用管理员身份启动cmd,cd到apache的bin目录。
cd D:\server\httpd-2.4.17-x86\Apache24\bin
4.启动apache
输入启动命令httpd.exe -kstart 报错,信息如下:[Thu Mar 10 16:29:30.616810 2016] [mpm_winnt:error] [pid7376:tid 172] (OS 2)系统找不到指定的文件。 : AH00436: Noinstalled service named “Apache2.4”.
问题解决过程:
1.查看防火墙,已关闭。 –排除
2.查询80端口,使用netstat-ano查询本地是否用80端,经查询无80端口占用。–排除
3.apache的SRVROOT配置正确。 –排除
4.尝试安装apache,用管理员身份运行cmd,cd到apache的bin目录,输入命令:httpd.exe -k install.
Installing the ‘Apache2.4’ service
The ‘Apache2.4’ service is successfullyinstalled.
Testing httpd.conf….
Errors reported here must be corrected beforethe service can be started.
已安装成功。 再次尝试启动apache,输入命令:httpd.exe-k start,启动成功。浏览器地址栏输入访问地址:http:localhost,显示apache页面。