Press enter to see results or esc to cancel.

Setting Up Ubuntu 10.04 For Local Web Development With LAMP, PHPMyAdmin, and Local Domains

So back on Friday, I opted to upgrade to the new 10.04 from 9.10 of Ubuntu. And of course, it froze midway through and I had to reinstall my OS. Thankfully I had a live cd laying around, because I popped that in and backed up my /home folder to an external drive I had. Then I proceeded to install 10.04 from scratch. Everything was good after that.

Of course, that means it nuked my Ruby install as well as my local dev environment. I really should have scripts written to automatically do all this crap when I need to, but since it’s only every few months, I don’t care that much. I also don’t care enough to remember all of these commands, so I just have a bookmarked list of guides that I follow when I need to.

So without further adieu, here’s what I just did to install a LAMP server, PHPMyAdmin, and configure local domains, to make local development easy as pie.

Installing LAMP

So Ubuntu makes this really fucking easy to do. All you need to do is open up a terminal and type the command:

sudo tasksel

and then select LAMP and follow the prompts. You can read a more through guide here

Installing PHPMyAdmin

Some purists might complain about abstracting into a MySQL manager tool, but I don’t care. This thing makes it easy to play around with database tables and get things rocking initially. It’s a good idea to install locally to save some of your sanity. This is an easy install as well, so just follow this guide and you’ll be good (start with the Installed PHPMyAdmin section).

Setting Up Local Domains

So this is something a lot of people don’t do, which surprises me. Most people work off of subfolders of their localhost directory, so like http://localhost/project1. That isn’t a good representation of your final deployment environment, which will probably be at the root level. So a good idea is to setup local domains that allow you to use something like http://project1.local as your address. It’s a good idea to use something other than .com/.net/.org/.whatever (any real tld’s) so that you don’t unintentionally block yourself from the real domain down the road. I use .local for my projects.

What this does is tell your system to route whatever local domains you have to your own IP address. Makes life easy. Follow this guide to get them all setup.

One other note, I like to keep my dev sites in a www folder in my account directory (so /home/username/www). This keeps everything under one location and makes it easy to back things up when it all gets nuked from a botched install :)

Finishing Up

This was a quick little post, I know. I just wanted to get all of this stuff in one place, and I know one or two of you will find it useful. I’m going to go into some more details about my development tips and tricks soon, and I’m tossing around the idea of doing a screencast of me doing a slice and dice job on a Photoshop design and the process of making it a functional WordPress site.

Let me know if that sounds interesting to anyone. I’m going to go get some fresh air for a bit now because it’s amazing outside, but I’ll be back later to write another post that continues on with the Ultimate Niche Product Sites Guide tonight.

Easy,

D

Comments

8 Comments

abroms

This will be very useful to me in about a week. Bookmarked.

Thanks!

leeward

i do pretty much the exact same thing, local vhosts and all. taking nightly backups of /home is easy with rsync, so when anything goes awry, i just pull down the folder from my vps. since the cronjob itself is in the folder, even my backup script gets backed up. what ide do you use?

GSDUDE

I have looked far and wide for a way to do what you just did in 10 minutes.
I’ve been back and forth with Windows XP and 7 and Linux. I’ve wanted to setup a LAMP system but have always failed at the getting the AMP to play nice with the L.
I’ve alway given up in frustration. I I can’t believe it was so easy! Now I can start out learning PHP. Thank you so very much!

Karen

Thanks you really helped me out! I even got it working!

muhannad

thanks for the guide. got it setup very easily.

wiredniko

This was nice and easy, total installation time about 10 mins and that’s newbing it up!

Bob Miller

Thanks for the brilliant tutorial. I never thought I’d be able to set up Ubuntu, but it happened. I’m quite proud of myself, and grateful to you lol.
-Bob

Jake Green

Like Bob, this has helped me out a lot. I was utterly clueless before I came across this guide. I really appreciate it as well.


Leave a Comment