firemail

标题: Apache绿色版 官网下载+安装(win7) [打印本页]

作者: java    时间: 2017-11-15 09:50
标题: Apache绿色版 官网下载+安装(win7)
本帖最后由 java 于 2017-11-17 15:17 编辑

http://blog.csdn.net/anndy_/article/details/51075011

1.官网下载Apache
官网地址:https://httpd.apache.org/
点击Download
点击Files for Microsoft Windows

如果只想下载apache可以选择前三个网站,这里我们第一个ApacheHaus为例。


Built using C sources from the ASF and OpenSSL on Visual Studio 2012 (VC11).

Visual Studio Redistributable Packages


     VC9/VC11:该版本PHP分别是用VisualStudio2008/VisualStudio2012编译的。PHP官方版本5.4是用VC9编译的,5.5用VC11编译。



点击Apache 2.4 VC11


点击下载64位的


解压下载好的压缩包文件 移动文件夹Apache24到你想要的位置。


修改httpd.conf文件

Define SRVROOT "C:\httpd-2.4.29-x64-vc11\Apache24"


修改端口号:
Listen 9528


C:\Windows\System32\cmd.exe 以管理员身份运行
命令行到Apache下面的bin目录,录入命令[ httpd -k install ]安装。
安装成功验证  开始-->运行-->services.msc-->确定(或回车键Enter)



命令启动Apache服务:【 httpd -k start 】


停止Apache服务:[ httpd -k stop ]


录入命令[ httpd restart ]重启Apache


录入命令[ httpd -k restart ],重启Apache服务


查看Apache服务版本号:[ httpd -v ]


查看Apache服务的帮助:[ httpd -help ]


查看80端口是否被占用:[  netstat -aon|findstr "80" ]







一台机器上开两个apache服务会报下面的错误(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted.  : AH00072: make_sock: could not bind to address [::]:443

这是一个端口开了两次,所以把第二个apache的https端口换一下


conf/extra/httpd-ahssl.conf

Listen 4443 https





作者: java    时间: 2017-11-15 12:01
https://httpd.apache.org/docs/current/platform/windows.html#down

Apache comes with a utility called the Apache Service Monitor. With it you can see and manage the state of all installed Apache services on any machine on your network. To be able to manage an Apache service with the monitor, you have to first install the service (either automatically via the installation or manually).
You can install Apache as a Windows NT service as follows from the command prompt at the Apache bin subdirectory:
httpd.exe -k install

If you need to specify the name of the service you want to install, use the following command. You have to do this if you have several different service installations of Apache on your computer. If you specify a name during the install, you have to also specify it during any other -k operation.
httpd.exe -k install -n "MyServiceName"

If you need to have specifically named configuration files for different services, you must use this:
httpd.exe -k install -n "MyServiceName" -f "c:\files\my.conf"

If you use the first command without any special parameters except -k install, the service will be called Apache2.4 and the configuration will be assumed to be conf\httpd.conf.
Removing an Apache service is easy. Just use:
httpd.exe -k uninstall

The specific Apache service to be uninstalled can be specified by using:
httpd.exe -k uninstall -n "MyServiceName"

Normal starting, restarting and shutting down of an Apache service is usually done via the Apache Service Monitor, by using commands like NET START Apache2.4 and NET STOP Apache2.4 or via normal Windows service management. Before starting Apache as a service by any means, you should test the service's configuration file by using:
httpd.exe -n "MyServiceName" -t

You can control an Apache service by its command line switches, too. To start an installed Apache service you'll use this:
httpd.exe -k start -n "MyServiceName"

To stop an Apache service via the command line switches, use this:
httpd.exe -k stop -n "MyServiceName"

or
httpd.exe -k shutdown -n "MyServiceName"

You can also restart a running service and force it to reread its configuration file by using:
httpd.exe -k restart -n "MyServiceName"







欢迎光临 firemail (http://firemail.wang:8088/) Powered by Discuz! X3