1. How to make Apache listen on a specific port
Modify the httpd.conf inside the listen options, such as:
Listen 8000
is to make Apache listen on port 8000.
And if you want to specify both a listening port and a listening address, you can use:
Listen 192.170.2.1:80
Listen 192.170.2.5:8000
This allows Apache to simultaneously listen on the 192.170.2.1 80 port and the 192.170.2.5 8000 port.
Of course, you can also set in httpd.conf:
Port 80
This will achieve a similar effect.
How to limit the size of the message body of an HTTP request in 2.apache
Inside the httpd.conf set:
Limitrequestbody N
n is an integer and the unit is byte.
CGI scripts generally submit the contents of the form as the body of the message to the server for processing, so the size of the message body is now useful when using CGI. For example, use CGI to upload files if there are settings:
Limitrequestbody 102400
Then the upload file more than 100k time will be an error.
3. How to enable Apache to authenticate client domain
You can set it in httpd.conf:
Hostnamelookups on|off|double
If you are using on, then only a reverse search, if used double, then the reverse search after a positive resolution, only two of the results are consistent with each other, and off is not to verify the domain name.
It is recommended to use double for security purposes, and off is recommended for faster access.
4. How to set the duration of the session in Apache
In the apache1.2 version above, you can set the inside httpd.conf:
KeepAlive on
KeepAliveTimeout 15
This will limit the retention time of each session to 15 seconds. The use of session can make many requests can be sent through the same TCP connection, saving network resources and system resources.
5. How to make Apache monitor only in specific IP
Modify the httpd.conf and use it inside
Bindaddress 192.168.0.1
This allows Apache to only listen to external HTTP requests for 192.168.0.1. If you use:
Bindaddress *
Indicates that Apache listens for HTTP requests on all network interfaces.
Of course, with a firewall can also be achieved.