Integration of Apache, php3, and MySQL in Linux

Source: Internet
Author: User
Tags uncompress
Integration of Apache, php3, and MySQL in Linux-Linux Enterprise Application-Linux server application information. For details, refer to the following section. 1. required installation packages
Apache_1.3.19.tar.gz
Php-4.0.4.tar.gz
Mysql-3.23.32.tar.gz
Note: The above are source code, not RPM packages.

Ii. Software Installation
1. Install MySQL
(1) uncompress the package

Cd/usr/local
Tar-zvxf mysql-3.23.32.tar.gz

(2) Move the generated mysql-3.23.32 directory to/usr/local/mysql

Music mysql-3.23.32/usr/local/mysql

(3) Compile MySQL

Cd/usr/local/mysql
./Configure -- prefix =/usr/local/mysql
Make
Make install

(4) install database files

/Usr/local/mysql/scripts/mysql_install_db
/Usr/local/mysql/bin/safe_mysqld &

(5) MySQL authorized operations

MySQL's access control technology is more flexible than ipvs. The username and password encryption algorithms used by MySQL are different from those used by Unix systems. The username can be up to 16 characters long.
Log on to MySQl as root, and then type grant all privileges on * at the MySQL prompt *. * to thj @ localhost identified by 'thj' with grant option; in this way, MySQL can be used no matter where thj logs in to this server.

(6) Simple MySQL database operation statement

Create a database
Command: create database name;
Delete Database
Command: drop database name;
Query the databases in MySQL.
Command: show databases;
Change the currently used database
Command: use tbl_name
Create a data table
Command: create table tbl_name (column_specs );
Description: tbl_name description of columns in the column_specs table
Queries the structure of a specified data table.
Command: describe tbl_name;
Query the data tables in the database.
Command: show tables;
Add new record
Command: insert into tbl_name (col_name1, col_name2 ,...) Values (values1, values2 ,....)
Note: The insert statement is easy to use, but it also has a defect that only one record can be inserted at a time.
Batch load data
Command: load data local infile into filename.txt "into table tbl_name;
Note: The MySQl version must not be earlier than 3.22.15. Otherwise, load data local does not work. This statement actually calls/usr/bin/mysqlimport.
Search information
Command: select the conditions that must be met for where data from one or more tables.
Note: in MySQL, after each command is entered, ";" should be typed at the end of the command line to mark a command, or press enter and then press go, prompt the system to execute the preceding command. In most MySQL reference books, the command is in upper case, which can be in lower case. Also, the use statement can be left blank with ";", this is the only statement in all MySQL languages that can be executed without adding.
Note: The installation of MySQL ends here.
2. Hybrid compilation of Apache and PHP3
(1) uncompress the package

Cd/usr/local
Tar xvzf apache_1.3.19.tar.gz
Tar xvzf php-4.0.4.tar.gz
Mv apache_1.3.19.tar.gz apache
Music php-4.0.4.tar.gz php

(2) set the installation directory of Apache to/usr/local/apache.

Cd apache
./Configure -- prefix =/usr/local/apache -- with-port = 8000

(3) The configuration supports MySQL, is used as the Apache function module, and the tracking variable is valid.

Cd ../php
./Configure -- with-mysql =/usr/local/mysql -- with-apache = ../apache -- enable-track-vars? With-pgsql =/usr/lib/pgsql -- prefix =/usr/local/apache/php? With-config-file-path =/usr/local/apache/php
Make
Make install
Note: PHP installation ends here

(4) Configure Apache and add the PHP4 Module

Cd ../apache
Cp/usr/local/php/libs/libphp4.a \
/Usr/local/apache/src/modules/php4
./Configure -- prefix =/usr/local/apache -- activate-module = src/modules/php4/libphp4.a -- with-port = 8000
Make
Make install
Note: APACHE installation is complete.

3. Change configuration
(1) copy the php. ini file to the/usr/local/apache/php Directory.

Cd ../php
Cp php. ini-dist/usr/local/apache/php/php4.ini

(2) Change the Apache configuration file

Cd/usr/local/apache/conf
Vi httpd. conf
Find AddType application/x-httpd-php. php4 and delete the # number in front of it. Of course, you can also add a line of AddType application/x-httpd-php3.asp so that it is easier to edit with FrontPage.
Run/usr/local/apache/bin/apachectl start to start the apache process.
Related Article

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.