Why can't I add more hosts after my Apache server supports a certain number of virtual hosts?
Source: Internet
Author: User
Article Title: Why can't I add more servers after my Apache server supports a certain number of virtual hosts. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Problem Analysis: You may have reached the upper limit of a resource in your system. Most likely, the pre-defined file descriptor limit has been reached. Some library programs (such as gethostbyname () do not correctly feed it back to Apache when they cannot obtain the file descriptor, therefore, Apache cannot discover this problem on its own. Each log file requires a file descriptor. If each virtual host defines its own error log and access log, two file descriptors are required, each listener also occupies a file description symbol. Generally, the number of virtual hosts supported by each machine ranges from 128 to 250.
When the file descriptor limit is reached, Apache may encounter some problems, such as using SIGSEGV dump core, service suspension, or service running with faults, and recording other errors in the error log. The most common is that CGI programs cannot run.
?? Solution:
1. Reduce the listening process;
If Apache does not provide other services, you only need to have it listen to port 80.
2. Reduce the number of log files;
You can use mod_log_config to write all records to the same file, and then use a script to separate the records.
3. Increase the maximum number of available file descriptors;
4. Reduce the number of virtual hosts;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.