Archive for June, 2007

Web server logs - 114 Part I . Linux First Steps Configuring

Thursday, June 28th, 2007

114 Part I . Linux First Steps Configuring Your Own Desktop Today s modern desktop computer systems are made to spoon-feed you your operating system. In the name of ease of use, some desktop environments spend a lot of resources on fancy panels, complex control centers, and busy applets. In short, they can become bloated. Many technically inclined people want a more streamlined desktop or at least want to choose their own bells and whistles. They don t want to have to wait for windows to redraw or menus to come up. Linux enables those people to forget the complete desktop environments and configure: . X The X Window System provides the framework of choice for Linux and most UNIX systems. When you configure X yourself, you can choose the video driver, monitor settings, mouse configuration, and other basic features needed to get your display working properly. . Window manager Dozens of window managers are available to use with X on a Linux system. Window managers add borders and buttons to otherwise bare X windows. They add colors and graphics to backgrounds, menus, and windows. Window managers also define how you can use keyboard and mouse combinations to operate your desktop. You only need to configure X directly if your desktop isn t working (the desktop may appear scrambled or just plain crash). You may choose to configure X if you want to tune it to give you higher resolutions or more colors than you get by default. Still to come in this chapter: examining tools for tuning X and, in particular, working with the xorg.conf file. You ll also explore a few popular window managers that you might want to try out. Slackware Linux is used to illustrate how to choose and configure a window manager because Slackware users tend to like simple, direct ways of working with the desktop (when they need a desktop at all). Configuring X Before 2004, most Linux distributions used the X server from the XFree86 project (www.xfree86.org). Because of licensing issues, many of the major Linux vendors (including Red Hat, SUSE, and Slackware) changed to the X server from X.org (www.X.org). The descriptions of how to get X going on your machine assume you are using the X.org X server. To determine which X server is installed on your system, from a Terminal window type man Xorg and man XFree86. If you only have one X server installed on your computer (which you probably do) only the one installed will show a man page. While you are there, press the space bar to page through the features of your X server. Note

Chapter 3 . Getting into the (Free web servers) Desktop 113

Thursday, June 28th, 2007

Chapter 3 . Getting into the Desktop 113 distribution, but you can get a bunch of other themes from themes. freshmeat.net (click on Metacity). Click Install theme, and then click the Window Border tab to select from different themes that change the title bar and other borders of your windows. Click the Icons tab to choose different icons to represent items on your desktop. Themes change immediately as you click or when you drag a theme name on the desktop. Exiting GNOME When you are done with your work, you can either log out from your current session or shut down your computer completely. To exit from GNOME, do the following: 1. Click the red hat menu button. 2. Select Log Out from the menu. A pop-up window appears, asking if you want to Log Out, Shut Down, or Restart the computer. At this point, you can also choose to save your session by clicking Save Current Setup. This is a great way to have the applications that you use all the time restart the next time you log in. Make sure you save your data before you exit, however. Most applications do not yet support the data-saving feature. 3. Select Log Out from the pop-up menu. This logs you out and returns you to either the graphical login screen or to your shell login prompt. (If you select Shut Down, the system shuts down, and if you select Reboot, the system restarts.) 4. Select OK to finish exiting from GNOME. If you are unable to get to the Log Out button (if, for example, your Panel crashed), there are two other exit methods. Try one of these two ways, depending on how you started the desktop: . If you started the desktop by typing startx from your login shell, press Ctrl+Alt+F1 to return to your login shell. Then press Ctrl+C to kill the desktop. . If you started the desktop from a graphical login screen, first open a Terminal window (right-click the desktop and select New Terminal). In the Terminal window, type ps x | more to see a list of running processes. Look for a command named gnome-session and determine its number under the PID column. Then type kill -9 PID, where PID is replaced by the PID number. You should see the graphical login screen. Although these are not the most graceful ways to exit the desktop, they work. You should be able to log in again and restart the desktop. Tip

1 on 1 web hosting - 112 Part I . Linux First Steps extension

Wednesday, June 27th, 2007

112 Part I . Linux First Steps extension appears in a Nautilus window, you can see the icon that will represent the file, the mime type assigned to the file, and the action (if any) that s taken when you open the file. You can modify any file type that appears in these preferences windows. You can choose what applications are run and what icons represent data of that type. You can even create your own data types. . Screensaver Choose from dozens of screensavers from the Screensaver window. Select Random Screensaver to have your screen saver chosen randomly from those you mark with a check, or select one that you like from the list to use all the time. Next, choose how long your screen must be idle before the screensaver starts (default is 10 minutes). For random screen savers, you can select how long before cycling to the next screen saver. You can also choose to require a password or to enable power management to shut down your monitor after a set number of minutes (Advanced Tab). Figure 3-14 shows the Screensaver Preferences dialog box. Figure 3-14: Select specific or random screen savers from the Screensaver Preferences dialog box. . Theme Selector Choose an entire theme of elements to be used on your desktop, if you like. A desktop theme affects not only the background but also the way that many buttons and menu selections appear. There are only a few themes available for the window manager (Metacity) in the Fedora Core

Chapter 3 . Getting into the Desktop 111 (Web server info)

Wednesday, June 27th, 2007

Chapter 3 . Getting into the Desktop 111 The following items highlight some of the preferences you might want to change: . Accessibility If you have difficulty operating a mouse or keyboard, the Keyboard Accessibility Preferences (AccessX) window lets you adapt mouse and keyboard settings to make it easier for you to operate your computer. From the Preferences window, open Accessibility. . Desktop Background From Desktop Background Preferences, you can choose a solid color or an image to use as wallpaper. If you choose to use a solid color (by selecting No Wallpaper), click the Color box, select a color from the palette, and click OK. To use wallpaper for your background, open the folder containing the image you want to use, and then drag the image into the Desktop Wallpaper pane on the Desktop Preferences window. You can choose from a variety of images in the /usr/share/nautilus/patterns and /usr/share/backgrounds/tiles directories. Then choose to have the wallpaper image tiled (repeated pattern), centered, scaled (in proportion), or stretched (using any proportion to fill the screen). . CD and DVD Properties Even if you don t change CD properties, it is important to know what happens when you insert a CD or DVD. (These properties are associated with a feature called magicdev, which is a bit controversial. You ll learn more about magicdev in Chapter 19.) For data CDs, the CD is mounted when it is inserted, any autorun program on the CD is run, and a file manager window opens for the CD. If you would rather mount and open the CD as you choose, you can turn off any or all of these preferences. For audio CDs, the gnome-cd player is launched and the CD begins playing. You can type in a different CD player, if you like, or clear the Run Command When CD Is Inserted check box so that you can choose which player to use later. For blank CDs, a CD-burning utility is launched through the Nautilus window. After that, you can burn audio files or data to the blank CD. For DVD (video), the DVD is not set to play automatically. If you have a player installed that can play the content of DVDs that you have, turn on this feature and add the command to run the player into the Command box. For a data DVD, such as the one that comes with this book, you can simply mount it to access the data. . File Types and Programs The File Types and Programs preferences can help you understand the different types of data files that GNOME knows about. Double-click this icon to see data types (audio, documents, images, information, and so on) that have definitions in GNOME. Then choose a particular data type (such as Audio, ogg audio). From the Edit File Type window that appears, you can see the information assigned to the file type. For example, when data that ends with an .ogg

Make web site - 110 Part I . Linux First Steps .

Wednesday, June 27th, 2007

110 Part I . Linux First Steps . MIME types and file types To handle different types of content that may be encountered in the Nautilus window, you can set applications to respond based on MIME type and file type. With a folder being displayed, right-click a file for which you want to assign an application. Click either Open With an Application or Open With a Viewer. If no application or viewer has been assigned for the file type, click Associate Application to be able to select an application. From the Add File Types window, you can add an application based on the file extension and MIME type representing the file. . Drag-and-drop You can use drag-and-drop within the Nautilus window, between the Nautilus and the desktop, or among multiple Nautilus windows. As other GNOME-compliant applications become available, they are expected to also support the drag-and-drop feature. If you would like more information on the Nautilus file manager, visit the GNOME Web site (www.gnome.org/nautilus). Changing GNOME Preferences There are many ways to change the behavior, look, and feel of your GNOME desktop. Most GNOME preferences can be modified from the Preferences window. The easiest way to access that is to type preferences: in the Nautilus Open Location box. Unlike earlier versions of GNOME for Fedora Core and Red Hat Linux, boundaries between preferences relating to the window manager (Metacity), file manager (Nautilus), and the GNOME desktop itself have been blurred. Preferences for all of these features are in the Preferences window. Figure 3-13 shows the Preferences window, with icons that represent features you can change. Figure 3-13: Change the look-and-feel of your desktop from the Preferences window.

Web server address - Chapter 3 . Getting into the Desktop 109

Wednesday, June 27th, 2007

Chapter 3 . Getting into the Desktop 109 Icons in Nautilus often indicate the type of data that a particular file contains. The contents or file extension of each file can determine which application is used to work with the file, or you can right-click an icon to open the file it represents with a particular application or viewer. Here are some of the more interesting features of Nautilus: . Sidebar From the Browse Folder view described previously, select View. Side Pane to have a sidebar appear in the left column of the screen. From the sidebar, you can click a pull-down menu that represents different types of information you can select one at a time. The Tree tab, for example, shows a tree view of the directory structure, so you can easily traverse your directories. The Notes tab lets you add notes that become associated with the current Directory or Web page, and the History tab displays a history of directories and Web sites you have visited, enabling you to click those items to return to the sites they represent. There is also an Emblems tab that lets you drag-and-drop emblems on files or folders to indicate something about the file or folder (emblems include icons representing drafts, urgent, bug, and multimedia). . Windows file and printer sharing If your computer is connected to a LAN on which Windows computers are sharing files and printers, you can view those resources from Nautilus. Type smb: in the Open Location box (select File.Open Location to get there) to see available workgroups. Click a workgroup to see computers from that workgroup that are sharing files and printers. Figure 3-12 shows an example of Nautilus displaying icons representing Windows computers in a workgroup called estreet (smb://estreet). Figure 3-12: Display shared Windows file and printer servers (SMB) in Nautilus.

Web design seattle - 108 Part I . Linux First Steps Using

Tuesday, June 26th, 2007

108 Part I . Linux First Steps Using the Nautilus File Manager At one time, file managers did little more than let you run applications, create data files, and open folders. These days, as the information a user needs expands beyond the local system, file managers are expected to also display Web pages, access FTP sites, and play multimedia content. The Nautilus file manager, which is the default GNOME file manager, is an example of just such a file manager. When you open the Nautilus file manager window (from the GNOME main menu or by opening the Home icon or other folder on your desktop), you see the name of the location you are viewing (such as the folder name) and what that location contains (files, folders, and applications). Figure 3-11 is an example of the file manager window displaying the home directory of a user named chris (/home/chris). Figure 3-11: The Nautilus file manager enables you to move around the file system, open directories, launch applications, and open Samba folders. In GNOME 2.8, the default Nautilus window has been greatly simplified to show fewer controls and provide more space for file and directory icons. Double-click a folder to open that folder in a new window. Select your folder name in the lower-left corner of the window to see the file system hierarchy above the current folder (as shown in Figure 3-11). Whatever size, location, and other setting you had for the folder the last time you closed it, GNOME remembers and returns it to that state the next time you open it. To see more controls, right-click a folder and select Browse Folder to open it. Icons on the toolbar of the Nautilus window let you move forward and back among the directories and Web sites you visit. To move up the directory structure, click the up arrow. To refresh the view of the folder or Web page, click the Reload button. The Home button takes you to your home page, and the Computer button lets you see the same type of information you would see from a My Computer icon on a Windows system (CD drive, floppy drive, hard disk file systems, and network folders).

Chapter 3 . Getting into the Desktop 107 (Web space)

Tuesday, June 26th, 2007

Chapter 3 . Getting into the Desktop 107 Figure 3-10 shows a portion of the panel with an open drawer that includes icons for launching a Terminal window, the GIMP, and the Ethereal window. Figure 3-10: Add launchers or applets to a drawer on your GNOME panel. Changing Panel Properties Panel properties you can change are limited to the orientation, size, hiding policy, and background. To open the Panel Properties window that applies to a specific panel, right-click on an open space on the panel and choose Properties. The Panel Properties window that appears includes the following values: . Name Contains a name by which you identify this panel. . Orientation Move the panel to different locations on the screen by clicking on a new position. . Size Select the size of your panel by choosing its height in pixels (48 pixels by default). . Expand Click this check box to have the panel expand to fill the entire side, or unselect the check box to make the panel only as wide as the applets it contains. . AutoHide Select whether a panel is automatically hidden (appearing only when the mouse pointer is in the area). . Show Hide buttons Choose whether the Hide/Unhide buttons (with pixmap arrows on them) appear on the edges of the panel. . Arrows on hide buttons If you select Show Hide Buttons, you can choose to have arrows on those buttons. . Background From the Background tab, you can assign a color to the background of the panel, assign a pixmap image, or just leave the default (which is based on the current system theme). Click the Background Image check box if you want to select an Image for the background, and then select an image, such as a tile from /usr/share/backgrounds/tiles or other directory. I usually turn on the AutoHide feature and turn off the Hide buttons. Using AutoHide gives you more desktop space to work with. When you move your mouse to the edge where the panel is, the panel pops up so you don t need Hide buttons. Tip

106 Part I . Linux First Steps If (Web site layout)

Tuesday, June 26th, 2007

106 Part I . Linux First Steps If the application you want to launch is not on your red hat menu, you can build a launcher yourself as follows: 1. Right-click in an open space on the panel. 2. Select Add to Panel.Custom Application Launcher.Add. The Create Launcher window appears. 3. Provide the following information for the application that you want to add: Name A name to identify the application (this appears in the tool tip when your mouse is over the icon). Generic Name A name to identify the type of application. Comment A comment describing the application. It also appears when you later move your mouse over the launcher. Command The command line that is run when the application is launched. Use the full path name, plus any required options. Type Select Application (to launch an application). (Other selections include Link, to open a Web address in a browser, or FSDevice, to open a file system.) Run in Terminal Click this box if the application is a character-based or ncurses application. (Applications written using the curses library run in a Terminal window but offer screen-oriented mouse and keyboard controls.) 4. Click the Icon box (it might say No Icon). Select one of the icons shown and click OK. Alternatively, you can browse the Linux file system to choose an icon. Icons available to represent your application are contained in the /usr/share/ pixmaps directory. These icons are either in .png or .xpm formats. If there isn t an icon in the directory you want to use, create your own (in one of those two formats) and assign it to the application. 5. Click OK. The application should now appear in the panel. Click it to start the application. Adding a Drawer A drawer is an icon that you can click to display other icons representing menus, applets, and launchers; it behaves just like a panel. Essentially any item you can add to a panel you can add to a drawer. By adding a drawer to your GNOME panel, you can include several applets and launchers that together take up only the space of one icon. Click on the drawer to show the applets and launchers as though they were being pulled out of a drawer icon on the panel. To add a drawer to your panel, right-click the panel and select Add to Panel.Drawer. A drawer appears on the panel. Right-click it, and add applets or launchers to it as you would to a panel. Click the icon again to retract the drawer. Note

Chapter 3 . Getting into the Desktop 105 (Web design course)

Monday, June 25th, 2007

Chapter 3 . Getting into the Desktop 105 After an applet is installed, right-click it on the panel to see what options are available. For example, select Preferences for the stock ticker, and you can add or delete stocks whose prices you want to monitor. If you don t like the applet s location, right-click it, click Move, slide the mouse until the applet is where you want it (even to another panel), and click to set its location. If you no longer want an applet to appear on the panel, right-click it, and then click Remove From Panel. The icon representing the applet disappears. If you find that you have run out of room on your panel, you can add a new panel to another part of the screen, as described in the next section. Adding Another Panel You can have several panels on your GNOME desktop. You can add panels that run along the entire bottom, top, or side of the screen. To add a panel, do the following: 1. Right-click an open space in the panel so that the Panel menu appears. 2. Select New Panel. A new panel appears at the top of the screen. 3. Right-click an open space in the new panel and select Properties. 4. From the Panel Properties, select where you want the panel from the Orientation box (Top, Bottom, Left or Right). After you ve added a panel, you can add applets or application launchers to it as you did to the default panel. To remove a panel, right-click it and select Delete This Panel. Adding an Application Launcher Icons on your panel represent a Web browser and several office productivity applications. You can add your own icons to launch applications from the panel as well. To add a new application launcher to the panel, do the following: 1. Right-click in an open space on the panel. 2. Select Add to Panel.Application Launcher from the menu. All application categories from your main desktop menu (the one under the red hat or footprint icon) appear. 3. Select the arrow next to the category of application you want, and then select Add. An icon representing the application appears. To launch the application you just added, simply click the icon on the panel.