下载地址:https://www.apachelounge.com/download/VS16/binaries/httpd-2.4.41-win64-VS16.zip
如果以上地址失效请到 https://www.apachelounge.com/download/ 寻找最新稳定版本下载。
下载到本地解压后,比如为C:InstallApache24,打开C:InstallApache24confhttpd.conf文件,找到Define SRVROOT一行,将你刚才的解压地址写入引号中,如下图红色字体部分显示:
# least PidFile. # Define SRVROOT "C:/Install/Apache24" ServerRoot "${SRVROOT}" # # Mutex: Allows you to set the mutex mechanism and mutex file directory
之后以管理员身份打开cmd,到C:InstallApache24in目录,输入:
C:Windowssystem32>cd C:InstallApache24in C:InstallApache24in>httpd.exe -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. C:InstallApache24in>httpd.exe -k start C:InstallApache24in>
以上httpd.exe -k install 一句是安装apche到系统服务,httpd.exe -k start 一句是启动httpd服务
之后在浏览器窗口输入 localhost:80,看到 It works!就算安装成功了。
--END-- 2020年1月1日16点27分