Install Windows Services manually using Apache (solve the requested operation h ..)

Source: Internet
Author: User

Manually install apache2 as a Windows Service

If Apache is not installed as a Windows service during installation, you can use the command line to complete the installation. In the binfolder under the <apache_home> directory, there is an apache.exe file. Has the following execution parameters:

Install as a Windows Service
Apache-K install-n "service name"
To install a service that uses specific configurations, specify the configuration file during installation:
Apache-K install-n "service name"-F "/my server/CONF/My. conf"
To remove an apache service, use:
Apache-K uninstall-n "service name"

If no service name is specified, "apache2" is used by default ".
You can use the Apache-H command to view more commands.

Manually install apache2.2.8 as a Windows Service

Apache can only run as a service on Windows NT.
You can choose to automatically install Apache as a service when installing Apache. If you choose "for all users", Apache will be installed as a service. If you select "only for the current user", you can manually register Apache as a service after installation. Note: You must be a member of the Administrators group to successfully register the service.
You can use the apache service Monitor Tool to view and manage the status of Apache services installed on all machines on your network. To use this tool to manage Apache services, you must first install the apache service automatically or manually.
You can use the following command to install Apache as a Windows NT Service in the bin subdirectory of the Apache installation directory:
Httpd-K install
If you want to specify the service name, you can use the following command. When You Install Multiple Apache services on the same machine, you must specify different names for them.
Httpd-K install-n "service name"
If you want to use different configuration files for services with different names, you must specify the configuration file during installation:
Httpd-K install-n "service name"-F "C:/files/My. conf"
If you are using the first command, that is, there are no other command line parameters except-K install, the installed Service name will be: apache2.2, the configuration file will use CONF/httpd. conf.
It is easy to remove an apache service:
Httpd-K uninstall
Alternatively, run the following command to remove the apache service with a specific name:
Httpd-K uninstall-n "service name"
Generally, the apache service monitor tool is used to start, restart, and shut down the apache service. You can also use the Console Commands: Net start apache2.2 and net stop apache2.2 or use the Windows Service Control Panel. Before starting the apache service, you should use the following command to check the correctness of the configuration file:
Httpd-n "service name"-T
You can use the command line switch to control the apache service. To start an installed apache service, you can use:
Httpd-K start
To stop an installed apache service, you can use:
Httpd-K stop
Or
Httpd-K shutdown
To restart a running Apache service and force it to re-read the configuration file, you can use:
Httpd-K restart
By default, the apache service is registered as a local system user (LocalSystem account. LocalSystem accounts have no network permissions and cannot access the network through any Windows security mechanism, including file systems, named pipelines, DCOM, or secure RPC, but they have extensive privileges for local resources.

--------------------------------
The above is transferred from http://chenergan.javaeye.com/blog/184470

--------------------------------
Your own experience:
After the command APACHE-K install-N is run, the startup fails and the "the requested operation has failed" error occurs. It is estimated that the default service is installed on port 80, this error occurs when port 80 is occupied.
Then I use read httpd. CONF configuration to install the service. In the configuration, I changed the port to 8088. The command is as follows: httpd-K install-n "apache2"-F "D: /program files/Apache Software Foundation/apache2.2/CONF/httpd. conf ", success.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.