Archive for May, 2007

6 Part I . Linux First Steps (Space web hosting) .

Tuesday, May 29th, 2007

6 Part I . Linux First Steps . Memory Linux tries to keep processes with the most immediate need in RAM, while managing how processes that exceed the available memory are moved to swap space. Swap space is a defined area on your hard disk that s used to handle the overflow of running processes and data. When RAM is full, processes are placed in swap space. When swap space is full (something that you don t want to happen), new processes can t start up. . Devices Linux supports thousands of hardware devices, yet keeps the kernel a manageable size by including only a small set of drivers in the active kernel. Using loadable modules, the kernel can add support for other hardware as needed. Modules can be loaded and unloaded on demand, as hardware is added and removed. (The kernel, described in detail a bit later on, is the heart of the Linux operating system.) . File systems File systems provide the structure in which files are stored on hard disk, CD, DVD, floppy disk, or other media. Linux knows about different file system types (such as Linux ext3 and reiserfs file systems, or VFAT and NTFS from Windows systems) and how to manage them. . Security Like UNIX, Linux was built from the ground up to enable multiple users to access the system simultaneously. To protect each user s resources, every file, directory, and application is assigned sets of read, write, and execute permissions that define who can access them. In a standard Linux system, the root user has access to the entire system, some special logins have access to control particular services (such as Apache for Web services), and users can be assigned permission individually or in groups. Recent features, such as Security-Enhanced Linux, enable more refined tuning, and protection in highly secure computing environments. What I have just described are components that primarily make up what is referred to as the Linux kernel. In fact, the Linux kernel (which was created and is still managed by Linus Torvalds) is what gives Linux its name. The kernel is the software that starts up when you boot your computer and manages the programs you use so they can communicate effectively and simply with your computer hardware. Other components, such as administrative commands and applications, are added to the kernel from other open source projects to make Linux a complete operating system. The GNU project, in particular, contributed many components that are now in Linux. (GNU, Apache, KDE, GNOME, and other key open source projects in Linux are discussed a bit later.) Those other projects added such things as: . Graphical user interfaces (GUIs) Consisting of a graphical framework (typically the X Window System), window managers, panels, icons, and menus. GUIs enable you to use Linux with a keyboard and mouse combination, instead of just typing commands (as was done in the old days). . Administrative utilities Including hundreds (perhaps thousands) of commands and graphical windows to do such things as add users, manage disks, monitor the network, install software, and generally secure and manage your computer.
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

Web host server - Chapter 4 . Learning Basic Administration 157 To

Tuesday, May 8th, 2007

Chapter 4 . Learning Basic Administration 157 To access my Windows partition, I must first create the mount point (by typing mkdir /mnt/win). Then I can mount it when I choose by typing (as root) mount /mnt/win. Different Linux distributions will set up their fstab file differently. Some don t use labels and many others don t use a separate /boot partition by default. They will just have a swap partition and have all user data under the root partition (/). Here is what s in each field of the fstab file: . Field 1 The name of the device representing the file system. The word none is often placed in this field for file systems (such as /proc and /dev/pts) that are not associated with special devices. This field can include the LABEL option, with which you can indicate a universally unique identifier (UUID) or volume label instead of a device name. The advantage to this approach is that because the partition is identified by volume name, you can move a volume to a different device name and not have to change the fstab file. . Field 2 The mount point in the file system. The file system contains all data from the mount point down the directory tree structure unless another file system is mounted at some point beneath it. . Field 3 The file system type. Valid file system types are described in the Supported File Systems section earlier in this chapter. . Field 4 Options to the mount command. In the preceding example, the noauto option prevents the indicated file system from being mounted at boot time, and ro says to mount the file system read-only (which is reasonable for a CD-ROM drive). Commas must separate options. See the mount command manual page (under the -o option) for information on other supported options. Normally, only the root user is allowed to mount a file system using the mount command. However, to allow any user to mount a file system (such as a file system on a floppy disk), you could add the user option to Field 4 of /etc/fstab. In SUSE, read/write permissions are given to specific devices (such as disk or audio devices) by specific groups (such as the disk or audio group) so that users assigned to those groups can mount or otherwise access those devices. Choose the Security and Users selection in the YaST Control Center and look for Secondary Groups set for New User Defaults to see how new users are assigned to groups. . Field 5 The number in this field indicates whether the indicated file system needs to be dumped (that is, have its data backed up). A 1 means that the file system needs to be dumped, and a 2 means that it doesn t. (I don t think this field is useful anymore because many Linux systems no longer include the dump command. Most often, a 0 is used.) . Field 6 The number in this field indicates whether the indicated file system needs to be checked with fsck: 1 means it needs to be checked, and 2 means it doesn t. Tip Note
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision best web hosting services

Affordable web hosting - 156 Part II . Running the Show Table

Tuesday, May 8th, 2007

156 Part II . Running the Show Table 8-1 (continued) Type Description nfs Network File System (NFS) type of file system. NFS is used to mount file systems on other Linux or UNIX computers. hpfs File system is used to do read-only mounts of an OS/2 HPFS file system. ncpfs This relates to Novell NetWare file systems. NetWare file systems can be mounted over a network. ntfs Windows NT file system. It is supported as a read-only file system (so that you can mount and copy files from it). Read-write support is available but considered unreliable (some say dangerous). affs File system is used with Amiga computers. ufs File system popular on Sun Microsystems operating systems (that is, Solaris and SunOS). Using the fstab File to Define Mountable File Systems The hard disks on your local computer and the remote file systems you use every day are probably set up to automatically mount when you boot Linux. The definitions for which of these file systems are mounted are contained in the /etc/fstab file. Here s an example of an /etc/fstab file: LABEL=/ / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 /dev/hda5 swap swap defaults 0 0 /dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0 /dev/hda1 /mnt/win vfat noauto 0 0 /dev/fd0 /mnt/floppy auto noauto,owner 0 0 All file systems listed in this file are mounted at boot time, except for those set to noauto in the fourth field. In this example, the root (/) and boot (/boot) hard disk partitions are mounted at boot time, along with the /dev/pts, /dev/shm, and /proc file systems (which are not associated with particular devices). The CD-ROM (/dev/cdrom) and floppy disk (/dev/fd0) drives are not mounted at boot time. Definitions are put in the fstab file for floppy and CD-ROM drives so that they can be mounted in the future (as described later). I also added one line for /dev/hda1, which enables me to mount the Windows (vfat) partition on my computer so I don t have to always boot Windows to get at the files on my Windows partition.
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision mysql5 web hosting services

Web hosting asp - Chapter 4 . Learning Basic Administration 155 Table

Monday, May 7th, 2007

Chapter 4 . Learning Basic Administration 155 Table 4-4 Supported File System Types Type Description adfs Acorn disk file system, which is the standard file system used on RiscOS operating systems. befs File system used by the BeOS operating system. cifs Common Internet File System (CIFS), the virtual file system used to access servers that comply with the SNIA CIFS specification. CIFS is an attempt to refine and standardize the SMB protocol used by Samba and Windows file sharing. ext3 Ext file systems are the most common in Red Hat and many other Linux systems. The ext3 file system, also called the Third Extended file system, includes journaling features that, compared to ext2, improve a file system s capability to recover from crashes. ext2 The default file system type for earlier Linux systems. Features are the same as ext3, except that ext2 doesn t include journaling features. ext This is the first version of ext3. It is not used very often anymore. iso9660 Evolved from the High Sierra file system (the original standard for CD-ROMs). Extensions to the High Sierra standard (called Rock Ridge extensions) allow iso9660 file systems to support long filenames and UNIX-style information (such as file permissions, ownership, and links). Data CD-ROMs typically use this file system type. kafs AFS client file system. Used in distributed computing environments to share files with Linux, Windows, and Macintosh clients. minix Minix file system type, used originally with the Minix version of UNIX. It supports filenames of up to only 30 characters. msdos An MS-DOS file system. You can use this type to mount floppy disks that come from Microsoft operating systems. vfat Microsoft extended FAT (VFAT) file system. umsdos An MS-DOS file system with extensions to allow features that are similar to UNIX (including long filenames). proc Not a real file system, but rather a file-system interface to the Linux kernel. You probably won t do anything special to set up a proc file system. However, the /proc mount point should be a proc file system. Many utilities rely on /proc to gain access to Linux kernel information. reiserfs ReiserFS journaled file system. ReiserFS and ext3 are the most common file system types used with Linux today. swap Used for swap partitions. Swap areas are used to hold data temporarily when RAM is currently used up. Data is swapped to the swap area and then returned to RAM when it is needed again. Continued
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision web design programs services

Web design templates - 154 Part II . Running the Show What

Monday, May 7th, 2007

154 Part II . Running the Show What happens if a remote file system is unmounted from your computer, and you go to save a file in that mount point directory? You will write the file to that directory and it will be stored on your local hard disk. When the remote file system is remounted, however, the file you saved will seem to disappear. To get the file back, you ll have to unmount the remote file system (causing the file to reappear), move the file to another location, remount the file system, and copy the file back there. Mount points that are often mentioned as being candidates for separate partitions include /, /boot, /home, /usr, and /var. The root file system (/) is the catchall for directories that aren t in other mount points. The root file system s mount point (/) is the only one that is required. The /boot directory holds the images needed to boot the operating system. The /home file system is where all the user accounts are typically stored. Applications and documentation are stored in /usr. Below the /var mount point is where log files, temporary files, server files (Web, FTP, and so on), and lock files are stored (that is, items that need disk space for your computer s applications to keep running). The fact that multiple partitions are mounted on your file system is invisible to people using your Linux system. The only times they care is when a partition runs out of space or if they need to save or use information from a particular device (such as a floppy disk or remote file system) that isn t mounted. Of course, any user can check this by typing the mount command. Mounting File Systems Most of your hard disks are mounted automatically for you. When you install Fedora, SUSE, and other Linux systems, you are asked to create partitions and indicate the mount points for those partitions. (Other Linux installation procedures will expect you to know that you have to partition before beginning.) When you boot Linux, all Linux partitions residing on hard disk that are listed in your /etc/fstab file are typically mounted. For that reason, this section focuses mostly on how to mount other types of devices so that they become part of your Linux file system. The mount command is used not only to mount devices but also to mount other kinds of file systems on your Linux system. This means that you can store files from other operating systems or use file systems that are appropriate for certain kinds of activities (such as writing large block sizes). The most common use of this feature for the average Linux user, however, is to enable that user to obtain and work with files from floppy disks, CD-ROMs, or other removable media. Supported File Systems To see file system types that are currently available to be used on your system, type cat /proc/filesystems. Table 4-4 shows the file system types that are supported in Linux, although they may not be in use at the moment or they may not be built into your current kernel (so they may need to be loaded as modules). Tip
Note: If you are looking for high quality webhost to host and run your jsp application check Vision christian web host services

Web site design - Chapter 4 . Learning Basic Administration 153 none

Sunday, May 6th, 2007

Chapter 4 . Learning Basic Administration 153 none on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) /dev/cdrom on /mnt/cdrom type iso9660 (ro,nosuid,nodev) You may notice that /proc, /sys, /dev/pts, /proc/sys/fs/binfmt_misc, /dev/shm, and other entries not relating to a partition are shown as file systems. This is because they represent different file system types (proc and devpts, and so on). The word none, however, indicates that they are not associated with a separate physical partition. The mounted Linux partitions in this case are /dev/hda2, which provides space for the /boot directory (contains data for booting Linux), and /dev/hda3, which provides space for the rest of the Linux file system beginning from the root directory (/). This particular system also contains a Windows partition that was mounted in the /mnt/win directory and a CD that was mounted in its standard place: /mnt/ cdrom. (With most GUI interfaces, the CD is typically mounted automatically when you insert it.) After the word type, you can see the type of file system contained on the device. (See the description of different file system types later in this chapter.) Particularly on larger Linux systems, you may have multiple partitions for several reasons: . Multiple hard disks You may have several hard disks available to your users. In that case you would have to mount each disk (and possibly several partitions from each disk) in different locations in your file system. . Protecting different parts of the file system If the users on a system consume all of the file system space, the entire system can fail. For example, there may be no place for temporary files to be copied (so the programs writing to temporary files fail), and incoming mail may fail to be written to mail boxes. With multiple mounted partitions, if one partition runs out of space, the others can continue to work. . Backups Some fast ways exist to back up data from your computer that involve copying the entire image of a disk or partition. If you want to restore that partition later, you can simply copy it back (bit by bit) to a hard disk. With smaller partitions, this approach can be done fairly efficiently. . Protecting from disk failure If one disk (or part of one disk) fails, having multiple partitions mounted on your file system may enable you to continue working and just fix the one disk that fails. When a disk partition is mounted on the file system, all directories and subdirectories below that mount point are stored on that partition. So, for example, if you were to mount one partition on / and one on /usr, everything below the /usr mount point would be stored on the second partition while everything else would be stored on the first partition. If you then mounted another partition on /usr/local, everything below that mount point would be on the third partition, while everything else below /usr would be on the second partition. Note
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision ftp web hosting services

152 Part II . Running the Show File

Sunday, May 6th, 2007

152 Part II . Running the Show File systems are organized differently in Linux than they are in Microsoft Windows operating systems. Instead of drive letters (for example, A:, B:, C:) for each local disk, network file system, CD-ROM, or other type of storage medium, everything fits neatly into the directory structure. It is up to an administrator to create a mount point in the file system and then connect the disk to that point in the file system. The organization of your file system begins when you install Linux. Part of the installation process is to divide your hard disk (or disks) into partitions. Those partitions can then be assigned to: . A part of the Linux file system . Swap space for Linux, or . Other file system types (perhaps containing other bootable operating systems) This chapter focuses on partitions that are used for the Linux file system. To see what partitions are currently set up on your hard disk, use the fdisk command: # fdisk l Disk /dev/hda: 40.0 GB, 40020664320 bytes 255 heads, 63 sectors/track, 4825 cylinders Units = cylinders of 16065 * 512 bytes = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104 b Win95 FAT32 /dev/hda2 84 89 48195 83 Linux /dev/hda3 90 522 3478072+ 83 Linux /dev/hda4 523 554 257040 5 Extended /dev/hda5 523 554 257008+ 82 Linux swap This output shows the disk partitioning for a computer capable of running both Linux and Microsoft Windows. You can see that the Linux partition on /dev/hda3 has most of the space available for data. There is a Windows partition (/dev/hda1) and a Linux swap partition (/dev/hda5). There is also a small /boot partition (46MB) on /dev/hda2. In this case, the root partition for Linux has 3.3GB of disk space and resides on /dev/hda3. Next use the mount command (with no options) to see what partitions are actually being used for your Linux system (which available disk partitions are actually mounted and where they are mounted): # mount /dev/hda3 on / type ext3 (rw) /dev/hda2 on /boot type ext3 (rw) /dev/hda1 on /mnt/win type vfat (rw) none on /proc type proc (rw) none on /sys type sysfs (rw) none on /dev/pts type devpts (rw,gid=5,mode=620)
Note: If you are looking for high quality webhost to host and run your jsp application check Vision christian web host services

Web space - Chapter 4 . Learning Basic Administration 151 Here

Saturday, May 5th, 2007

Chapter 4 . Learning Basic Administration 151 Here is an example of the modprobe command being used to load the parport module, which provides the core functions to share parallel ports with multiple devices: # modprobe parport After parport is loaded, you can load the parport_pc module to define the PC-style ports available through the interface. The parport_pc module lets you optionally define the addresses and IRQ numbers associated with each device sharing the parallel port. For example: # modprobe parport_pc io=0×3bc irq=auto In this example, a device is identified as having an address of 0×3bc, and the IRQ for the device is autodetected. The modprobe command loads modules temporarily they disappear at the next reboot. To permanently add the module to your system, add the modprobe command line to one of the startup scripts that are run at boot time. An alternative to using modprobe is the insmod command. The advantage of using modprobe, however, is that insmod loads only the module you request, whereas modprobe tries to load other modules that the one you requested is dependent on. Removing Modules Use the rmmod command to remove a module from a running kernel. For example, to remove the module parport_pc from the current kernel, type the following: # rmmod parport_pc If it is not currently busy, the parport_pc module is removed from the running kernel. If it is busy, try killing any process that might be using the device. Then run rmmod again. Managing File Systems and Disk Space File systems in Linux are organized in a hierarchy, beginning from root (/) and continuing downward in a structure of directories and subdirectories. As an administrator of a Linux system, it s your duty to make sure that all the disk drives that represent your file system are available to the users of the computer. It is also your job to make sure there is enough disk space in the right places in the file system for users to store what they need. Note
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision servlet hosting services

150 Part II . Running the (Web hosting domain names) Show #

Saturday, May 5th, 2007

150 Part II . Running the Show # lsmod Module Size Used by snd_seq_oss 38912 0 snd_seq_midi_event 9344 1 snd_seq_oss snd_seq 67728 4 snd_seq_oss,snd_seq_midi_event snd_seq_device 8328 2 snd_seq_oss,snd_seq … autofs 16512 0 ne2k_pci 9056 0 8390 13568 1 ne2k_pci ohci1394 41860 0 ieee1394 284464 1 ohci1394 floppy 65712 0 sg 36120 0 scsi_mod 124600 1 sg parport_pc 39724 0 parport 47336 1 parport_pc ext3 128424 2 jbd 86040 1 ext3 This output shows a variety of modules that have been loaded on a Linux system, including several to support the ALSA sound system, some of which provide OSS compatibility (snd_seq_oss). To find information about any of the loaded modules, use the modinfo command. For example, you could type the following: # modinfo -d snd-seq-oss OSS-compatible sequencer module Not all modules have descriptions available. In this case, however, the snd-seq-oss module is described as an OSS-compatible sequencer module. You can also use the -a option to see the author of the module, or -n to see the object file representing the module. The author information often has the e-mail address of the driver s creator, so you can contact the author if you have problems or questions about it. Loading Modules You can load any module that has been compiled and installed (to the /lib/modules directory) into your running kernel using the modprobe command. A common reason for loading a module is to use a feature temporarily (such as loading a module to support a special file system on a floppy you want to access). Another reason is to identify a module that will be used by a particular piece of hardware that could not be autodetected.
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision ftp web hosting services

Chapter 4 . Learning Basic Administration 149 Configuring (Web hosting top)

Friday, May 4th, 2007

Chapter 4 . Learning Basic Administration 149 Configuring Hardware In a perfect world, after installing and booting Linux, all of your hardware is detected and available for access. Although many Linux systems are rapidly moving closer to that world, there are times when you must take special steps to get your computer hardware working. Linux systems come with tools for configuring the drivers that stand between the programs you run (such as CD players and Web browsers) and the hardware they use (such as CD-ROM drives and network cards). The intention is to have the drivers your system needs most often built into the kernel; these are called resident drivers. Drivers that are added dynamically as needed are referred to as loadable modules. Finding Available Modules If you have installed the Linux kernel source code, source code files for available drivers are stored in subdirectories of the /usr/src/linux*/drivers directory. You can find information about these drivers in a couple of ways: . make xconfig With /usr/src/linux* as your current directory, type make xconfig from a Terminal window on the desktop. Select the category of module you want and then click Help next to the driver that interests you. The help information that appears includes a description of the driver. . Documentation The /usr/src/linux*/Documentation directory contains lots of plain-text files describing different aspects of the kernel and related drivers. After modules have been built, they are installed in the /lib/modules/ subdirectories. The name of the directory is based on the current release number of the kernel. Modules that are in that directory can then be loaded and unloaded as they are needed. Listing Loaded Modules To see which modules are currently loaded into the running kernel on your computer, use the lsmod command. Here s an example: If you don t have a Linux system installed yet, try booting KNOPPIX and using lsmod to list your loaded modules. If all your hardware is working properly, write down this list of modules. Later, when you permanently install Fedora or some other Linux system, if your CD drive, modem, video card, or other hardware doesn t work properly, you can use your list of modules to determine which module should have been used and load it, as described in the next section. Note
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision php5 hosting services