Add the following method to Baidu. Actually.
First, let's take a look. Take a look ..
Show: it is strongly recommended that new users follow here to do http://wiki.ubuntu.org.cn/index.php? Title = Apache & variant = ZH-HANT #. e5. AE. 89. e8.a3.85lamp
First install Apache
sudo apt-get install apache2
Then run Apache
sudo /etc/init.d/apache2 restart
During installation, Apache creates a directory:/var/WWW, which is the root directory for storing documents on the server. You only need to enter http: // localhost/or the IP address of the machine in the address bar of the browser to access all documents placed in this directory.
If the installation is normal, the following information is displayed:
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
Install PHP
PHP is a popular server-side scripting language. It is generally used in combination with MySQL or Postgres to manage web content, blogs, and forums. The following describes the installation method. In fact, the installation is very simple. The command is as follows:
Sudo apt-Get install libapache2-mod-php5
Restart Apache to load the modules installed above:
Sudo/etc/init. d/apache2 restart
Install phpadmin
Open the system terminal and run the following command in the terminal:
Sudo apt-Get install phpMyAdmin
PhpMyAdmin settings:
During the installation process, You must select Web server: apache2 or Lighttpd, select apache2, press the tab key, and click OK. Then, you are required to enter the MySQL Database Password of the database's administrative user.
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.
PhpMyAdmin Test: Open http: // localhost/phpMyAdmin in the address bar of the browser.
Install MySQL
To install MySQL, run the following command at a terminal prompt:
Sudo apt-Get install mysql-server mysql-Client
Once the installation is complete, the MySQL server should be started automatically. You can run the following command at a terminal prompt to check whether the MySQL server is running:
Sudo netstat-tap | grep MySQL when you run this command, you can see a line similar to the following:
TCP 0 0 localhost. localdomain: MySQL *: * listen
-If the server cannot run properly, run the following command to start it:
Sudo/etc/init. d/MySQL restart
---
The above methods are from the following two pages. We recommend that you start watching
Http://server.zol.com.cn/127/1272883.html (there are command installation methods and the new mode of installation of the two tutorial)
Http://www.linuxidc.com/Linux/2009-11/22595.htm (install WP blog locally after building lamp, more detailed)