Howto Moving Your Existing Nix Install To A New Pc Or Drive Using...
Edited on 1/12/13
- How to change the Ubuntu GUIEdited on 9/29/12
- How to install UbuntuEdited on 9/23/12
- How To Install Archlinux The Easy Quick And Dirt Way
- topicLinux Desktop
Alphabetical Article List
Install and Configure a basic LAMP server in Ubuntu 11.10
This guide will take you step by step, on how to install and configure a basic LAMP server on your Ubuntu desktop.
You might be wondering, why you would want to set this up in a desktop environment. I often do this as a web developer, to have a private, instant server that I have full control over, as I typically can test out a lot of things, to know what I need, and simply what works and what doesn't, without having to worry about restrictions that could be placed upon me by a shared host, and it spares me the cost of renting a Virtual Dedicated or Dedicated server. You could also use this guide as a stepping stone to figure out the ins and out of a LAMP server with zero risk.
Step One: Update Ubuntu first
Open up a terminal (keep it open for most of this tutorial):In Terminal Command:sudo apt-get update && sudo apt-get upgrade
This will sync the package managers database with that of the repositories, to ensure you are getting the latest packages and information available. Now you do not have to do this step, if for whatever reason you do not want to upgrade all available packages, as it will not interfere with the guide if you do not.
Step Two: Install ApacheQuote:sudo apt-get install apache2
This will install the basic Apache server, with default libraries and modules for Apache. After it has finished downloading and installing, Open your browser of choice and type in "http://localhost". You should see this:
If you do not see this, the service might not be running.In Terminal Command:sudo service apache2 startorsudo /etc/init.d/apache2 start
Either command will work, I personally think the first one is easier to remember, but the second one is more traditional, and eventually Ubuntu might stop supporting the use of the second command in favor of the first one (If they completely gear towards upstart scripts) so it might be useful to just get into the habit now.
If you get the "it works" message, please continue, if not make a post or look for a solution.
Step Three: Install MySQLIn Terminal Command:sudo apt-get install mysql-server
After it has done downloading, it will begin the install, in the terminal window this screen will appear:
After you enter a password and hit enter, it will ask you to confirm it (I do recommend setting a root password, and remember it please, as it is something you will need to access it). After the confirmation screen it will finish configure and install MySQL.
Step Four: Install PHP, and apache's modules for PHP and the MySQL module for PHPIn Terminal Command:sudo apt-get install php5 libapache2-mod-php5 php5-mysql
This will install PHP, the apache2 module for php and the module for php to be able to access MySQL. Once that is done, you will need to restart the Apache server for the changes to take place.In Terminal Command:sudo serive apache2 restartorsudo /etc/init.d/apache2 restart
Now we will test to see if PHP is being used by Apache.In Terminal Command:sudo nano /var/www/phpinfo.php
Once that is open, add the following to it:Inside Nano:<?php//display php info to test if PHP is working with apache2.phpinfo;?>
ctrl+o to save, ctrl+x to exit out of nano. Now in your browser of choice, go to: http://localhost/phpinfo.php, you should see this screen if Apache is working with PHP.
If you get that to appear, you have successfully installed a LAMP server in your Ubuntu. I would suggest changing the Apache document root from /var/www to another folder, like /home/user/public_html, as you don't want to change permissions on anything inside /var/www. I would also recommend using a web interface for helping managing MySQL, there are a few in the repository, I recommend phpmyadmin:In Terminal Command:sudo apt-get install phpmyadmin
Once it is installed, you can access this from "http://localhost/phpmyadmin" even if you move the document root, an alias is setup for it in apache. There is far more to learn about LAMP than this guide covers, as it is to serve merely as a introduction to LAMP and how to install it. If you have more information to contribute to this, I urge you to write a guide as a follow up on LAMP.
- How to change the Ubuntu GUI
- › [Build Log] An old man's first blinged out water build. 10 seconds ago
- › Suggest a Z77 motherboard for a decent 4.5 OC (asus preferably or... 11 seconds ago
- › Nvidia GeForce GTX TITAN Owners' club 27 seconds ago
- › Is there such a thing as CPU drivers? 49 seconds ago
- › Mechanical Keyboard Club! (Now with fancy title!) 1 minute ago
- › [Gamesradar] GTA V - 14 Things You Absolutely Need to Know About... 1 minute ago
- › [Official] NVIDIA GTX 780 Owner's Club 1 minute ago
- › Corsair Force 3 240gb AS SSD Benchmark 1 minute ago
- › [Amazon] Polk Audio PSW505B 12" Powered Subwoofer (single) $180 2 minutes ago
- › GTX 600 Series Unlocked Voltage Bios' downloads and tools. 2 minutes ago
- › Xigmatek Cooling System Crystal Series CLF-F1251 Blue LED Case Fan by SkipP
- › Scythe KAZE JYU SLIM SY1012SL12M Case Fan by SkipP
- › Enermax TB Silence UCTB12 120mm Case Fan by SkipP
- › Zowie Gear Evo EC2 by trick4krg
- › Noctua NF-F12 PWM by krsboss
- › ENERMAX Maxrevo EMR1500EWT 1500W Power Supply by RavageTheEarth
- › Ione Scorpius M10 USB Mechanical Keyswitch Keyboard by unexpectedly
- › HP L2105tm Black 21.5" Swivel & Tilt Adjustable Full HD... by unexpectedly
- › Razer BlackWidow Ultimate Stealth Edition by unexpectedly
- › Cooler Master Hyper N520 CPU Cooler 92mm 1800rpm 1 X Sleeve Bearing... by unexpectedly
- › METRO 2033 STARTUP CRASH FIX WORKS by xiangelo
- › Why are DNS Servers Important? How to make... by exzacklyright
- › Titanium Backup Guide For Newbies by exzacklyright
- › How to install ADB (Android Debug Bridge) by exzacklyright
- › How to take ownership of a file, folder, or... by exzacklyright
- › How to disable the open file security warning... by exzacklyright
- › Clean and Make a USB Bootable Flash Drive for... by exzacklyright
- › Efficiency Trials by dava4444
- › How on EARTH Do I Build a Computer??... by dava4444
- › How to rip a Windows 7/8 Image using WinPE4.0... by RagingCain