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