Ubuntu 12.04 Installation Apache2+php5+mysql

Source: Internet
Author: User
Tags phpmyadmin



Lamp is the abbreviation for the Linux Web server combo set, which is apache+mysql+php. This tutorial teaches you how to install Apache2 server on Ubuntu 12.04 LTS server, including PHP5 (mod_php) +mysql.



The relevant IP settings used in this tutorial are modified in your environment.



1 We use the root account to install, first switch to the root account, enter the command:



sudo su



2 Installing MySQL 5
Enter the command:



apt-get install mysql-server mysql-client



To set the root account password during installation, the system will be prompted as follows:



New password for the MySQL "root" user:repeat password for the MySQL "root" User:



3 Installing Apache2
Enter the command:



apt-get install apache2



In the browser enter your server address listed http://192.168.0.100 to see if Apache2 is working, if It is displayed (It works!), the description is already working.



Apache in Ubuntu default document root directory is/var/www, Profile/etc/apache2/apache2.conf, additional Configuration Storage subdirectory/etc/apache2 such as/etc/apache2/mods-enabled ( For the Apache module),/etc/apache2/sites-enabled (virtual host for virtualization hosts), and/ETC/APACHE2/CONF.D.



4 Installing PHP5
Install the PHP5 and Apache PHP5 modules:



apt-get install php5 libapache2-mod-php5



Then restart Apache:



/etc/init.d/apache2 restart



5 test PHP5/Can create a probe page



vi /var/www/info.php



Enter the following content:



<?php
Phpinfo ();
?>



Then open browser access (http://192.168.0.100/info.php):



You can see some of the modules that have been supported.



6 getting MySQL support for PHP5
We need to install Php5-mysql, first look at the PHP5 module



apt-cache search php5



Then install the required modules, such as the following command:



apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl



Restart Apache2:



/etc/init.d/apache2 restart



Then brush the times you http://192.168.0.100/info.php see if the module support has been added.



7 PhpMyAdmin
Install phpMyAdmin to manage MySQL:



apt-get install phpmyadmin



phpMyAdmin Access Address: http://192.168.0.100/phpmyadmin/



Reference article: Http://www.howtoforge.com/installing-apache2-with-php5-and-mysql-support-on-ubuntu-12.04-lts-lamp


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.