How to install and configure LAMP ( Linux, Apache, MySQL and PHP ) in Ubuntu 14.04
- Category : Linux Helpline (Easy Guide)
- Posted on : Jul 31, 2019
- Views : 2,689
- By : Naftali P.
1. Introduction
Short for Linux, Apache, MySQL and PHP, an open-source Web development platform, also called a Web stack, that uses Linux as the operating system, Apache as the Web server, MySQL as the RDBMS and PHP as the object-oriented scripting language. Perl or Python is often substituted for PHP.
2. Requirements
An ordinary server with Ubuntu 14.04 LTS installed. You can install it on any platform, but here the documentations are based on the Ubuntu / debian server.
3. Installation
Please proceed with the following steps:
3.1 Apache2 Installation
Type the below command for installing apache 2 package from repository.
# apt-get install apache2
Restart apache service
# /etc/init.d/apache2 restart
Apache will start working with minimal configuration. Now Open your server-ip in the browser and You can see the apache ubuntu test page.( Default document root is located in this path /var/www/html )
3.2 MySQL installation
Issue the below command to install mysql server with dependencies.
# apt-get install mysql-server
During installation it will prompt for a new password for mysql root . Give some strong password and retype the same password for confirmation.
After installation check the Database connection.
Check the service status.
# /etc/init.d/mysql status
Service is already up , Now Type this command to login
# mysql -u root -p Enter password: ****** Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 42 Server version: 5.5.35-1ubuntu1 (Ubuntu) Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. mysql>
Mysql server installation is over.
3.3 PHP installation
Type the below command to install php5.
# apt-get install php5 php5-mysql
Create a php file and paste the below code into the file to show the php configuration . Goto the default apache root path /var/www/html . create a new file info.php and paste the below code and save it.
# vi /var/www/html/info.php
Please use the following codes to create a phpinfo page.
<?php phpinfo() ?>
Now restart the apache2 service.
# /etc/init.d/apache2 restart
Now open the file in the browser ( Eg: http://yourip/info.php ) you can see the php information page as below.
Make sure you can see the mysql details in the php information page.
Categories
Subscribe Now
10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!Archive Calendar
Sat | Sun | Mon | Tue | Wed | Thu | Fri |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Recent Articles
-
Posted on : Jul 25
-
Posted on : Jul 07
-
Posted on : Apr 07
-
Posted on : Mar 19
Optimized my.cnf configuration for MySQL 8 (on cPanel/WHM servers)
Tags
- layer 7
- tweak
- kill
- process
- sql
- Knowledge
- vpn
- seo vpn
- wireguard
- webmail
- ddos mitigation
- attack
- ddos
- DMARC
- server load
- Development
- nginx
- php-fpm
- cheap vpn
- Hosting Security
- xampp
- Plesk
- cpulimit
- VPS Hosting
- smtp
- smtp relay
- exim
- Comparison
- cpu
- WHM
- mariadb
- encryption
- sysstat
- optimize
- Link Building
- apache
- centos
- Small Business
- VPS
- Error
- SSD Hosting
- Networking
- optimization
- DNS
- mysql
- ubuntu
- Linux