InstallLAMPServer (Apache, MySQLorMariaDB, PHP) OnUbunt_MySQL

Source: Internet
Author: User
InstallLAMPServer (Apache, MySQLorMariaDB, PHP) OnUbuntu14.0413.10 MariaDBApacheLAMP

LAMPIs a combination of operating system and open-source software stack. The acronym LAMP is derived from first letters of Linux, Apache HTTP Server, MySQL or MariaDB database, and PHP/Perl/Python.

In this tutorial, let us install LAMP server onUbuntu 14.04 ServerEdition. My testbox hostname and IP address areServer. unixmen. localAnd192.168.1.2/24Respectively.

Install Apache

ApacheIs an open-source multi-platform web server. It provides a full range of web server features including CGI, SSL and virtual domains.

To install Apache, enter the following command from your terminal:

sudo apt-get install apache2
Test Apache:

Open your web browser and navigateHttp: // localhost/OrHttp: // server-ip-address/.

Install MySQL

MySQLIs a relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases, though SQLite probably has more total embedded deployments

sudo apt-get install mysql-server mysql-client

During installation, you'll be asked to setup the MySQL root user password. Enter the password and click OK.

Re-enter the password.

Now, MySQL server has been installed.

You can verify the MySQL server status using command:

sudo service mysql status

Sample output:

mysql start/running, process 3470

Note:If you want to use MariaDB instead of MySQL, then follow these steps.

Install MariaDB

MariaDBIs a drop in replacement for MySQL. It is a robust, scalable and reliable SQL server that comes rich set of enhancements.

First you have to remove existing MySQL packages if any. To completely uninstall MySQL along with its configuration files, enter the following command:

sudo apt-get purge mysql*

Run the following command to remove unwanted packages.

sudo apt-get autoremove

Now, addMariaDB repository. Run the following commands to add PPA. Hence, MariaDB 5.5 repository is not yet updated to 14.04, we can use the repository of Ubuntu 13.10 instead.

sudo apt-get install software-properties-commonsudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943dbsudo add-apt-repository 'deb http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/5.5/ubuntu saucy main'

Update the software sources list and install MariaDB using following commands:

sudo apt-get update sudo apt-get install mariadb-server mariadb-client

During installation you will be asked to set mysql'Root'User password.

Re-enter password:

Check if mariadb is running or not, using the following command:

sudo service mysql status

Sample output:

 * /usr/bin/mysqladminVer 9.0 Distrib 5.5.37-MariaDB, for debian-linux-gnu on i686Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.Server version5.5.37-MariaDB-1~saucy-logProtocol version10ConnectionLocalhost via UNIX socketUNIX socket/var/run/mysqld/mysqld.sockUptime:2 min 18 secThreads: 1Questions: 566Slow queries: 0Opens: 337Flush tables: 4Open tables: 24Queries per second avg: 4.101
Install PHP

PHP(Recursive acronym for PHP: Hypertext Preprocessor) is a widely used open-source general purpose scripting language that is especially suited for web development and can be embedded into HTML.

Install PHP with following command:

sudo apt-get install php5 php5-mysql libapache2-mod-php5

Test PHP

Create a sample"Testphp. php"File in Apache document root folder.

sudo nano /var/www/html/testphp.php

Add the following lines.

 

Restart apache2 service:

sudo service apache2 restart

NavigateHttp: // server-ip-address/testphp. php. It will display all the details about php such as version, build date and commands etc.

If you want to install all php modules, enter the commandSudo apt-get install php *And restart the apache2 service. To verify the modules, open web browser and navigateHttp: // server-ip-address/testphp. php. You will able to see all installed php modules.

Manage MySQL Databases (Optional) Install phpMyAdmin

PhpMyAdminIs a free open-source web interface tool used to manage your MySQL databases. It is available in the Official Debian repositories. So install it with command:

sudo apt-get install phpmyadmin

Select the Web server you use, in my case it is apache2.

Select Yes to configure database for phpmyadmin wjth dbconfig-common.

Enter password of the database's administrative user.

Enter MySQL application password phpmyadmin.

Re-enter the password.

Success, phpMyAdmin installation has been completed now.

Access phpMyAdmin Web Console

Now you can access the phpmyadmin console by navigatingHttp: // server-ip-address/phpmyadmin/From your browser.

Enter your MySQL username and password which you have given in previous steps. In my case its "root" and "ubuntu ".

You will be redirected to PhpMyAdmin main web interface.

Now you can manage your MySQL databases from phpMyAdmin web interface.

That's it. Your LAMP server is up and running now.

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.