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.
So Ubuntu makes this really fucking easy to do. All you need to do is open up a terminal and type the command:[cc]sudo tasksel[/cc]
and then select LAMP and follow the prompts. You can read a more through guide here
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 🙂
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.