LAMP represents the combination of Apache Web server, MySQL database and PHP script programming language on Linux platform, is an important platform for developing and implementing High-performance WEB applications, and the most popular technology in the internet age. Today, lamp-using sites have dominated the market, and Netcraft's monthly survey will tell you how popular the lamp is.
Installing and configuring LAMP under Gentoo is a relatively easy task.
1. Apache Installation and Configuration
Install Apache:
# emerge -av apache
Starter Apache:
# /etc/init.d/apache2 start
Let the system start automatically with Apache:
# rc-update add apache2 default
Configure Apache:
# vi /etc/apache2/conf/commonapache2.conf
2. Installation and configuration of MYSQL
Install MYSQL:
# emerge -av mysql
To configure MYSQL:
# ebuild /var/db/pkg/dev-db/mysql-4.0.25-r2/mysql-4.0.25-r2.ebuild config
(Note: This will automatically create the MySQL database and set the root user password)
Start MYSQL:
# /etc/init.d/mysql start
Let the system start automatically when the MYSQL:
# rc-update add mysql default
Try MYSQL:
$ mysql -u root --password
mysql> SHOW DATABASES;
3. Installation and configuration of PHP
Install PHP:
# emerge -av mod_php
(Note: This will automatically install dev-php/php at the same time)
Let PHP automatically load MYSQL extensions:
# vi /etc/php/apache2-php4/php.ini
Add the following settings to the file:
extension=mysql.so
Let Apache load the PHP4 module:
# vi /etc/conf.d/apache2
The apache2_opts setting for editing the file is:
APACHE2_OPTS="-D SSL -D PHP4"
After these steps, a basic LAMP system is installed and configured and can be used normally