Apache uses tips

xiaoxiao2021-03-06  125

1. How to make Apache listens at specific ports

Modify httpd.conf About Listen's options, for example:

Listen 8000

Is the Apache listens at 8000 ports

And if you want to specify the listening port and listen address, you can use:

Listen 192.170.2.1:80

Listen 192.170.2.5:8000

This makes Apache simultaneously listens at 80 ports of 192.170.2.1 and 8000 ports of 192.170.2.5.

Of course, you can also set it in httpd.conf:

Port 80

This will achieve a similar effect.

2. How to limit the size of the message main body of the HTTP request in theApache

Set in httpd.conf:

LimitRequestBody N

n is an integer, and the unit is byte.

The CGI script generally submits the contents of the form as the body of the message to

The server is handled, so the size of the message main body is now useful when using CGI. For example, use CGI to upload files, if there is a setting:

LimitRequestBody 102400

Then the upload file exceeds 100K, it will report an error.

3. How to make Apache to verify the client

Can be set in httpd.conf:

Hostnamelookups on off double

If you use ON, then only one check, if you use Double, then a forward resolution after performing a reflection, only twice the results are in line with each other, and OFF is not domain name verification.

If it is for security, it is recommended to use Double; in order to speed up the access speed, it is recommended to use OFF.

4. How to set up the duration of the session in Apache

In the version above Apache1.2, you can set in httpd.conf:

Keepalive ON

KeepaliveTimeout 15

This limits the holding time of each session for 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 only listen in specific IP

Modify httpd.conf, use inside

Bindaddress 192.168.0.1

This allows Apache only listens the outside world to 192.168.0.1 HTTP requests. If you are using:

Bindaddress *

Type Apache listens to HTTP requests on all network interfaces.

Of course, you can also be implemented with a firewall.

转载请注明原文地址:https://www.9cbs.com/read-101951.html

New Post(0)