Getting good with Linux (pt 1)

I asked a question on Reddit “What non-PHP stuff should a PHP developer know? “, and the top response by far was:

Learning your way around the Linux command line via SSH is very, very handy.

So, since I’ve got a desktop machine that’s unused, I decided that’s exactly what I’m going to.  And I’m going to document my process on the way.

First step was to download Linux. I’ve worked with Ubuntu in the past, and along with CentOS, it seems to be pretty high on people’s Linux list.  As of today, the latest version is 11.10.  One thing I noticed was the direct download was pretty slow, and was estimating 8 hours to finish.  But using the bittorent file, I was able to get it in about 15 minutes.

Next, since I don’t have any blank CDs, I got the USB Installer, went through the very easy instructions, and put the iso on my thumbdrive.  That took just a couple of minutes.

Installing on the computer was pretty straight-forward. I had the USB key in, started the computer, and chose the “Install to Hard Drive” option when it came up.  Since I’m not going to need anything off the drive, I chose to just erase everything and install it over.   The set up is very easy, and the whole install took about 15-20 minutes.  Then when it restarted, there were some updates that took about 10 minutes to download and install.

That was it.  Now I had a nice version of Ubuntu running on my machine.  And wow… it looks pretty nice.

Next up was getting PuTTY for my Windows laptop, so I could connect to the Linux box over SSH. It’s really just a small .exe file that doesn’t actually install anything. When you run it, it asks for the ip address of machine to connect to… and in Ubuntu, I opened the Terminal app, and ran ifconfig … this gave me the ip address of that machine on the network ( mine was  I put that into PuTTY and…. “Network Connection Error”.

From what I read, it seemed SSH was installed by default on Linux, but it wasn’t.  To test, in the Terminal, I typed simply ssh and it told me it wasn’t installed. It even told me the command I needed to install it: sudo apt-get install openssh-server

Wow. No need to google for the commands anymore.

So I ran the command, and it said the server was started.  Back in PuTTY, I tried to reconnect… and while it has some security pop-up, I just clicked “Yes” and I was connected.  I entered in the username and password that I chose when I installed Ubuntu, and I got the prompt.

Next up is installing the A,M, and P parts of the LAMP stack…. Apache, MySQL, and PHP.