download address
apache download
ApacheHaus is free of installation,
then unzip the above file, put the inside
Because the default port of apache is 80, if this port is occupied, the apache service cannot be started
netstat -ano|findstr 80
apache modify port number
create apache service
In the bin directory of apache, enter cmd, you can directly switch to this directory with cmd
httpd -k install #Install the service name of the default name
httpd -k install -n service name#Install the specified service name
httpd -k uninstall -n server name#Uninstall the specified service name
If you need specifically named configuration files for different services, you must use the following command:
httpd.exe -k install -n “MyServiceName” -f “c:\files\my.conf”
Apache starts, stops and restarts generally in three ways
1: Through the above visualization tools
2. Through the services under the window [enter services in cmd .msc]
3. Through the apache command line
Start: httpd –k start
Restart: httpd –k restart
Stop: httpd –k stop
Start, restart, stop the name of the specified service: add -n “server name” after each
For example: start the name of the specified service httpd –k start - n "Server Name"
test is OK,
the requested operation has failed
After changing the conf of apache, remember to use httpd -t to see if the syntax of the configuration is correct.
Test the configuration file of the service:
httpd -t
Test the configuration file of the specified service:
httpd -n "MyServiceName" -t