Detailed introduction: Apache + PHP + MySQL configuration strategy

Source: Internet
Author: User

I. system requirements:

The system passed the REDHAT7.2 test.

Ii. server software requirements:

1: Download apache web server http://www.apache.org/

2. Go to the php Web site to download the php parser http://www.php.net/

3. Download the mysql http://sourceforge.net/projects/mysql/ from the mysql website

Iii. Install and debug WEB SERVER

Download the above files and put them in the same directory. I will put them under/usr/local and use the tar command to unpack the files.

  

Tar zxvf apache_1.3.12.tar.gz
Tar zxvf php-4.0.6.tar.gz
Tar zxvf mysql-3.22.40.tar.gz

For ease of installation, it is recommended to name the Directory

  

# Mv apache_1.3.12 apache
# Music php-4.0.6 php
# Music mysql-3.22.40 mysql

Install mysql

4. Install mysql before installing web Services

  

Cd mysql
./Configure
Make
Make install

Depending on the machine performance, the compilation process takes some time. After compilation, the system installs mysql under/usr/local by default.

After the installation is complete, start the mysql process.
Cd/usr/local/bin

./Mysql_install_db (install the basic mysql database)

./Safe_mysqld & (starts the process and transfers it to the background)

Here mysql is installed. Run./mysql to check whether the database can be connected. If it is normal, you can see this interface.

  

Welcome to the MySQL monitor. Commands end with; or g.
Your MySQL connection id is 880 to server version: 3.22.40
Type 'help' for help.
Mysql>

Congratulations, you have installed mysql.

For mysql usage, refer to his doc document.

5. Integrate apache and php4

This is the key and the most difficult step for all the work. It may be because of such errors during the installation of different versions. You can modify the version information accordingly.

Cd apache

./Configure

This is dispensable, but I have to make this step

  

Cd ../php
./Configure -- with-mysql =/usr/local -- with-apache =/usr/local/apache -- enable-track-vars
Make
Make install
Cd ../apache
./Configure -- activate-module = src/modules/php4/libphp4.a
Make
Make install

This step is to install the apache WEB service. You can refer to./configure-help to add the required modules or install the service by referring to the installation manual.

Copy the php configuration file to the corresponding directory.

Cd ../php

Cp php. ini-dist/usr/local/lib/php. ini

Php. ini does not need to be modified. You can refer to the relevant instructions for modification.

After configuring PHP, configure Apache Web SERVER. Configure httpd. conf first.

Cd/usr/local/apache/conf

Vi httpd. conf

Modify the following content for php:

# AddType application/x-httpd-php. php

# AddType application/x-httpd-php-source. phps

Remove the annotator of the above two lines and determine the suffix of the php document based on the actual situation. According to the needs of horde, we recommend that you change the first line to the following form:

AddType application/x-httpd-php. php. php3. htm. phtml. php4

In addition, you need to modify the default home page type. We recommend that you change DirectoryIndex index.htm to the following:

DirectoryIndex index.htm index.html index. php3 index. php default. php

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.