Lamp environment Setup (Ubuntu)

Source: Internet
Author: User
Tags phpmyadmin fully qualified domain name

System: Ubuntu14.04

Method One, the simplest online installation

(reference URL: http://os.51cto.com/art/201307/405333.htm)

Specific process:

"1" Open terminal, execute command

sudo Install lamp-server^

Note : Do not discard the ^ number at the end, otherwise the command will not execute.

Then follow the prompts to select consent (y), set the MySQL password ... Until the installation process ends automatically, you can download and install all dependent packages.

"2" Test with further configuration

(2-1) test the Apache server, open the browser, enter the address http://localhost/. You will see a webpage showing "It works!"

(2-2): test php,

vi /var/www/html/  test.php
Input: <?php phpinfo ();?>
: Wq Save Exit
# service Apache2 restar Restart  server

Open the browser, enter the URL: localhost/test.php, see the following page showing information about PHP

(2-3) Configure MySQL:

Developing PHP is typically a local Web development environment that requires MySQL to be bound to the host IP. By default it is 127.0.0.1. Just in case, you can use these commands to confirm the address.

Cat grep localhost 127.0. 0.1     localhost::1     ip6-localhost ip6-loopback
Cat grep bind-address      confirms that you have the correct bind addresses in the MySQL my.cnf filebind-address        127.0.  0.1

Note: If the binding address does not match the address set by the local host, you need to edit the/etc/mysql/my.cnf as the root user to correct it.

"3" Installation phpMyAdmin:

Install libapache2-mod-auth-mysql phpmyadmin

As prompted, enter Y to agree to install the software

(1) Select the phpMyAdmin configured Web server, use the arrow keys on the keyboard, highlight the apache2, and then use the space between them to select it. Then press ENTER to proceed:

(2) Select Configure a database named Dbconfig-common for phpMyAdmin, click Yes, confirm and continue

(3) Enter the MySQL root password that you set earlier so that you can create a new database. So, enter your MySQL password and press ENTER.

(4) The next tip is to create a MySQL application password for phpmyadmin.

If you want to create a random password, you can press ENTER. I set up here using the same password as MySQL. In terms of security, this may not be the best approach, but because it is used in a closed development environment, the risk may be small

Finally, the system prompts to confirm the password, so phpmyadmin installation configuration is complete.

(5) Test phpMyAdmin:

Browser input Address: Localhost/phpmyadmin, you can see the following phpMyAdmin login interface

Log in as root and the password you set earlier to enter the following interface:

At this point the lamp environment and phpMyAdmin installation configuration work completed.

Note :

1, test php that step, if you encounter an error message from Apache (below), this information is related to the server's fully qualified domain name.

Apache2:could not reliably determine the server'127.0. 1.1  for

You can use this command to fix it.

Echo " ServerName localhost " sudo Tee /etc/apache2/conf.d/fqdn

sudo service apache2 reload re-loaded into Apache web server

This will not see this error message, this is the original version of the introduction, I did not encounter this error during the installation, and therefore prompted.

2, according to the original text: engaged in a Web site development, you can put the file into the/var/www, but it is user and user group root, so you need to copy the file in the root of the user, or change the title and/or permissions of the directory, so that you can write files there. In addition, you can make some additional Apache configurations so that you can keep the files somewhere in the home directory.

Compile and install the need to rely on the problem is more trouble, tried several times encountered some problems, not organized, later to fill up ...

Lamp environment Setup (Ubuntu)

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.