Apache installation and configuration basics (-) httpd -t

download address

apache download
insert image description here
insert image description here
ApacheHaus is free of installation,
insert image description here
then unzip the above file, put the inside
insert image description here
insert image description here

Because the default port of apache is 80, if this port is occupied, the apache service cannot be started

netstat -ano|findstr 80
insert image description here

apache modify port number

insert image description here
insert image description here

create apache service

In the bin directory of apache, enter cmd, you can directly switch to this directory with cmd
insert image description here

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”
insert image description here
insert image description here
insert image description here
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

insert image description here
insert image description here
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,

insert image description here

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.

insert image description here

Test the configuration file of the service:
httpd -t
Test the configuration file of the specified service:
httpd -n "MyServiceName" -t

default directory

insert image description here

Guess you like

Origin blog.csdn.net/u013400314/article/details/131598720