Build a lamp environment in Ubuntu 12.04 (for contianer-based PAAs)

Source: Internet
Author: User
Tags mcrypt

Objective: To start a Ubuntu iner instance with Ubuntu 12.04-amd64 through lxc, and then build the lamp (Linux + Apache + MySQL + PHP) environment in this instance

Procedure:

(1) install MYSQL:

Sudo apt-Get install mysql-server mysql-Client

(2) install apache2

Sudo apt-Get install apache2

Test whether Apache works properly. Enter http: // ip/in the browser/

(3) install PHP

Sudo apt-Get install PhP5 libapache2-mod-php5

Restart Apache to load the PHP module sudo/etc/init. d/apache2 restart.

(4) install phpMyAdmin

Sudo apt-Get install phpMyAdmin

Then, establish a connection between phpMyAdmin and apache2. Take my example: the WWW directory is in the/var/WWW directory, and the phpMyAdmin directory is in the/usr/share/phpMyAdmin directory. Therefore, run the following command: connect sudo ln-S/usr/share/PHPmyAdmin/var/www.

Enter http: // ip/PHPmyAdmin/in the browser to test whether phpMyAdmin works properly!

If you can see the phpMyAdmin logon interface, enter the username and password of the MySQL database to verify that the user can log on normally. The result is as follows.

(5) If you want to remotely access the MySQL database through other MySQL clients, see Ubuntu
MySQL remote connection Solution

(6) phpMyAdmin requires PHP-mcrypt extension. In most cases, you do not need to install phpMyAdmin independently. If a warning is displayed at the bottom of the page after you log on to phpMyAdmin, follow these steps: run it on the terminal:Code: Sudo apt-Get install php5-mcrypt prompts If Not Installed

It is automatically installed. If you are prompted that the installation has been completed, proceed to the next step: edit the PHP configuration file and run: Code: sudo gedit/etc/PhP5/apache2/PHP on the terminal. in the displayed interface, INI finds the extension help document and syntax, and adds the following code to it:

extension = php5-mcrypt.so

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.