Static and dynamic compilation Apache+php+mysql whole process

Source: Internet
Author: User

Static/Dynamic Compilation Apache+php+mysql

Required Software:

apache:1.3.27

php:4.3.2

mysql:4.0.13

First to install MySQL

Tar zvxf mysql-4.0.13.tar.gz

CD mysql-4.0.13

./configure--prefix=/usr/local/mysql--sysconfdir=/etc--localstatedir=/var/lib/mysql

Make

Make install

Installation complete.

Then initialize the database

/usr/local/mysql/bin/mysql_install_db--user=mysql

To set permissions:

Chown-r Root/usr/local/mysql

Chown-r Mysql/usr/local/mysql/var

Chgrp-r Mysql/usr/local/mysql

Copy configuration file;

Cp/usr/local/mysql/share/mysql/my-medium.cnf/etc/my.cnf

Start MySQL:

/use/local/mysql/bin/mysqld_safe--user=mysql &

Modify Password: The initial root password is empty

/usr/local/mysql/bin/mysqladmin-u root-p Password 123456

Enter Password:

To change the password to 123456, because the initial password is empty, so enter password direct return on the line

Test the new password:

Mysql-u root-p MySQL

Enter password:123456

If it goes well, you can get into MySQL.

The first is apache1.3.29+php4.3.4+mysql4.0.13 's static compilation

Apache is first compiled and does not have to be installed because the PHP compilation requires that Apache has 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

Second compilation installs Apache:

       
        
         
        Cd.. /apache_1.3.29./configure--prefix=/usr/local/apache \--activate-module=src/modules/php4/libphp4.a Makemake 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 complete, everyone just start the server

/usr/local/apache/bin/apachectl start

Then posting the PHP test page info.php: The contents are as follows:

       
        
         
        ? Phpinfo ();?>
       
        

Normal, should be able to see the information of PHP, then static compilation success!

The following is about 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

Make

Make install

So module used to provide DSO support Apachehe core module, rewrite is the address rewrite module, if you do not need to compile

Enable-shared=max means that all standard modules except so 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 static compilation methods

OK, dynamic compilation is completed, what is the difference between the people should see very clearly!



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.