1. Installing Apache
sudo apt-get install apache2
If the display does not find the software then execute sudo apt-get update (it is recommended to use the system version that Ubuntu is supporting, not the supported version may be invalid to update the software source)
Wait for the update and then sudo apt-get install apache2
Install and then enter sudo/etc/init.d/apache2 restart (or sudo service apache2 restart this command to start [or restart the]apache server)
After opening the browser input http://localhost or http://127.0.0.1 see the following instructions Apache installation complete
2 Installing PHP
sudo apt-get install php5 libapache2-mod-php5
Wait for the installation to complete after execution
sudo gedit/var/www/html/test.php
A new test.php file is created
In the text that opens, enter the following
If you can PHP, you must know what this is, simply say that the output of PHP-related information
Restart the server (command above)
After rebooting, enter http://localhost/test.php in the browser
At this point you will see the following instructions to install PHP successfully
3. Install MySQL
sudo apt-get install mysql-server mysql-client
The installation process will let you enter the password, remember this is the password you want to set up your database login, not the Ubuntu system root password
Wait for installation to continue after installing PHPMYADMIN-MYSQL database management
sudo apt-get install phpMyAdmin
During installation, you will be asked to select the Web server:apache2 or LIGHTTPD, use the SPACEBAR to choose Apache2, press the TAB key, and then OK.
You will then be asked to enter the MySQL database password for the setup password password of the database ' s administrative user.
Then connect the phpMyAdmin with the Apache2
sudo ln-s/usr/share/phpmyadmin/var/www/html
Open Http://localhost/phpmyadmin in the browser address bar
The basic components of the above ALMP are installed.
Set Ubuntu file to execute read and write permissions
After the lamp is assembled and installed, the default settings for the PHP Web server root directory are:/var/www/html. Because of the security principle of Linux system, we can't create, modify and delete the files under the HTML folder at this time, so we should modify the read and write permission of the/var/www/html directory. In the interface manager through the right-click property cannot modify the file permissions, you have to execute the root terminal command:
sudo chmod 777/var/www
777 is the highest privilege in Linux, which means readable, writable, and executable.
The above is a reference to someone else's blog in the Order of execution, in this note refer to the blog link: http://www.cnblogs.com/lynch_world/archive/2012/01/06/2314717.html
Ubuntu Configuration Lamp