Ubuntu under Install Apache2, php5 MySQL

Source: Internet
Author: User
Tags apache php install php phpmyadmin

Good blog: http://blog.csdn.net/guaikai/article/details/6905781

1: First install Apache: Open Terminal (ctrl+alt+t),

Input command: sudo apt-get install apache2 can be installed,

After the installation, open the browser, enter in the address bar: localhost or http://127.0.0.1

See it works to show that the installation was successful!

Default root directory:/var/www/

2: Install MySQL:

sudo apt-get install mysql-server-5.0

After the installation, you will need to set up a new MySQL root password, enter your own password after enter key, and then confirm the password.

3: Install PHP 5 and Apache PHP 5 module:

sudo apt-get install php5 libapache2-mod-php5

Sudo/etc/init.d/apache2 Restart (restart Apache)

Try success No:

Command: Gksudo gedit/var/www/text.php "Create a text.php file under the Apache default root directory/var/www/"

Verify that the installation was successful by entering the following code in the text.php file:

<?php

echo "HelloWorld";

?>

Enter in the browser address bar: http://localhost/text.php If the page displays HelloWorld it is successful

Tip: If you cannot enter the command again when you return to the terminal, press CTRL + Z key combination

4: Let Apache and PHP support PHP:

sudo apt-get install Libapache2-mod-auth-mysql

sudo apt-get install Php5-mysql

Sudo/etc/init.d/apache2 Restart (restart Apache)

The environment has been built!

/var/www/(apache2 Web file is here)

/var/lib/mysql (MySQL file put here)

If you want to connect remotely, also install SSH, command: sudo apt-get install SSH

Maybe we're still used to phpmyadmin.

5: Install phpMyAdmin

sudo apt-get install phpMyAdmin

At this point on the browser input: Http://localhost/phpmyadmin found not found

So we have to move the installation to the phpMyAdmin folder to/var/www/below.

sudo ln-s/usr/share/phpmyadmin//var/www/

Execute the above to command, we have moved the phpMyAdmin folder to the destination, or you can copy the phpMyAdmin directly under the/var/www/folder.

We again entered on the browser: http://localhost/phpmyadmin return When we found the familiar interface back

Ubuntu under Install Apache2, php5 MySQL

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.