LAMP = Linux + Apache + Mysql + PHP
This architecture is a group of open-source software that builds dynamic websites or servers.
Linux refers to the Operating System (Red Flag, slackware, and Red Riding Hood Series)
Apache is a web server
Mysql is a database management system or database server.
Php scripting language
1. installation environment
Operating System: Red Hat Linux Enterprise AS 4.0
Database: MySQL 5.0.24
Web server: Apache 2.2.3
Script Language: PHP 5.1.6
2. Install MySQL 5.0.24
-------------Download Software Package mysql-5.0.24.tar.gz, address http://www.mysql.com -------------
# Tar zvxf mysql-5.0.24.tar.gz // Extract
# Cd mysql-5.0.24 // enter the decompressed file directory
#./Configure -- prefix =/usr/local/mysql // set the installation directory
-- Enable-thread-safe-client // compile the client library of thread security Edition
-- Without-debug // disable the debug function
-- Localstatedir =/data/mysqldata // www.linuxidc.com set the database file directory
# Make // compile
# Make install // install
#/Usr/local/mysql/bin/mysql_install_db // initialize authorization
# Chown-R root: root/usr/local/mysql // change the file attribute to the root user
# Cp/usr/local/mysql/share/mysql/my-medium.cnf/etc/my. cnf // copy the configuration file
---------------------------------- Start the MySQL service ----------------------------------
#/Usr/local/mysql/bin/mysqld_safe -- user = root & // start MySQL
-------------------------------- Change the MySQL password ----------------------------------
#/Usr/local/mysql/bin/mysqladmin-uroot password mysqlsecret // change the password
---------------------------------- Close the MySQL service ----------------------------------
#/Usr/local/mysql/bin/mysqladmin-uroot-pmysqlsecret shutdown // close MySQL
3. install Apache 2.2.3
-------------Download Software Package httpd-2.2.3.tar.gz, address http://www.apache.org -------------
# Tar zvxf httpd-2.2.3.tar.gz
# Cd httpd-2.2.3
#./Configure -- prefix =/usr/local/apache
-- Enable-module = most
-- Enable-shared = max
# Make
# Make install
---------------------------------- Start the Apache service ----------------------------------
#/Usr/local/apache/bin/apachectl start
---------------------------------- Close the Apache service ----------------------------------
#/Usr/local/apache/bin/apachectl stop
-------------------------------- Restart the Apache service ----------------------------------
#/Usr/local/apache/bin/apachectl restart
4. install PHP 5.1.6
-----------------Download the software package php-5.1.6.tar.gz at www.php.net --------------------
# Tar zvxf php-5.1.6.tar.gz
# Cd php-5.1.6
#./Configure -- prefix =/usr/local/php
-- With-mysqld =/usr/local/mysql
-- With-apxs2 =/usr/local/apache/bin/apxs
# Make
# Make install
# Cp php. ini-dist/usr/local/php/lib/php. ini
5. Configure the httpd. conf file of the Apache service
* Add LoadModule php5_module module/libphp5.so to LoadModule.
* Add index. php at DirectoryIndex
* Add in AddType application
AddType application/x-httpd-php. php. phtml
AddType applicatoin/x-httpd-php-source. phps