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

 1.下载

http://httpd.apache.org/apache

--------------------------------------------------------------------------------------浏览器

--------------------------------------------------------------------------------------测试

--------------------------------------------------------------------------------------spa

--------------------------------点击后稍等会弹出下载框----------------------------code

下载到指定文件夹下进行解压,以下get

2.安装

win+R进入cmd命令框执行以下命cmd

C:\Users\Administrator>cd e:\Apache\Apache24\bin
C:\Users\Administrator>e:
e:\Apache\Apache24\bin>httpd -k install
Installing the 'Apache2.4' service
(OS 5)拒绝访问。  : AH00369: Failed to open the Windows service manager, perhaps you forgot to log in as Adminstrator?

发现错误别着急,错误信息提示我没有用管理员身份登陆!class

解决办法:登录

打开cmd程序的时候以管理员身份运行就好了
正常安装完毕:Errors reported here must be corrected before the service can be started.
(若该句话后面有错误信息,则表示服务安装失败,须要先改正错误。若没有,则成功。)service

e:\Apache\Apache24\bin>httpd -k install
Installing the 'Apache2.4' service
The 'Apache2.4' service is successfully installed.
Testing httpd.conf....
Errors reported here must be corrected before the service can be started.
httpd: Syntax error on line 39 of E:/Apache/Apache24/conf/httpd.conf: ServerRoot must be a valid directory

e:\Apache\Apache24\bin>

此时到此结束,能够在右下角的任务栏中能够查看到Apache程序-->点击start启动便可

这时候你能够在浏览器中输入http://localhost来测试时候成功,若是不成功,说明本地80端口被占用,你能够到 httpd.conf中将全部80的端口改为8080,再次输入,若是出现如图提示,表示安装成功。

相关文章
相关标签/搜索