install apache2 php and mysql in ubuntu
In this tutorial we will try to show you how to install apache2,php and mysql on Ubuntu
Now we can get started installing. This will take a few minutes, so grab a beer (or your favorite beverage,) and off we go. To install Apache, type or paste this into your terminal:
sudo apt-get install apache2
Once apache2 is done installing, you can go ahead and test it by using:
sudo /etc/init.d/apache2 start
If you get a message that it’s already running, you’re good to go. Now, open up your browser and navigate to:
Again, to install PHP, type or paste this into your terminal:
sudo apt-get install php5 libapache2-mod-php5
Once it’s finished installing, restart apache, using:
sudo /etc/init.d/apache2 restart
Now, let’s make sure that PHP is working properly. To do this, we’re going to run phpinfo(). You can, of course, swap out gedit with your editor of choice.
sudo gedit /var/www/phpinfo.php
Type or paste the following into the document, and save it. (remove the space before the ‘?php’)
Now we can test PHP by browsing to:
You should see all of the info about your PHP installation listed on the page, like so. For security reasons, you should remove this page when you’re sure that PHP works.
Now we can conquer MySQL
sudo apt-get install mysql-serverAs MySQL is installing, it will ask you to configure your root password. Make sure that you type it correctly, as it will only ask you once.
Testing MySQLAfter that is finished, you can test MySQL by running this, where unixmen is your passwordmysql -uroot -punixmen
If it brings you to a MySQL prompt, you're done! You can type exit to get out of MySQL.
Now, if you want to install phpMyAdmin to have a front end for MySQL, you can use the following
sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadminIt will ask you to choose a webserver to configure automatically, you can use the space bar to select Apache2. And after that's finished, restart one last time.sudo /etc/init.d/apache2 restart
Finished!Now you have your own LAMP (Linux Apache MySQL PHP) server, with phpMyAdmin
Now, to pull up your phpMyAdmin panel, you can point your browser at...http://localhost/phpmyadmin
To log in and use PMA.
Useful Commands and Default Locations
To Save yourself some time, you can make launchers for Apache or MySQL start, stop, and restart if you feel the need.
Apachesudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart
MySQLsudo /etc/init.d/mysql start
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql restart
Locations/var/www/ -- Document Root
http://localhost/phpmyadmin -- phpMyAdmin
/usr/share -- phpMyAdmin local location
Related Articles By Tags :
Like us on Facebook
We need your assistance to stay live
This week Top Posts
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- Fedora 21 Scheduled For Release In October : For Fedora users, just keep calm and use Fedora 20 for now. Fedora Developers has announced that F...1 comment |
- How To Upgrade From Ubuntu 13.04 Raring To Ubuntu 13.10 Saucy Salamander : Ubuntu 13.10 Saucy will be released on October 17th. Hope it will come with lot of improvements and ...0 comments |
- Install LAMP Server (Apache, MySQL or MariaDB, PHP) On Ubuntu 13.10 : Updated January 12, 2014 LAMP is a combination of operating system and open-source software stack. ...0 comments |
- How to Install uTorrent Client on Ubuntu/Debian/Linux Mint : uTorrent is a lightweight and efficient BitTorrent client for Linux, Windows OS and Mac OS. The inst...0 comments |
- DNS Server Installation Step by Step Using CentOS 6.5/6.4/6.3 : DNS, Domain Name System, translates hostnames or URLs into IP addresses. For example if we type www....0 comments |
- Fedora 21 Scheduled For Release In October
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04
- 5 Android Apps that’s Going to Make Running Your Business Less Stressful
- Puppet agent Install Using Script
- Install Corosync and Pacemaker On CentOS 6.5
- Install Fail2Ban On Ubuntu Server 13.04/13.10
- How To Install Google Chrome in Fedora 20, 19, 18
- How to surf using Tor Browser Bundle
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .