Ubuntu12.04server install Apache2 + PHP5 + MySQL

Source: Internet
Author: User
LAMP is the abbreviation of Linuxweb server combination set, namely Apache + MySQL + PHP. This tutorial teaches you how to install the Apache2 server on Ubuntu12.04LTSserver, including PHP5 (mod_php) + MySQL. In this tutorial, you must modify the related IP addresses in your environment. 1. We use the root account for installation. First, switch to the root account and enter the command: sudosu2 to install MySQL.

LAMP is the abbreviation of a Linux web Server combination set, namely Apache + MySQL + PHP. This tutorial teaches you how to install the Apache2 server on the Ubuntu 12.04 LTS server, including PHP5 (mod_php) + MySQL.

In this tutorial, you must modify the related IP addresses in your environment.

1. We use the root account for installation. First switch to the root account and enter the following command:

Sudo su
2 install MySQL 5
Enter the following command:

Apt-get install mysql-server mysql-client
You need to set the root account password during installation. The system will prompt you as follows:

New password for the MySQL "root" user: Repeat password for the MySQL "root" user:

3. Install Apache2
Enter the following command:

Apt-get install apache2
Enter your server address in the browser and enter http: // 192.168.0.100 to check whether Apache2 works. If It works !), It indicates that you have already worked.

In Ubuntu, the default file root directory of Apache is/var/www, And the configuration file/etc/apache2/apache2.conf is used, additional storage subdirectories/etc/apache2 such as/etc/apache2/mod-enabled (Apache module),/etc/apache2/sites-enabled (virtual hosts ), and/etc/apache2/conf. d.

4. Install PHP5
Install the PHP5 and Apache PHP5 modules:

Apt-get install php5 libapache2-mod-php5
Restart apache:

/Etc/init. d/apache2 restart
5. Test PHP5/create a probe page

Vi/var/www/info. php
Enter the following content:

Phpinfo ();
?>

Then open the browser to access (http: // 192.168.0.100/info. php ):

You can see some supported modules.

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.