views:

192

answers:

8

I have been a Windows/M$ boy now for over 15 years and specialisted in web design for 10 years of that using Classic ASP and ASP.net. Trouble is all the latest funky languages that I want to play with (Django using Python, Rails, NitroJS) are *nix based and often run off Macs and all use Apache not a sniff of a IIS port/version.

I've played with Ruby on Rails alot as it runs happily on my XP Pro dev setup but when it comes to getting it up and running on a real live server using *nix I really really struggle. I want to fill the void and hopefully straddle both camps but not sure where to start.

How can I close the gap in my knowledge for getting web apps running on *nix systems? What do I need to know and where can I find out about it (books, links, etc.)?

SSH, Tunnelling, chmod'ing...all greek to me :)

Edit: Thanks for all the great answers on this one, clearly struck a nerve. Excellent advice all around. I'm getting Ubuntu installed this weekend to have a play around, about time really :)

+2  A: 

It sounds like you need to get a handle on the *nix basics first. Everything else builds on that. For example, trying to configure your run-of-the-mill Apache with PHP/Python/Whatever setup will be pretty tough without that knowledge - if you can ssh into your server in the first place :)

With that in mind: http://www.amazon.com/Unix-Programming-Environment-Prentice-Hall-Software/dp/013937681X/ref=sr_1_1?ie=UTF8&s=books&qid=1262712609&sr=8-1. Oldie but goldie, and should be easily accessible to any programmer coming from other environments. Perhaps someone can recommend an updated version of this?

Thilo
Ordered the book, thanks for the tip :)
Pete Duncanson
+1  A: 

Here's how I did it:

  1. Got a Mac, started using it as my primary off-hours workstation for experimental side projects: iPhone apps, Automator scripts, Cocoa stuff, Ruby.
  2. Installed Mono on MacOS, started writing the ASP.net stuff I was already comfortable with in the Unix environment.
  3. Little by little, I began to use Windows less. I made sure all of my .net projects were Mono-compliant, so I could shuttle code back and forth between the platforms.
  4. Profit?

It's not so much about how you learn Unix as it is how do you, a regular person with a full-time job and a life, slowly wade into Unix without going insane.

Chris McCall
Chris when I've dipped my toe in to it in the past that last lines sums up how I felt perfectly... :)
Pete Duncanson
You get a grip on the very basics and then do a non-trivial project from beginning to end on the platform.
Noufal Ibrahim
+1  A: 

I would recommend that you install a UNIX on a machine or a VM and start getting your hands dirty. Ubuntu is a popular Gnu/Linux distro which is fairly easy to install and quite straightforward.

There are too many books that come to mind but what really moved me from my old DOS days to UNIX (Solaris first) was Kernighan and Pike's "Unix Programming Environment". It's a little dated now but it does give you some nice insights into how people do things in the UNIX world.

Once you're okay with doing things on the command line (should take a few weeks I imagine), you can try to deploy a Rails project on your machine, search for links and just imbibe whatever you need to get the job done. I think that's more effective than sitting down with a single book and trying to read it beginning to end to understand UNIX.

Good luck.

Noufal Ibrahim
A: 

Since the early challenge will probably be using a command line interface, I would suggest starting with bash scripting; it's an easy language to pick up and similar to (but much more powerful than) DOS batch scripts. Bash will get you started on the command line since it will make heavy use of both common and uncommon commands. This is an excellent guide for bash: http://tldp.org/LDP/abs/html/

A virtual machine is pretty much essential whether you're on Windows or Mac OS. I use VirtualBox (free), but Parallels is also good (though commercial). This will allow you to set up just about any type of linux/windows machine and destroy them with impunity.

bogeymin
+1  A: 

Ubuntu linux is a pretty easy place to start: https://help.ubuntu.com/community/Installation

Having a good introductory book will help. I found Harley Hahn's Guide to Unix/Linux very useful back when I started: http://www.harley.com/books/sg3.html

I'm in awe of how easy the ubuntu people have made things and having your own linux install to play with really helps.

A possible path into using linux at home:

  • Install Ubuntu from bootable CD

    • download ISO file under windows
    • burn ISO file to CD under windows - use whatever software you like to do this
    • boot CD (ensure your BIOS lets you boot from CD)
    • use CD to repartition windows machine so the unused space can accomodate Ubuntu

      • I've done this with windows vista on my laptop and was stunned by how easy it was to do... (Naturally, you should back up everything important on the laptop first of course...)
    • use the CD's option of inserting a boot menu that lets you choose windows or Ubuntu
  • install apache - will help you learn about web admin / sys admin
  • install php - will give you something a bit fun to play with
  • try writing some basic bash scripts - like .bat files but far more powerful and a good starting point for sys admin concepts
cartoonfox
A: 

If you're looking to dip your toe in the pool, Cygwin is a good option. You can install it on you Windows box and begin learning the command line on a system that you're already familiar with. It gives you access to so many of the great *nix command line tools (less, tail, ssh, etc.). It also gives you a way to use those tools on the Windows box that you use all day, every day.

I still use it regularly when I have to use a Windows machine (SSH'ing into localhost is so much more powerful than launching a DOS command prompt) and when I finally switched away from Windows, I was so much better prepared because I'd been using the CLI and many of its tools regularly for quite a while.

Rob Wilkerson
+1  A: 

I'd agree with some others here, that installing and actually using a *nix machine is a good place to start, if you want to get into *nix administration. Even trying to host a simple FTP server will be a pain if you've never spent time with the systems.

If you have to choose, I'd advocate installing and using a linux distribution, rather than buying a Mac. Don't get me wrong; I have nothing against Macs, but I've seen a LOT more linux servers than Mac servers. And I'm sure whatever client you're working with will appreciate you setting up a server with a free OS.

As others have mentioned, Ubuntu is a great distribution to play with, if you've never used Linux before. Once you've spent some time with Ubuntu, feel free to try out some other distributions, like Ubuntu Server Edition or Fedora. Oh, and make sure to back up your data before repartitioning your hard drive and installing Linux. That's important.

Once you are comfortable using Ubuntu (or whatever you install), one of the first things you're going to need to do is learn a few basic command line utilities. This article from Oracle is a great place to start. If you want to learn a few more details, they have more articles in their series.

If you ever run into troubleshooting issues running Linux, use the support forums. They are an invaluable resource. If you want some more formal reading (which you will), try Essential System Administration or Linux Administration for Beginners. I think both will be much cheaper and more up to date than some of the other books listed here.

If you want to learn how to host a web server on a *nix machine, I would definitely recommend learning about system administration in general. Sure, you don't need to know how to set up a cron job to host a web server, but it will make your life a lot easier in the long run.


Other Details

There is a partitioning tool available within Windows Vista and Windows 7 (and XP too?) that lets you repartition your hard drive. In Windows XP, you can find the partitioning tool at Start Menu > Control Panel > Administrative Tools > Computer Management > Storage > Disk Management. Make sure you are viewing the Control Panel in Classic View. Once you've opened Disk Management, just right click on your main partition, and (after backing up data!) shrink your main partition. Now you've got some room to install Linux.

To install most Linux distributions, download the appropriate .iso file, burn it to a CD, and boot off the CD. Use a program like ImgBurn to burn the file to a CD. From there, the installation is pretty simple. Install Linux on whatever space you freed up earlier, while resizing partitions. If you notice Linux creating both a swap partition and a regular partition, don't worry; that's totally normal (Windows makes a swap file, Linux uses a swap partition).

You'll find there is a 32 and 64 bit edition of almost all the distributions mentioned. The 32 bit editions tend to be slightly more compatible with certain hardware and programs; the 64 bit editions take advantage of your hardware much better. For example, I run the 32 bit version of Ubuntu on my desktop, because there is (unfortunately) only a 32 bit driver available for the wireless card in it. Also, Amazon only offers their MP3 downloader program (lol), necessary to buy music from them, for 32 bit distributions. On my laptop, I run a 64 bit distribution, as it is much more able to take advantage of my limited hardware.

Ichimonji10
A: 

The book Running Linux is great. A very handy reference when using Linux.

Takes you from basic command line usage to administration and programming. Covers pretty much everything you need to know.

codeape