将Apache2手动安装成Windows的服务
如果在安装时没有将Apache安装成Windows的服务,那么安装结束后,也可以通过命令行来实现。在<APACHE_HOME>目录下的bin文件夹中,有Apache.exe文件。具有以下执行的参数:
安装为Windows服务
apache -k install -n "服务名"
要安装一个使用特定配置的服务,安装时指定配置文件:
apache -k install -n "服务名" -f "\my server\conf\my.conf"
要移除一个Apache服务,使用:
apache -k uninstall -n "服务名"
如果没有指定服务名,缺省地,将使用"Apache2"。
更多的命令可以用 apache -h 命令来查看。
将Apache2.2.8手动安装成Windows的服务
Apache仅能够在Windows NT上作为服务运行。
你可以选择在安装Apache时自动将其安装为一个服务。如果你选择"for all users",那么Apache将会被安装为服务。如果你选择了"only for the Current User",你可以在安装后手动将Apache注册为服务。注意,你必须是Administrators组的成员才能成功注册服务。
使用Apache Service Monitor工具,可以查看和管理你所在网络上的所有机器上安装的Apache服务的状态。为了能够使用这个工具管理Apache服务,你必须首先自动或手动安装Apache服务。
你可以在Apache安装目录的bin子目录下,使用如下命令将Apache安装为Windows NT服务:
httpd -k install
如果你想指定服务的名称,可以使用下面的命令。当你在同一机器上安装多个Apache服务时,你必须为它们指定不同的名字。
httpd -k install -n "服务名"
如果你想为不同名称的服务使用不同的配置文件,则安装时需要指定配置文件:
httpd -k install -n "服务名" -f "c:\files\my.conf"
如果你使用的是第一个命令,也就是除 -k install 外没有其它命令行参数,那么被安装的服务名称将是:Apache2.2 ,配置文件将使用conf\httpd.conf 。
要移除一个Apache服务很简单:
httpd -k uninstall
或者使用下述命令移除特定名称的Apache服务:
httpd -k uninstall -n "服务名"
通常,启动、重启、关闭Apache服务的方法是使用Apache Service Monitor工具,另外也可以使用控制台命令:NET START Apache2.2 和 NET STOP Apache2.2 或者通过Windows服务控制面板。在启动Apache服务之前,你应当使用下面的命令检查一下配置文件的正确性:
httpd -n "服务名" -t
你可以通过命令行开关来控制Apache服务。要启动一个已经安装的Apache服务,可以使用:
httpd -k start
要停止一个已经安装的Apache服务,可以使用:
httpd -k stop
或
httpd -k shutdown
要重启一个运行中的Apache服务,强制它重新读取配置文件,可以使用:
httpd -k restart
默认情况下,Apache服务将被注册为以本地系统用户(LocalSystem帐号)身份运行。LocalSystem帐号没有网络权限,不能通过任何Windows安全机制访问网络,包括文件系统、命名管道、DCOM或secure RPC ,但是它对于本地资源却拥有广泛的特权。
--------------------------------
以上转自 http://chenergan.iteye.com/blog/184470
--------------------------------
自己的经验:
使用命令 apache -k install -n 安装后,会出现启动失败,出现"the requested operation has failed",原因估计是默认安装的服务用的是80的端口,而80端口被占用了就会出现这种错误.
然后我使用读httpd.conf配置来安装服务,配置里面我把端口改成了8088,命令如下 httpd -k install -n "Apache2" -f "D:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf" ,大功告成.
分享到:
相关推荐
Apache无法启动解决_the_requested_operation_has_failed
apache启动报错:the requested operation has failed解决办法的几种解决方法!
pb连接SQLSERVER2005,提示如下错误:Unable to load the requested Database interface.Please make sure both the interface and client software are properly installed. 解决办法:下载ntwdblib.dll然后将其copy...
是我这两天频繁遇到的问题。Apache服务器还真是问题少年!任何点改动都可能导致它无法使用,下面结合网上搜来的内容,总结下自己关于此问题的解决方法,分享给大家
IIS访问ASP页面时报错The requested resource is in use.的解决办法
The requested URL’s length exceeds the capacity limit for this server.关于上面说的这个 Request-URI Too Large 问题,原因如下: apache的这错误是URL的长度超出了限制。URL的长度限制受浏览器和服务器的影响...
在修改httpd.conf支持php后,启动apache,报“the requested operation has failed”错误。 使用,命令行测试:命令为httpd.exe -w -n "apache2_2" k start; 错误为Cannot load php5apache2_2.dll。解决方法如下: ...
apache启动问题:1.80端口也可能被迅雷占用,打开迅雷——工具——配置——BT设置——端口设置随机生成。...2.还启动不了,选择“系统服务管理”(如图2)——选择Apache2,选择左侧启动此服务。(如图3)
git首次提交代码到远程仓库提示413错误,错误信息如下 git push --set-upstream origin master Enumerating objects: 153, done. ... HTTP 413 curl 22 The requested URL returned error: 413 Req
出现这种情况的原因通常是因为先安装了Framework,后安装的IIS; 运行cmd,输入: 代码如下:C:\Windows\Microsoft.NET\Framework\V4.0.30319\aspnet_regiis -i 注:C:\Windows\Microsoft.NET\Framework\V4.0....
shopex~shopex4.8更高开发环境配置,php配置windows ...注意:apache_2.0.55,启动时报“The requested operation has failed!”, 1.有可能你的80端口被占用(迅雷会占这个端口,关了迅雷就好了)。 2.看apache日志。
原因三:httpd.conf配置错误如果apache的配置文件httpd.conf搞错了,在windows里启动它,会提示the requested operation has failed,这是比较郁闷的事,因为查错要看个半天。其实可以用命令行模式启动apache,并带...
HTTP_Status_404(The_requested_resource_is_not_available)的几种解决方案_补充
the performance and operation of the system and set system parameters. ZwQuerySystemInformation ZwQuerySystemInformation queries information about the system. NTSYSAPI NTSTATUS NTAPI ...
VMware安装失败 “Failed to create the requested registry key Key,亲测成功解决问题
C++的Boost库书籍,详细探讨Boost库的各项特性,此书也提供了在线版 (https://theboostcpplibraries.com/) 供开发人员参考
学习PB与SQL Server数据库的连接