The Apache HTTP server is designed to be a powerful and flexible server that can work on multiple platforms and different environments. Different platforms and different environments often have different needs, or different approaches are used to achieve the same best results. Apache is well adapted to a large number of different environments with its modular design. This design allows webmasters to determine different additional features of the server by loading different modules at compile time and runtime.
Apache 2.0 extends this modular design to the basic functionality of web servers. This version comes with a Multiprocessing Module (MPM) option to handle network port bindings, accept requests, and assign child processes to handle these requests. For example, if you need better scalability, you can choose a threaded MPM like a worker or event, and you need better stability and compatibility to adapt to some old software can use prefork.
In the main version of Redhat Linux as4, the apache version is httpd-2.0.5x, the default is prefork mode, mainly considering the stability reasons. To switch to worker mode, you need to log in to linux, do the following:
Enter /usr/sbin directory cd /usr/sbin
Rename the current prefork mode startup file to mv httpd Httpd.prefork
Rename the startup file of the worker mode to mv httpd.worker httpd
Modify the configuration file vi /etc/httpd/conf/httpd.conf and find the following section inside, which can be modified appropriately. Parameters such as load: <IfModule worker.c>StartServers 2MaxClients 150MinSpareThreads 25MaxSpareThreads 75ThreadsPerChild 25MaxRequestsPerChild 0</IfModule>
Restart the service /etc/init.d/httpd restart
Worker mode starts apache2
Note that you may encounter errors here:
Apache is running a threaded MPM, but your PHP
Module is not compiled to be threadsafe. You need To recompile PHP
. Pre-configuration failed! The solution is to comment out the line of code starting with LoadModule in the /etc/httpd/conf.d/php.conf file. --------------------------
Note: For stability and security reasons, it is not recommended to change the operation mode of apache2. Using the system default prefork can be a lot of other php modules can not work in the worker mode, such as redhat linux comes with php can not support thread safety, so it is best not to switch the working mode. ========================================================== /init.d/httpd stop[root@web ~]# which apachectl/usr/sbin/apachectl[root@web ~]# which httpd/usr/sbin/httpd[root@web ~]# cd /usr/sbin/[root@web ~]# mv httpd httpd.prefork# mv httpd.worker httpd# httpd -k start
According to foreign media reports, many users, like the author, have been intere
There is no new concept in this article. We just use command line tools to repeat what we have done
Many media and experts believe that Linux believes that Linux is more secure than Windows. However,
IAP, the full name is In-Application Programming, Chinese is interpreted as Programming in the prog
Display all process commands in linux
The virtual machine Debian NIC cannot be started
Redhat/Centos NIC binding basic tutorial
Linux system JDK installation and configuration basic tutorial
Easily switch the language of mac apps
Linux to view a port usage and kill
Linux dynamic library and static library comparison file preview
Forgot the Ubuntu root password solution
Linux+Apache+Mysql+PHP build detailed instructions
UNIX system failures and solutions
WeChat small video no sound how to do
How to open telnet function in Linux?
Win10 fixed the Recycle Bin to the quick access method
Win7 system web page font size setting method
How to convert pdf format file into excel table format under win7 system
How does Win7 open the telnet command?
Win8.1 notebook blackout solution when unplugging the power cord