Build a LAMP environment with apt-get (1)

Source: Internet
Author: User
Tags mcrypt

 

Figure-LAMP

UseApt-getBuildLAMPEnvironment Basics

If you are installing it on the local machine for testing, it is best to ensure that the hosts content is as follows:

Username @ ubuntu :~ $ Cat/etc/hosts

127.0.0.1 localhost

[Edit] install

[Edit] install LAMP

1. Careful manual installation (minimum components)

Sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server

Some of them are automatically installed because of dependencies, but they are more suitable for insurance purposes. At the beginning of installation, sudo will ask you for the password (only possible), which is the password of the system administrator. During installation, MySQL requires a password for the account, which is irrelevant to the operating system.

2. Lazy Installation Method

Select edit in the new software package manager -- mark the software package with the Task Group

In the displayed window, select lamp server and click OK.

Click the green check mark application button in the main window.

Okay. The next step is to wait... until the new version is automatically downloaded and installed. During installation, MySQL requires a password for the account, which is irrelevant to the operating system.

Sudo apt-get install apache2 mysql-server php5 php5-mysql # terminal command

Open http: // localhost

Apache default page

[Edit] install phpmyadmin

In fact, this is also a security risk. We recommend that you use openssh to manage servers.

Solution 1: run commands on the terminal (not recommended)

Sudo apt-get install phpmyadmin

Solution 2:

We strongly recommend that you do not install it from the source

Download the software package from the phpmyadmin website and decompress it to the local directory/var/www/phpmyadmin.

Tips: If you need to decompress it directly to/var/www/phpmyadmin. If phpmyadmin does not exist, create it by yourself.

Run

Sudo cp/var/www/phpmyadmin/config. sample. inc. php/var/www/phpmyadmin/config. inc. php

Sudo gedit/var/www/phpmyadmin/config. inc. php

Find blowfish_secret and fill in any letter

$ Cfg ['servers'] [$ I] ['auth _ type'] = 'cooker ';

$ Cfg ['servers'] [$ I] ['host'] = 'localhost ';

$ Cfg ['servers'] [$ I] ['connect _ type'] = 'tcp ';

$ Cfg ['servers'] [$ I] ['compus'] = 'false ';

$ Cfg ['servers'] [$ I] ['extension'] = 'mysql ';

Save and exit

Install php5-mcrypt

Sudo apt-get install php5-mcrypt


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.