Apache Dynamic and static http://www.cnblogs.com/eoiioe/archive/2008/12/23/1360476.html (2.0 and 2.2)
For an understanding of the dynamic and static compilation of Apache , the metaphor for quoting someone is as follows:
Like there are two people a and m,a on behalf of APACHE,M Representative module, in order to let a use m of things, one way is to put m things to a there, a use is ready, is called static compilation
Another way is to tell A,m's address, when a to use M things, a to find m, and then use, however, this method to pay attention to a problem is: M must have a real address, otherwise a will not find m and produce error, this method is Apache dynamic (DSO) compiled.
Let's talk about the difference between apache1.3 and apache2.0 dynamic and static compiled compilation
The first is the static compilation of the apache1.3.29+php4.3.4+mysql4.0.13
Apache compiles for the first time and does not need to be installed because the PHP compilation requires that Apache have been compiled at least once
Tar zvxf apache_1.3.27.tar.gz
CD apache_1.3.27
./configure--prefix=/usr/local/apache
Compiling PHP
Tar zvxf php4.3.4.tar.gz
CD php4.3.4
./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-apache=. /apache_1.3.27
Make
Make install
The second compilation installs Apache:
Cd.. /apache_1.3.29
./configure--prefi=/usr/local/apache--activate-module=src/modules/php4/libphp4.a
Make
Make install
Cp.. /php4.3.4/php.ini.dist/usr/local/php/lib/php.ini
Modify/usr/local/apache/conf/httpd.conf
Find <ifmodule mod_mime.c>
Add in this range
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
Note: Apache and PHP source packages are in the same directory,--with-apache=. /apache_1.3.27 is the directory that points to the source code decompression
ok! static compilation is complete.
Then see the DSO Dynamic compilation method:
First compile and install Apache
Tar zvxf apache_1.3.29
CD apache_1.3.29
./configure--prefix=/usr/local/apache--enable-module=so--enable-module=rewrite--enable-shared=max
Make
Make install
So module is used to provide DSO support Apachehe core module, rewrite is the address rewrite module, if not required can not compile Enable-shared=max refers to all except so all standard modules are compiled into the DSO module.
Then compile PHP
Tar zvxf php4.3.4.tar.gz
CD php4.3.2
./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-apxs=/usr/local/apache/bin/apxs
Make
Make install
Then modify the Httpd.conf method with the static compilation method
OK,DSO dynamic compilation is complete!
Next we talk about the dynamic compilation method of apache2.0.46+php4.3.2
Compile and install Apache first
Tar zvxf httpd-2.0.46.tar.gz
CD httpd-2.0.46
./configure--prefix=/usr/local/apache2--enable-so--enable-mods-shared=most
Make
Make install
everyone noticed that--enable-so is quite the--enable-module=so with 1.3.27, and--enable-mods-shared=most is equivalent to the previous--enable-shared=max
And then compile the PHP
Tar zvxf php4.3.2.tar.gz
./configure--prefix=/usr/local/php--with-mysql=/usr/local/mysql--with-apxs2=/usr/local/apache2/bin/apxs
Make
Make install
notice this is apxs2!!.
Modify httpd.conf and 1.3.27 are also different, we look for add Type application/x-tar. tgz add below
AddType application/x-httpd-php. php
AddType Application/x-httpd-php-source. Phps
In addition, to display the Chinese language, please modify:
Adddefaultcharset gb2312
Apache's dynamic and static