Clarify: There are two ways to integrate Apache into PHP: one is the DSO mode, which calls PHP as an external module of Apache, which increases the flexibility of Apache, however, the performance will be reduced by 5%. Another way is to compile PHP into the Apache kernel.
Clarify: There are two ways to integrate Apache into PHP: one is the DSO mode, which calls PHP as an external module of Apache, which increases the flexibility of Apache, but it will bring about a 5% reduction in performance. Another way is to compile PHP into the Apache kernel, so as to sacrifice the mobility of the future adjustment (every time PHP is re-compiled, but the performance will be higher. This is also true for Perl. In contrast, I prefer to use the second method, that is, to compile PHP into the static kernel of Apache.
1. compile Apache:
1. enter Apache to expand the directory;
2../configure--prefix =/usr/local/apache1.3--disable-module = all \
--Enable-module = access--enable-module = log_config \
--Enable-module = dir--enable-module = mime \ # Basic module of Apache
(Clarification: If the DSO method will be applied in the future,--enable-mdule = so will be added during compilation)
2. install PHP:
1. enter PHP to expand the directory;
2../configure--prefix =/usr/local/php4 \
--With-apache = ../apache_1.3.27 # specify the Apache source code directory.
3. make; make install
3. install Apache:
1. enter Apache to expand the directory;
2../configure--prefix =/usr/local/apache1.3--disable-module = all \
--Enable-module = access--enable-module = log_config \
--Enable-module = dir--enable-module = mime \
--Activate-module = src/modules/php4/libphp4.a # compile the PHP module
3. make; make install
4. Configure Apache:
Corrected the httpd. conf document:
1. Timeout 300 ---> Timeout 120
2. MaxKeepAliveRequests 100
3. KeepAliveTimeout 5
4. ServerSignature on ---> ServerSignature off
5. the Options Indexes FollowSymLinks line deletes indexes (the Options in the directory do not include the index option)
6. change the user and group running Apache to nobody.
7. MaxClients 150 --> MaxClients 1500
(How many basic algorithms does this parameter have? for example, on 2 GB machines, an Apache + PHP process consumes about 4 MB of memory, the maximum efficiency is 2g/4 m * 2 = 1000, and the maximum number of processes is 1000*1.5 = 1500; 1.3 to adjust to more than 256, you must correct the source code before compiling Apache)