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