Saturday, November 27, 2010

Apache's static/dynamic compile the application in a Web environment

System and the required software: apache 1.3.27 and Redhat9.0: 2.0.46 php 4.3.2 mysql 4.0.13:: 1.

First of all to install mysql, this is not our focus, therefore on mysql installation configuration I will soon have passed tarzvxfmysql-4.0.13.tar.gz cdmysql-4.0.13./configure--prefix =/usr/local/mysql--sysconfdir =/etc--localstatedir =/var/lib/mysql & & make & install complete & makeinstall! and then initialize database/usr/local/mysql/bin/mysql_install_db set permissions: chown-Rroot/usr/local/mysql replication configuration files; Cp/usr/local/mysql/share/mysql/my-medium.cnf/etc/my.cn start mysql:/use/local/mysql/bin/mysqld_safe--user = root & modify password: initial root password is empty/usr/local/mysql/bin/mysqladmin-uroot-ppassword1234 enterpassword: the password was changed to 1234, due to the initial password is blank, so just directly enter enterpassword test your new password: mysql-uroot-pmysql enterpassword: 1234 if you hopefully will be able to access mysql. Well so much for mysql is, what questions not to ask me, I'm not very familiar with mysql. Well here is we play, I will separately through static and dynamic DSO build apache + pp as regards what is static, what is a DSO dynamic I'm not here to say, I personally prefer all DSO dynamic compilation. First is apache1.3.29 + php4.3.4 + mysql4.0.13 static compilation compiles apache for the first time, and do not install because apache php compile needs are already compiled at least once tarzvxfapache_1.3.27.tar.gz cdapache_1.3.27./configure--prefix =/usr/local/apace compile pp tarzvxfphp4.3.4.tar.gz cdphp4.3.4./configure--prefix =/usr/local/php--with-mysql =/usr/local/mysql\--with-apache = .. /Apache_1.3.27 & & make & & makeinstall second compilation cd .. installed apace: /apache_1.3.29  ./configure--prefi=/usr/local/apace\  --activate-module=src/modules/php4/libphp4.a&&  make&&  makeinstall  cp.. /Php4.3.4/php.ini.dist/usr/local/php/lib/php.ini modify/usr/local/apache/conf/httpd.con find in this range add AddTypeapplication/x-httpd-php.pp AddTypeapplication/x-httpd-php-source.pps Note: apache and PHP's source package, in the same directory--with-apache = .. /Apache_1.3.27 is a pointer to the source code to extract the directory ok! statically compiled, we start up the server/usr/local/apache/bin/apachectlstart then them php test page info.php: normal content as follows, you should be able to see the PHP info, I congratulate you on static compilation is successful we'll speak about!!! DSO dynamic compilation approach: first compile and install apace tarzvxfapache_1.3.29 cdapache_1.3.29./configure--prefix =/usr/local/apache--enable-module = so\--enable-module = rewrite--enable-shared = max & & make & & makeinstall so module is used to provide the DSO support for core module rewrite apachehe is address rewriting module, if you do not need can not compile enable-shared = max refers to all except so standard modules are compiled into a DSO module. Then compile pp tArzvxfphp4.3.4.tar.gz cdphp4.3.2./configure--prefix =/usr/local/php--with-mysql =/usr/local/mysql\--with-apxs =/usr/local/apache/bin/apxs & & make & & makeinstall then modify httpd.conf, method with the static compile method OK, DSO dynamic compilation is complete, you should see the Church to the bar, what is the difference between should see very clearly the bar!!! next we compile apache2.0.46 + php4.3.2 method, I am here to talk about DSO dynamic compilation, static compilation is really no time to test. Now compile and install as apace tarzvxfhttpd-2.0.46.tar.gz cdhttpd-2.0.46./configure--prefix =/usr/local/apache2--enable-so\--enable-mods-shared = most & & make & & makeinstall attention--the equivalent of 1.3.27 enable-so--enable-module = so, and--most enable-mods-shared = and equivalent and previous--enable-shared = max these differences we should pay attention to, otherwise compiled wrong not to find me then or compile PP tarzvxfphp4.3.2.tar.gz./configure--prefix =/usr/local/php--with-mysql =/usr/local/mysql\--with-apxs2 =/usr/local/apache2/bin/apxs & & make & & makeinstall attention here is apxs2!!! httpd.conf and 1.3.27 vary, we find AddTypeapplication/x-tar.tgz below add AddTypeapplication/x-httpd-php.pp AddTypeapplication/x-httpd-php-source.pps addition to display Chinese, modify: AddDefaultCharsetgb2312 JumpStart apace/usr/local/apache2/bin/apachectlstart test with the info.php

No comments:

Post a Comment