Linux Lamp Environment Construction

Source: Internet
Author: User
Tags phpmyadmin

The LAMP (linux-apache-mysql-php) website architecture is currently a popular international web framework that includes: Linux operating system, Apache Web server, MySQL database, Perl, PHP or Python programming language, All components are open source software and are

Internationally mature architecture framework, many popular commercial applications are to adopt this architecture, compared with JAVA/J2EE architecture, lamp has the characteristics of rich web resources, lightweight, rapid development, etc., Microsoft's. NET architecture, lamp has the advantage of universal, cross-platform, high-performance, low-price

As a result, lamp whether performance, quality or price are the preferred platform for enterprises to build websites.

Make sure the package list is up to date

Apt-get Update (Ubuntu)

Yum Update (Centos)

Installing lamp

Apt-get Install apache2 mysql-server mysql-client php5 php5-gd php5-mysql (Ubuntu)

Yum install apache2 mysql-server mysql-client php5 php5-gd php5-mysql (Centos)

You need to set the MySQL root user password during installation, such as "123456" (Note that the password is not logged into the system):

Apache Test

Enter the server IP address in the browser address bar and the following message appears indicating that Apache installation was successful:

Since most of the lamp operation is related to the/var/www directory, for convenience, the permission to modify the directory is accessible to ordinary users:

chmod 777/var/www/

Installing phpMyAdmin

PhpMyAdmin is a PHP-based, web-enabled MySQL database management tool that allows administrators to manage MySQL databases in a Web interface:

sudo apt-get install phpMyAdmin

During installation, you will be asked to select the Web server:apache2 or lighttpd and select Apache2:

You will then be asked to enter the MySQL database connection password for setup Password of the database ' s administrative user:

Connect the phpMyAdmin to the Apache2

The WWW directory is in/var/www,phpmyadmin in the/usr/share/phpmyadmin directory, so just use the command:

Ln-s/usr/share/phpmyadmin/var/www to establish a soft connection.

phpMyAdmin Test

In the browser address bar, open http://115.28.77.46/phpmyadmin, enter your user name and password:

Post-Login Interface:

PHP test

Create a new file test.php in the/var/www directory, with only one sentence in the file:

<? PHP phpinfo (); ?>

Save the file.

Enter http://115.28.77.46/test.php in the browser to see the system Information for PHP:

Attention:

All of the above-tested server IPs refer to the IP of the Linux system, and the above tests can be tested on the same LAN.

Linux Lamp Environment Construction

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.