Five Apache Tips_PHP Tutorial

WBOY
Release: 2016-07-13 17:29:47
Original
744 people have browsed it

1. How to make apache listen on a specific port

Modify the Listen options in httpd.conf, for example:
Listen 8000
is to make apache listen on port 8000
If you want to specify the listening port and listening address at the same time, you can use:
Listen 192.170.2.1:80
Listen 192.170.2.5:8000
This will cause apache to listen to port 80 of 192.170.2.1 and port 8000 of 192.170.2.5 at the same time.
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 body of http request in apache

Set in httpd.conf:
LimitRequestBody n
n is an integer, the unit is byte.
CGI scripts generally submit the content in the form as the body of the message to the server for processing, so the size of the message body is now very useful when using cgi. For example, if you use cgi to upload files, if there is a setting:
LimitRequestBody 102400
then an error will be reported when the uploaded file exceeds 100k.

3. How to make apache perform domain name verification on the client

Can be set in httpd.conf:
HostnameLookups on|off|double
If on is used, only one reverse check will be performed. If double is used, then a forward check will be performed after the reverse check. For analysis, only the two results are consistent with each other, and off means that domain name verification is not performed.
For security reasons, it is recommended to use double; to speed up access, it is recommended to use off.

4. How to set the session duration in apache

In versions above apache 1.2, you can set it in httpd.conf:
KeepAlive on
KeepAliveTimeout 15
This will limit the retention time of each session to 15 seconds. The use of session allows many requests to be sent through the same TCP connection, saving network resources and system resources.

5. How to make apache only listen on a specific ip

Modify httpd.conf and use
BindAddress 192.168.0.1
This will make apache only listen to external http requests for 192.168.0.1. If you use:
BindAddress *
, it indicates that apache listens to http requests on all network interfaces.
Of course it can also be achieved using a firewall.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/531656.htmlTechArticle1. How to make apache listen on a specific port and modify the Listen option in httpd.conf, for example: Listen 8000 It is to make apache listen on port 8000. If you want to specify the listening port and...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!