LNMP environment setup-Apache and lnmp for apache
1. view the compiled modules in Apache DSO (Dynamic Shared Object) (1:
[root@kallen ~]# httpd -MLoaded Modules: core_module (static) mpm_prefork_module (static) http_module (static) so_module (static) auth_basic_module (shared) auth_digest_module (shared) authn_file_module (shared) authn_alias_module (shared)
(2) view the static compilation module:
[root@kallen ~]# httpd -lCompiled in modules: core.c prefork.c http_core.c mod_so.c
2. Apache MPM (Multi Process Modules) (1) default MPM for different platforms:
Architecture |
MPM Type |
BeOS |
Beos |
Netware |
Mpm_netware |
OS/2 |
Mpmt_os2 |
Unix |
Prefork, worker |
Windows |
Mpm_winnt |
(2) view the MPM of the current apache service:
[Root @ kallen ~] # Httpd-V or httpd-l
[root@kallen ~]# httpd -VServer version: Apache/2.2.15 (Unix)Server built: Aug 2 2013 08:02:15Server's Module Magic Number: 20051115:25Server loaded: APR 1.3.9, APR-Util 1.3.9Compiled using: APR 1.3.9, APR-Util 1.3.9Architecture: 64-bitServer MPM: Prefork threaded: no forked: yes (variable process count)Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled) -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D DYNAMIC_MODULE_LIMIT=128 -D HTTPD_ROOT="/etc/httpd" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="run/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf"
Prefork:Non-thread, pre-Generated Process MPM
This MPM has a strong self-regulation capability and requires only a small amount of configuration instructions. The most important thing is to set MaxClients to a value that is large enough to handle potential request peaks. At the same time, it cannot be too large. As a result, the memory used exceeds the physical memory size;
<IfModule prefork.c>StartServers 8 MinSpareServers 5 MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 4000 </IfModule>
Worker:Threaded and multi-process MPM
Because threads are used to process requests, a large number of requests can be processed, and the overhead of system resources is less than the MPM Based on processes. However, it also uses multiple processes, and each process has multiple threads to obtain the stability of the process-based MPM. The most important command to control this MPM is to control ThreadsPerChild for the number of threads allowed to be established by each sub-process, and to control the MaxClients command for the total number of threads allowed to be established;
<IfModule worker.c>StartServers 4MaxClients 300MinSpareThreads 25MaxSpareThreads 75ThreadsPerChild 25MaxRequestsPerChild 0</IfModule>
【Note]LNMPGenericLAMPOrLNMP.
Hot recommendations
LNMP environment setup-Nginx
Configure the local YUM source in RHEL6.5
Installing and using Zabbix in Ubuntu
Troubleshooting of MySQL dual-master hot standby
- Rsync synchronization error handling
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.