UNIX and the internet: A primer

Discussion in 'Archives' started by Faskist, Apr 6, 2008.

UNIX and the internet: A primer
  1. Unread #1 - Apr 6, 2008 at 6:52 PM
  2. Faskist
    Joined:
    Apr 25, 2005
    Posts:
    1,869
    Referrals:
    0
    Sythe Gold:
    0

    Faskist Tuxhead
    Banned

    UNIX and the internet: A primer

    BASIC GUIDE TO UNIX AND THE INTERNET, AND HOW THEY ARE RELATED

    To begin

    What is UNIX?
    UNIX is a multi-user, multi-process operating system derived from Multics.

    Why are UNIX and the internet related?
    Everything important on the internet runs on a UNIX-derived or inspired system. Even Microsoft.com uses a Linux server to serve it's caches, because of DDoS attacks a while back.

    Is Linux UNIX?
    No. Linux is an entirely new codebase, which maintains compatibility with Unix, but is Free Software. Free Software features heavily in UNIX-related news today, due to the ideals of hobbyism which permeated it's original fanbase.

    How much of the internet is using servers based on UNIX?
    A lot. The way the desktop market is saturated with Windows, the server market is saturated with UNIX-likes. Some of you may remember being outraged, if you've been around long enough, by the way Index.htm wouldn't load, and index.htm would. This a UNIX legacy, and is nearly eliminated in modern server software.

    Is Linux the only UNIX-like?
    No. And there isn't even one Linux, there's many different distributions (Full operating systems, referred to as GNU/Linux, due to the fact that most, if not all, of the operating system apart from the kernel has been written by the GNU project). Aside from Linux, there's BSD, GNU/Hurd, and countless dead spinoffs from the original UNIX, like XENIX. A complex world. Each distribution and operating system has a different goal and target audience -- most of which are the author and their friends. To make things even more confusing, a lot of Linux distributions configure their kernel very differently, and some make minor changes to the code itself. Most BSD variants use a kernel which is almost entirely their own.

    So, what actually happens on a server? How is a server different from my PC? Can I give out my IP address and use it as a web site?
    Your home computer will not accept outside HTTP connections, unless you have made a serious blunder somewhere. UNIX machines set up as servers will route incoming HTTP requests to a public HTML folder, where the site's contents are kept. If you access a 404 on a vanilla Red Hat server install, you will likely see the error message "Could not locate /home/user/public_html/whatever.php", showing the UNIX directory tree.

    There's a lot more to it, involving permissions and ports, but unless you actually plan on running a server, you don't need to know, and I'm no expert on it, to say the least.

    What is the UNIX directory tree? What does /home/ mean? Is it the C drive?
    UNIX does not use drive letters. Instead, drives are "mounted" to a position in the tree. To understand this, you have to understand partitions.

    A hard disk doesn't just have a load of data dumped on the drive, it's all organised in partitions, or sections, of the hard drive, which are kept track of in the MBR. Because the MBR is so small, only 4 main partitions can be created. If you need more, you can create "extended" partitions, which can encompass more, by storing the relevant data in itself, rather than in the small MBR.

    Let's say we have hard disk 1, with partitions 1, 2 and 3, and hard disk 2, with one big parition. They are both IDE drives, so UNIX assigns them hd??. hda1 is the first partition of the first disk, etc.

    So, assuming hda1 is the standard UNIX filesystem (ext2) we would issue the command

    Code:
    # mount -t ext2 hda1 /
    That done, we can access anything in hda1 simply by browsing to / in our file browser. If that confuses you, think of / as C:\, which will suffice until this next section.

    Code:
    # mount -t ntfs hda2 /windows
    This command will mount our Windows partition, second partition of the first hard drive, as /windows, which we can access from /, without switching drives (This is the main advantage of UNIX-like directory trees, the modularity). The opposite to mount is umount.

    In case you haven't noticed, UNIX uses / instead of \. Windows would be the same, but during the development of MS-DOS, Microsoft broke with computing tradition and used / to denote arguments to command line programs, and to maintain compatibility with older versions, could not revert to the sane /. This made it twice as hard for Microsoft to develop server applications, so I guess they paid the penance for that.

    All your drives are listed under /dev, short for devices, as files. That is a UNIX philosophy -- everything is a file. Even folders are files, albeit special ones.

    So what's the difference between Linux, BSD, etc.?
    Linux has a completely different kernel to most "true" UNIX-likes, as does the Hurd. Linux and the Hurd share the same coreutils, but the BSD projects have produced their own. Basically, the differences are mostly minor and cosmetic, but most BSD enthusiasts are ideologically opposed to the GPL used by GNU projects, and so choose BSD (A much freer license, in their opinion).

    EDIT: I know it needs work on the internet side of things, and I could go a bit deeper with UNIX (Although this is more to show how UNIX runs the internet than to show you how to use a UNIX-like system).
     
  3. Unread #2 - Apr 6, 2008 at 7:07 PM
  4. Eric
    Joined:
    Feb 23, 2007
    Posts:
    3,344
    Referrals:
    13
    Sythe Gold:
    25

    Eric Grand Master
    Banned

    UNIX and the internet: A primer

    Nice guide. Moved.
     
  5. Unread #3 - Apr 8, 2008 at 10:08 PM
  6. Fouisgras
    Joined:
    Jan 21, 2007
    Posts:
    2,202
    Referrals:
    2
    Sythe Gold:
    0

    Fouisgras Jansen's Lover
    $5 USD Donor

    UNIX and the internet: A primer

    Darby, I like. I have questions though. I'll msn you.
     
  7. Unread #4 - Apr 9, 2008 at 11:15 PM
  8. Faskist
    Joined:
    Apr 25, 2005
    Posts:
    1,869
    Referrals:
    0
    Sythe Gold:
    0

    Faskist Tuxhead
    Banned

    UNIX and the internet: A primer

    If you ask the questions here, I can answer them in public and include them in the guide.
     
< So you want 99 mage? | Buying Good Skiller with Lvl 85+ Skillz >

Users viewing this thread
1 guest


 
 
Adblock breaks this site