Archive for April, 2007

118 Part I . Linux First Steps . (Hosting your own web site)

Friday, April 20th, 2007

118 Part I . Linux First Steps . Screen resolution The last major piece of information you may want to add is the screen resolution and color depth. There will be a screen resolution associated with each video card installed on your computer. The Screen section defines default color depths (such as 8, 16, or 24) and modes (such as 1024×768, 800×600, or 640×480). Set the DefaultDepth to the number of bits representing color depth for your system, and then add a Modes line to set the screen resolution. To read more about how to set options in your xorg.conf file, type man xorg.conf. If your X server is XFree86, type man XF86Config. Choosing a Window Manager Fully integrated desktop environments have become somewhat unfriendly to changing out window managers. However, you can completely bypass KDE or GNOME, if you like, and start your desktop simply with X and a window manager of your choice. Although I m using Slackware as the reference distribution for describing how to change window managers, the concept is the same on other Linux systems. In general, if no desktop environment is running in Linux, you can start it by typing: $ startx This command starts up your desktop environment or window manager, depending on how your system is configured. Although a variety of configuration files are read and commands are run, essentially which desktop you get depends on the contents of two files: . /etc/X11/xinit/xinitrc If a user doesn t specifically request a particular desktop environment or window manager, the default desktop settings will come from the contents of this file. The xinitrc file is the system-wide X configuration file. Different Linux systems use different xinitrc files. . $HOME/.xinitrc The .xinitrc file is used to let individual users set up their own desktop startup information. Any user can add a .xinitrc file to his or her own home directory. The result is that the contents of that file will override any system-wide settings. If you do create your own .xinitrc file, it should have as its last line exec windowmanager, where windowmanager is the name of your window manager; for example: exec /usr/X1R6/bin/blackbox Slackware has at least seven different window managers from which you can choose, making it a good place to try out a few. It also includes a tool called xwmconfig, which lets you change the window manager system-wide (in the /etc/X11/xinit/xinitrc file). To use that tool, as the root user simply type xwmconfig from any shell on a Slackware system. Figure 3-15 shows an example of that screen.
Note: If you are looking for cheap and reliable webhost to host and run your web application check Vision coldfusion web hosting services

Chapter 3 . Getting (Database web hosting) into the Desktop 117

Friday, April 20th, 2007

Chapter 3 . Getting into the Desktop 117 Your mouse might be connected in a different way (such as a bus or serial mouse) or may have different buttons to enable. Tools for configuring your mouse are distribution-specific. Try mouseconfig, mouseadmin, or systemconfig- mouse to reconfigure your mouse from the command line. . Monitor The monitor section defines attributes of your monitor. There are generic settings you can use if you don t exactly know the model of your monitor. Changing the Horizontal Sync and Vertical Refresh rates without checking your monitor s technical specifications is not recommended; you could damage the monitor. Here s an example of an entry that will work on many LCD panels: Section Monitor Identifier Monitor0 VendorName Monitor Vendor ModelName LCD Panel 1024×768 HorizSync 31.5 - 48.5 VertRefresh 40.0 - 70.0 EndSection Here s an entry for a generic CRT monitor that will work on many CRTs: Section Monitor Identifier Monitor0 VendorName Monitor Vendor ModelName Generic Monitor, 1280×1024 @ 74 Hz HorizSync 31.5 - 79.0 VertRefresh 50.0 - 90.0 EndSection If there is a tool available to select your monitor model directly, that would be the best way to go. For example, in Red Hat systems, you would run systemconfig- xfree86 to change monitor settings. . Video device The Device section is where you identify the driver to use with your video driver and any options to use with it. It s important to get this section right. The Xorg command described earlier usually does a good job detecting the driver. If you want to change to a different one, this is where to do so. Here s an example of the Device section after I added a video driver from NVIDIA to my system (the driver name is nv): Section Device Identifier Card0 Driver nv VendorName nVidia Corporation BoardName Unknown Board BusID PCI:1:0:0 EndSection
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision make web site services

116 Part I . Linux First (Web host) Steps Getting

Friday, April 20th, 2007

116 Part I . Linux First Steps Getting New X Drivers Working video drivers are available with most video cards you can purchase today. However, to get some advanced features from your video cards (such as 3D acceleration) you may need to get proprietary drivers directly from the video manufacturers. In particular, you may want to get drivers from NVIDIA and ATI. To get new drivers for video cards or chipsets from NVIDIA, go to the NVIDIA site (www.nvidia.com) and select the Download Drivers button. Follow the link to Linux and FreeBSD drivers. Links from the page that appears will take you to a Web page from which you can download the new driver and get instructions for installing it. For ATI video cards and chipsets, go to www.ati.com and select Drivers & Software. Follow the links to Linux drivers and related installation instructions. Tuning Up Your X Configuration File The xorg.conf file might look a bit complicated when you first start working with it. However, chances are that there are only a few key elements you will need to change in it. As root user, open the /etc/X11/xorg.conf file in any text editor. Here are some things you can look for: . Mouse Look for an InputDevice section with a Mouse0 or Mouse1 identifier. That section for a simple two-button, PS2 mouse might look as follows: Section InputDevice Identifier Mouse0 Driver mouse Option Protocol PS/2 Option Device /dev/psaux EndSection If you are unable to use some feature of the mouse, such as a middle wheel, you might be able to get it working with an entry that looks more like the following: Section InputDevice Identifier Mouse0 Driver mouse Option Protocol IMPS/2 Option Device /dev/psaux Option ZAxisMapping 4 5 EndSection Don t change the mouse identifier, but you can change the protocol and add the ZAxisMapping line to enable your wheel mouse. Try restarting X and trying your mouse wheel on something like a Web page to see if you can scroll up and down with it.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision web and email hosting services

Chapter 3 . Getting into the Desktop 115 (Web site domain)

Thursday, April 19th, 2007

Chapter 3 . Getting into the Desktop 115 It s possible that you already did some configuration when you installed Linux. If you are able to start a desktop successfully and your mouse, keyboard, and screen all seem to be behaving, you may not have to do anything more to configure X. However, if you can t start the desktop or you want to adjust some basic features (such as screen resolution or number of colors supported), let s look at some ideas on how to go about doing those things. Creating a Working X Configuration File If your desktop crashes immediately or only shows garbled text, try to create a new X configuration file. With the X.org X server, that file is /etc/X11/xorg.conf. In XFree86, the configuration file, which has basically the same format, is /etc/X11/XF86Config. To have X try to create a sane xorg.conf file for you to use, do the following from a Terminal window as root user: 1. If Linux booted to a command prompt, go to the next step. However, if it tried to start X automatically, you might have an illegible screen. In that case, press these keys together: Ctrl+Alt+Backspace. It should kill your X server and get you back to a command prompt. If X tries to restart (and is still messed up), press Ctrl+Alt+F2. When you see the command prompt, log in as root and type init 3. This will temporarily bring you down to a nongraphical state. 2. To have X probe your video hardware and create a new configuration file, type: # Xorg -configure 3. The file x.org.conf.new should appear in your home directory. To test if this new configuration file works, type the following to start the X server: # X -xf86config /root/xorg.conf.new A gray background with an X in the middle should appear. Move the mouse to move the X pointer. If that succeeds, you have a working xorg.conf file to use. 4. Press Ctrl+Alt+Backspace to exit the X server. 5. Copy the new configuration file to where it is picked up the next time X starts. # cp /root/xorg.conf.new /etc/X11/xorg.conf Chances are that you have a very basic X configuration that you may want to tune further. Note
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services

X web hosting - 114 Part I . Linux First Steps Configuring

Thursday, April 19th, 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
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision tomcat hosting services

Chapter 3 . Getting into the Desktop 113 (Photoshop web design)

Wednesday, April 18th, 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
Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp web hosting services

112 Part I . Linux (Web page design) First Steps extension

Wednesday, April 18th, 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
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision php5 hosting services

Chapter 3 . Getting (Jetty web server) into the Desktop 111

Tuesday, April 17th, 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
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision j2ee hosting services

110 Part I . Linux First Steps . (Photo web hosting)

Tuesday, April 17th, 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.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision best web hosting services

Chapter 3 . Getting into the Desktop (Photography web hosting) 109

Monday, April 16th, 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.
Note: In case you are looking for affordable and reliable webhost to host and run your business application check Vision php5 hosting services