Archive for August, 2007

Chapter 4 . Learning Basic (Web hosting servers) Administration 135 Administrative

Friday, August 31st, 2007

Chapter 4 . Learning Basic Administration 135 Administrative Configuration Files Configuration files are another mainstay of Linux administration. Almost everything you set up for your particular computer user accounts, network addresses, or GUI preferences is stored in plain-text files. This has some advantages and some disadvantages. The advantage of plain-text files is that it s easy to read and change them. Any text editor will do. The downside, however, is that as you edit configuration files, no error checking is going on. You have to run the program that reads these files (such as a network daemon or the X desktop) to find out whether you set up the files correctly. A comma or a quote in the wrong place can sometimes cause a whole interface to fail. Some software packages offer a command to test the sanity of the configuration file tied to a package before you start a service. For example, the testparm command is used with Samba to check the sanity of your smb.conf file. Other times, the daemon process providing a service offers an option for checking your config file. For example, run httpd -t to check your Apache Web server configuration before starting your Web server. Throughout this book you ll find descriptions of the configuration files you need to set up the different features that make up Linux systems. The two major locations of configuration files are your home directory (where your personal configuration files are kept) and the /etc directory (which holds system-wide configuration files). Following are descriptions of directories (and subdirectories) that contain useful configuration files. (Refer to Table 4-1 for some individual configuration files in /etc that are of particular interest.) Viewing the contents of Linux configuration files can teach you a lot about administering Linux systems. . $HOME All users store information in their home directories that directs how their login accounts behave. Most configuration files in $HOME begin with a dot (.), so they don t appear as a user s directory when you use a standard ls command (you need to type ls -a to see them). There are dot files that define how each user s shell behaves, the desktop look-and-feel, and options used with your text editor. There are even files such as .ssh/* and .rhosts that configure network permissions for each user. (To see the name of your home directory, type echo $HOME from a shell.) . /etc This directory contains most of the basic Linux system-configuration files. Table 4-1 shows some /etc configuration files of interest. . /etc/cron* Directories in this set contain files that define how the crond utility runs applications on a daily (cron.daily), hourly (cron.hourly), monthly (cron.monthly), or weekly (cron.weekly) schedule. Note
We recommend high quality webhost to host and run your jsp application: christian web host services.

134 Part II . Running the Show Exploring (Net web server)

Friday, August 31st, 2007

134 Part II . Running the Show Exploring Administrative Commands, Configuration Files, and Log Files You can expect to find many commands, configuration files, and log files in the same places in the file system, regardless of which Linux distribution you are using. The following sections give you some pointers on where to look for these important elements. Administrative Commands Only the root user is intended to use many administrative commands. When you log in as root (or use su - from the shell to become root), your $PATH variable is set to include some directories that contain commands for the root user. These include the following: . /sbin Contains commands for modifying your disk partitions (such as fdisk), checking file systems (fsck), and changing system states (init). . /usr/sbin Contains commands for managing user accounts (such as useradd) and adding mount points for automounting file systems (automount). Commands that run as daemon processes are also contained in this directory. (Look for commands that end in d, such as sshd, pppd, and cupsd.) Some administrative commands are contained in regular user directories (such as /bin and /usr/bin). This is especially true of commands that have some options available to everyone. An example is the /bin/mount command, which anyone can use to list mounted file systems, but only root can use to mount file systems. (Some desktops, however, are configured to let regular users use mount to mount CDs, DVDs, or other removable media.) To find commands intended primarily for the system administrator, check out the section 8 manual pages (usually in /usr/share/man/man8). They contain descriptions and options for most Linux administrative commands. Some third-party applications will add administrative commands to directories that are not in your PATH. For example, an application may put commands in /usr/local/bin, /opt/bin, or /usr/local/sbin. Some Linux distributions automatically add those directories to your PATH, usually before your standard bin and sbin directories. In that way, commands installed to those directories are not only accessible, but can also override commands of the same name in other directories.
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Chapter 4 . Learning Basic Administration (Business web hosting) 133 as

Thursday, August 30th, 2007

Chapter 4 . Learning Basic Administration 133 as the root user s PATH variable will be used. If you become the root user by just typing su, rather than su -, you won t change directories or the environment of the current login session. You can also use the su command to become a user other than root. This is useful for troubleshooting a problem that is being experienced by a particular user, but not by others on the computer (such as an inability to print or send e-mail). For example, to have the permissions of a user named jsmith, you d type the following: $ su - jsmith Even if you were root user before you typed this command, afterward you would have only the permissions to open files and run programs that are available to jsmith. As root user, however, after you type the su command to become another user, you don t need a password to continue. If you type that command as a regular user, you must type the new user s password. When you are finished using superuser permissions, return to the previous shell by exiting the current shell. Do this by pressing Ctrl+D or by typing exit. If you are the administrator for a computer that is accessible to multiple users, don t leave a root shell open on someone else s screen (unless you want to let that person do anything he wants to the computer)! Allowing Limited Administrative Access As mentioned earlier, when you run GUI tools as a regular user (from Red Hat Linux, SUSE, or some other Linux systems), you are prompted for the root password before you are able to access the tool. By entering the root password, you are given root privilege for that one task, without being root user for every task you do from that desktop session. A particular user can also be given administrative permissions for particular tasks without being given the root password. For example, a system administrator can add a user to particular groups, such as modem, disk, users, cdrom, ftp, mail, or www, and then open group permission to use those services. Or, an administrator can add a user to the wheel group and add entries to the /etc/sudoers file to allow that user to use the sudo command to run individual commands as root. (See the description of sudo later in this chapter.) A fairly new feature being added to some Linux distributions used in highly secure environments is Security Enhanced Linux (SELinux). With SELinux, instead of one all-powerful root user account, multiple roles can be defined to protect selected files and services. In that way, for example, if someone hacks into your Web server, he does not automatically have access to your mail server, user passwords, or other services running on the computer.
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

132 Part II . Running the Show The (Web server on xp)

Thursday, August 30th, 2007

132 Part II . Running the Show The home directory for the root user is typically /root. The home directory and other information associated with the root user account are located in the /etc/passwd file. Here s what the root entry looks like in the /etc/passwd file: root:x:0:0:root:/root:/bin/bash This shows that for the user named root the user ID is set to 0 (root user), the group ID is set to 0 (root group), the home directory is /root, and the shell for that user is /bin/bash. (We re using a shadow password file to store encrypted password data, so the password field here contains an x.) You can change the home directory or the shell used by editing the values in this file. A better way to change these values, however, is to use the useradd command (described later in this chapter). Becoming Root from the Shell (su Command) Although you can become the superuser by logging in as root, sometimes that is not convenient. For example, you may be logged in to a regular user account and just want to make a quick administrative change to your system without having to log out and log back in. Or, you may need to log in over the network to make a change to a Linux system but find that the system doesn t allow root users in from over the network (a common practice in the days before secure shells were available). The solution is to use the su command. From any Terminal window or shell, you can simply type the following: $ su Password: ****** # When you are prompted, type in the root user s password. The prompt for the regular user ($) changes to the superuser prompt (#). At this point, you have full permission to run any command and use any file on the system. However, one thing that the su command doesn t do when used this way is read in the root user s environment. As a result, you may type a command that you know is available and get the message Command Not Found. To fix this problem, use the su command with the dash (-) option instead, like this: $ su - Password: ****** # You still need to type the password, but after that, everything that normally happens at login for the root user happens after the su command is completed. Your current directory will be root s home directory (probably /root), and things such
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Chapter 4 . Learning Basic Administration (Web hosting india) 131 YaST

Wednesday, August 29th, 2007

Chapter 4 . Learning Basic Administration 131 YaST has some useful tools in its Hardware section that enable you to probe your computer hardware. On my system, for example, I could see that the CD-ROM drive that YaST detected was available through device /dev/hdc and that it supported CD-R, CD-RW, and DVD media. I could also see detailed information about my CPU, network card, PCI devices, sound card, and various storage media. YaST also offers interfaces for configuring and starting network devices, as well as a variety of services to run on those devices. In addition, you can use YaST to configure your computer as a client for file sharing (Samba and NFS), e-mail (sendmail), and a variety of network services. SUSE Linux Enterprise Server comes with a wider range of configuration tools that are specifically geared toward server setup, including tools for configuring a mail server, VPN tunnels, and full Samba 3. Using the root Login Every Linux system starts out with at least one administrative user account (the root user) and possibly one or more regular user accounts (given a name that you choose, or a name assigned by Linux). In most cases, you log in as a regular user and become the root user to do an administrative task. The root user has complete control of the operation of your Linux system. That user can open any file or run any program. The root user also installs software packages and adds accounts for other people who use the system. When you first install most Linux systems, you add a password for the root user. You must remember and protect this password you will need it to log in as root or to obtain root permission while you are logged in as some other user. Other Linux systems (such as KNOPPIX) start you with a blank root password, so you may want to add one when you first start up by typing the following from a Terminal window or other shell: # passwd root Changing password for user root. New UNIX password: ******** Retype new UNIX password: ******** Some bootable Linux distributions give you (as a regular user) the power to run commands as root. You simply have to ask for the privilege using the sudo command. For example, from a Terminal window, to open a shell as root, type the following: $ sudo su - # You ll find out more about the sudo command later in this chapter. Note
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

130 Part II . Running the Show . (Web hosting rating)

Wednesday, August 29th, 2007

130 Part II . Running the Show . Language Select the default language used for the system. . Login Screen Control how your login screen appears and behaves. . Network Manage your current network interfaces; add interfaces as well. . Network Device Control Display the active profile for network devices. . Printing Manager Configure local and network printers. . Red Hat Network Configuration Register your computer with the Red Hat Network to get free software updates. . Root Password Change the root password. . Security Level Configure your firewall to allow or deny services to computers from the network. . Soundcard Detection Try to detect and configure your sound card. . System Logs View system log files, and search them for keywords. . System Monitor View information about running processes and resource usage. . Task Scheduler Schedule tasks to be run at set times. . Users & Groups Add, display, and change user and group accounts for your Fedora system. SUSE YaST Tools The YaST administrative interface is one of the strongest features of SUSE Linux. From a SUSE desktop, open the YaST Control Center by selecting System.YaST from the main menu. Figure 4-3 shows an example of the YaST Control Center that appears. Figure 4-3: Use the YaST Control Center to administer SUSE systems.
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

Chapter 4 . Learning Basic Administration 129 Figure (Web hosting provider)

Wednesday, August 29th, 2007

Chapter 4 . Learning Basic Administration 129 Figure 4-2: See services that start from each run level in the Service Configuration window. . Bootloader If you have multiple operating systems on your computer, or multiple Linux kernels available to boot in Linux, you can use the Boot Configuration screen to choose which to boot by default. For example, you might have Fedora Linux, SUSE, and Windows XP all on the same hard disk. You could choose which would start automatically (after a set number of seconds), if one wasn t selected explicitly. . Date & Time Set the date and time or choose to have an NTP server keep system time in sync. . Disk Management Mount and format removable media, such as CDs and floppy disks. . Display Change the settings for your X desktop, including color depth and resolution for your display. You can also choose settings for your video card and monitor. . Hardware Browser View information about your computer s hardware. . Internet Configuration Wizard Create initial configurations for connecting to the Internet via Ethernet, ISDN, modem, and other types of network equipment. . Keyboard Choose the type of keyboard you are using, based on language. . Kickstart Create a kickstart configuration file that can be used to install multiple Fedora systems without user interaction.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

Web host music - 128 Part II . Running the Show Red

Tuesday, August 28th, 2007

128 Part II . Running the Show Red Hat Config Tools A set of graphical tools that comes with Fedora and Red Hat Enterprise Linux systems can be launched from the Applications and Desktop menus (under the System Tools and System Settings submenus) or the command line. Most of the Red Hat tools that launch from the command line begin with the system-config string (such as system-config-network). In Fedora Core 1 and previous versions of Red Hat Linux, the GUI administrations tools all began with redhat-, such as redhat-config-network and redhatlogviewer. Starting with Fedora Core 2, those names have all changed tosystem-, resulting in names like system-config-network and system-logviewer. These administrative tasks require root permission; if you are logged in as a regular user, you must enter the root password before the GUI application s window opens. After you ve entered that password, most of the system configuration tools will open without requiring you to retype the password during this login session. Look for a keys icon in the lower-right corner of the panel, indicating that you have root authorization. Click the keys to open a pop-up window that enables you to remove authorization. Otherwise, authorization goes away when you close the GUI window. The following list describes many of the GUI-based windows you can use to administer your Fedora or Red Hat Linux system. Start these windows from the System Settings or System Tools submenus on your Applications and Desktop menus: . Server Settings Access the following server configuration windows: Domain Name System Create and configure zones if your computer is acting as a DNS server. HTTP Configure your computer as an Apache Web server. NFS Set up directories from your system to be shared with other computers on your network using the NFS service. Samba Configure Windows (SMB) file sharing. (To configure other Samba features, you can use the SWAT window.) Services Display and change which services are running on your Fedora system at different run levels from this Service Configuration window (see Figure 4-2). . Add/Remove Applications Manage software packages in the Fedora distribution. . Authentication Change how users are authenticated on your system. Usually, Shadow Passwords and MD5 Passwords are selected. However, if your network supports LDAP, Kerberos, SMB, NIS, or Hesiod authentication, you can select to use any of those authentication types. Note
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.

Chapter 4 . Learning Basic (Web server version) Administration 127 The

Tuesday, August 28th, 2007

Chapter 4 . Learning Basic Administration 127 The Webmin Administration Tool The Webmin facility (www.webmin.com) offers more complete Web-based Linux and UNIX administration features. Although Webmin isn t delivered with some Linux systems that offer their own graphical administration tools (such as Red Hat s Fedora and RHEL), the Webmin project has ported Webmin to run in many different Linux distributions. Those distributions include SUSE, Red Hat (Fedora and RHEL), Debian, Slackware, Mandriva, Yellow Dog, and others (see www.webmin.com/ support.html for a complete list). Once you get Webmin from Webmin.com and install it, you can use Webmin from your Web browser. To start the Webmin interface, type the following in the Web browser s location box: http://localhost:10000 After you log in as root user, the main Webmin page displays, as shown in Figure 4-1. Figure 4-1: Webmin offers a Web browser interface for administering Linux. Graphical Administration with Different Distributions Some people fear that once they ve left the familiar confines of their Microsoft Windows system for Linux, they ll be stuck doing everything from a command line. To gain a wider audience, commercial Linux distributions such as Red Hat Linux and SUSE created their own sets of graphical tools to provide an easy entry point for new Linux users. The following sections describe Red Hat s system-config and SUSE s YaST graphical administration tools.
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.

Cedant web hosting - 126 Part II . Running the Show Using

Monday, August 27th, 2007

126 Part II . Running the Show Using Web-Based Administration Web-based administration tools are available with many open source projects to make those projects more accessible to casual users. Often all you need to use those tools is a Web browser (such as Mozilla), the port number of the service, and the root password. Projects such as Samba and CUPS come with their own Web administration tools. Webmin is a general-purpose tool for administering a variety of Linux system services from your Web browser. The advantages of Web-based administration tools are that you can operate them from a familiar interface (your Web browser) and you can access them remotely. If the Linux distribution you are using comes with its own set of graphical administration tools (such as SUSE s YaST or Red Hat s system-config tools), you should generally use those instead of any Web-based interface that comes with a project because a distribution s own tools better integrate with its tools for starting and stopping services. Open Source Projects Offering Web Administration Several major open source projects come with Web-based interfaces for configuring those projects. Regardless of which Linux you are using, you can use your Web browser to configure the following projects: . Samba To set up Samba for doing file and printer sharing with Microsoft Windows systems on your LAN, use the Samba SWAT Web-based administration tools from any Web browser. With SWAT installed and running, you can access your Samba server configuration from your Web browser by typing the following URL in the location box: http://localhost:901 The Samba project also offers other graphical tools for administering Samba. You can check them out at http://samba.org/samba/GUI. For descriptions of these tools, see Chapters 26 and 27. . CUPS The Common UNIX Printing Service (CUPS) has its own Web administration tool. With CUPS installed and configured, you can typically use CUPS Web administration by typing the following URL in your Web browser s location box: http://localhost:631 You use the CUPS administration tool to manage printers and classes and do a variety of administration tasks. CUPS is described in Chapter 26. Samba and CUPS are included with many Linux distributions. Other projects that offer Web-based administration that may or may not be in your Linux distribution include SquirrelMail (a webmail interface) and Mailman (a mailing list facility). Note
We recommend you use shared web hosting services, because many users agree that it is cheap, reliable and customer-satisfying webhost.