Installation and configuration of lamp under Gentoo

Source: Internet
Author: User
Tags install php php script mysql database

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

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.