HTTPD.CONF Configuration Error
If Apache configuration file httpd.conf wrong, start it in Windows, will prompt the requested operation has failed, this is more depressed thing, because the wrong to see a half day.
In fact, you can start Apache with command-line mode, and with parameters, Apache will prompt you which sentence is wrong, and then can be targeted to solve, the command is as follows: Httpd.exe-w-n "Apache2"-K Start
You can install an Apache service in the bin subdirectory of the Apache installation directory using the following command. If you do not specify a service name and profile, use the default service name Apache2.2 at installation, the default profile conf/httpd.conf.
- C:\Apache2.2\bin> Httpd-k Install
When multiple Apache services are installed on the same machine, they must be assigned a different name, which makes them easy to administer. You can use the following command to specify the name of the service, where "Apacheshop" is the specified service name.
- C:\Apache2.2\bin> Httpd-k install-n apacheshop
If you want to specify a different configuration file for different services, you can use the following command at installation time to specify:
- C:\Apache2.2\bin> Httpd-k install-n
Apacheshop-f "C:/apache2.2/conf/my.conf"
- C:\Apache2.2\bin> Httpd-k Uninstall
You can also remove a service with the specified name, as follows:
- C:\Apache2.2\bin> Httpd-k uninstall-n apacheshop
The way to start, stop, and restart the Apache service is typically using the Apache Services Monitor tool, or you can use the console command: net start Apache2.2 and net stop Apache2.2, or use the Services under Windows Control Panel.
Before you start the Apache service, you can use the following command to check the correctness of the configuration file.
- C:\Apache2.2\bin> Httpd-n apache2.2-t
You can also control Apache services from the command line. To start an installed service:
- C:\Apache2.2\bin> Httpd-k start
To stop an installed service:
- C:\Apache2.2\bin> Httpd-k Stop
Or
- C:\Apache2.2\bin> Httpd-k shutdown
To restart a running service, you can force it to reload the configuration file by using the following command:
- C:\Apache2.2\bin> Httpd-k restart
The httpd command is very important and is described in detail below.
- httpd [-D name] [-D directory] [-f file]
- [-C "directive"] [-C "directive"]
- [-W] [-K Start|restart|stop|shutdown]
- [-K Install|config|uninstall] [-N Service_Name]
- [-V] [-V] [-h] [-l] [-l] [-T] [-S]
Apache server cannot start viewing startup error messages