Installing a LAMP Stack on Ubuntu

I am using Ubuntu (Hardy Heron) as my primary desktop OS, and I wanted to install some tools for doing development work. At the same time, I thought I might run through the steps and post them for anyone else that might be looking to do the same thing. I’ll walk you through what I am doing, it’s your typical Linux Apache MySQL PHP (LAMP) stack.

First off, you can use sudo to run these install commands as your own local user, by putting sudo before each command, but I find it easier and more concise to simply use sudo to become root and install that way. I will write this article from that perspective, so if you don’t want to do this as root, simply put sudo before each command here.

You can become root by using this command from a terminal session:

sudo su -

Now that we are root, let us install MySQL which will be our database server:

apt-get install mysql-server

Next, let’s install Apache for our web server:

apt-get install apache2

In my case, I am developing in PHP, so we need to install PHP for Apache:

apt-get install php5 libapache2-mod-php5

Last but not least, if you want a nice database manager, get phpMyAdmin:

apt-get install phpmyadmin

If this is not a box that you have KVM (Keyboard, Video, Mouse) access to, and you will be connecting remotely, you will need to install the OpenSSH server so you can ssh into the server. Do this like so:

apt-get install openssh-server

Once installed, you should be able to log into the server with your user account. Please note that by default, you cannot log in as root via ssh. There you have it, now start writing some cool code!

Generate Random Unique Number

I have found many times when writing stuff in PHP that I have come across a need to generate a random number. That’s not too bad in and of itself, but what about when you need a unique ID key or something like that. For example, say you are writing the next best helpdesk application and need unique case numbers and don’t want to simply use a counter. For whatever reason, I put this little function together and it has served me well. Check it out …

Continue reading

Great stuff at PortableApps

In this post, I’d like to do two things.  First off, I want to plug a really cool site called PortableApps.com that has some really cool software in the form of … well, portable apps.  What these are, are common widely used applications that have been transformed in such a way that they can run right off of your thumb drive, no install necessary, hence the term portable.  They have lots of cool stuff that you can download, absolutely free, and use right off your thumb drive, or hard drive, or anywhere really.  It’s nice being able to have firefox and open office (and much more) with you, no matter where you go, even with all of your own settings and customizations.  That’s hard to beat!  Go check it out, you won’t be disappointed I am sure. Continue reading