Fedora 6 and Red Hat Enterprise Linux Bible

The most important client Internet program these days is the Web browser. In Fedora and RHEL, you have several choices of Web browsers, including the following:

If you are working from a shell, there are several command-line utilities that allow you to browse the Web without a graphical interface. These include the links, w3m , and lynx commands.

Understanding Web Browsing

Although the Internet has been around since the 1960s, the Web is a relatively new technology (ushered in by the creation of the first Web browser in 1990). The Web places an additional framework over Internet addresses that were once limited to hostnames and domain names . Before the Web, finding resources on the Internet was difficult. However, the Web now provides several features that make it much easier to access these resources:

The primary tool for displaying HTML Web pages is the Web browser. Firefox is the featured Web browser in Fedora and RHEL systems. It can display HTML (Web pages) as well as other types of Web content. Now even file managers, made for displaying local files and folders, have been extended to be able to display Web content (see the description of Konqueror file manager in Chapter 3).

This section contains general information about the Web and some specific hints for using several different browsers (in particular, Firefox) to browse the Web from your Fedora or RHEL system.

Uniform Resource Locators

To visit a site on the Internet, you either type a URL into the location box on your browser or click a link (either on a Web page or from a menu or button on the browser). Although URLs are commonplace these days - you can find them on everything from business cards to cereal boxes - you may not know how URLs are constructed . The URL form is as follows :

protocol://host-domain/ path

The protocol identifies the kind of content that you are requesting. By far, the most common protocol you come across is Hypertext Transfer Protocol (HTTP). HTTP is the protocol used to request Web pages. In addition to HTTP, however, there are other protocols that might appear at the beginning of a Web address. Instead of showing you a Web page, these other types of protocols may display different kinds of information in your browser, or open a completely different application for working with the content.

Table 9-1 lists some of the protocols that can appear in a Web URL. (Some of these are no longer supported in modern browsers, as noted in the table.)

Table 9-1: Protocols in Web URLs

Open table as spreadsheet

Protocol Name

Description

http

Hypertext Transfer Protocol. Used to identify HTML Web pages and related content. The secure version is Hypertext Transfer Protocol over Secure Socket Layer ( https ).

file

Identifies a file on a specific host. Most often used to display a file from your local computer.

ftp

File Transfer Protocol. Identifies a location where there are file archives from which you might want to download files.

gopher

Gopher Protocol. Provides databases of text-based documents that are distributed across the Internet. (Gopher is nearly obsolete.)

mailto

Electronic Mail Address. Identifies an e-mail address, such as mailto: joe@example.com . (Usually opens a mail composer.)

news

USENET newsgroup. Identifies a newsgroup, such as news://news.myisp.com/comp.os.linux.networking . If you type this address into Mozilla Navigator, a window appears with the newsgroup displayed from the news server you identified. (In Firefox, news is not a registered protocol by default.)

nntp

USENET news using nntp protocol.

telnet

Log in to a remote computer and begin an interactive session. An example of a telnet address is telnet://localhost. (Replace localhost with any host or IP address that allows you to log in.)

wais

Wide Area Information Server protocol. A WAIS address might look like the following: wais://handsonhistory.com/waisdb . (Like gopher, WAIS databases are nearly obsolete.)

The first part of a URL is the protocol. You don't always have to type the protocol. Most browsers are good at guessing the content you are looking for (mostly they guess HTTP). If the address you type starts with www , the browser assumes HTTP; if it starts with ftp , it assumes FTP.

The second part of a URL takes you to the computer that is hosting the Web content. By convention, Web servers begin with www (or sometimes home ). However, if you type the correct protocol (usually http ), you will be directed to the right service at the host computer. The next piece of this name is just the host.domain style of Internet address that is always used with the Internet (such as redhat.com, linuxtoys.net , or whitehouse.gov ). An optional port number can be tacked on to the host.domain name. For example, to request the port used for HTTP services (port 80) from the host called www.linuxtoys.net , you can type http://www.linuxtoys.net:80 .

Tip 

You can identify a specific port number to request the service attached to the port on the computer you request. A port number is a lot like a telephone extension in a big company. A main telephone number (like the host.domain name) gets you to a company switchboard. The telephone extension (like the port number) connects you to the right person (like the service associated with a port).

The third part of a URL identifies the location of the content on the host computer. Sections in a Web page can be identified with a pound sign ( # ) and an identifier following the Web page location. For example, the craft section of the bsched.htm page at handsonhistory.com would appear as:

The filename extension (such as .htm or .html ) further identifies the content type.

Web Pages

If you look at the HTML source code that produces Web pages, you see that it consists of a combination of information and markup tags, all of which are in plain-text format. The idea is to have Web pages be very portable and flexible. You can create a Web page with vi, emacs, gedit, Notepad, or any text editor on any computing platform. Alternatively, simplified front-end programs can be used to provide WYSIWYG (What You See Is What You Get) interfaces that let you see what you are creating as you go.

HTML tags are set apart by right and left angle brackets. Tags come in pairs, with a beginning tag, the information, and then an ending tag. The beginning tag contains the tag name, while an ending tag contains a forward slash (/) and the tag name. Here is a minimal HTML page:

<HTML> <HEAD> <TITLE>Greetings from Wisconsin</TITLE> </HEAD> <BODY> Here we are in beautiful Madison. </BODY> </HTML>

You can see that the document begins and ends with HTML tags ( <HTML> and </HTML> ). The beginning part of the Web page is contained within the HEAD tags. The body of the page is contained within the BODY tags. The title of the page is set apart by TITLE tags.

Between the beginning and ending BODY tags, you can add all kinds of stuff. You can have different types of bulleted or numbered lists. You can have headings, images, and text. More complex pages can include forms, dynamic HTML (which changes the content as you move or select items), or special data. Figure 9-2 shows an example of a Web page as it appears in Firefox.

Figure 9-2: Many Web pages contain text, images, headings, and links.

Some of the HTML code that was used to create the Web page shown in Figure 9-2 is shown here. The title of the Web page appears between two TITLE tags:

<TITLE>Swan Bay Folk Art Center - American Crafts in Port Republic, NJ</TITLE>

The following code is used to create a link that opens a new mail message window:

<A HREF="mailto:webmaster@handsonhistory.com">Contact Us</A>;

The text Contact Us is a link to an e-mail address. When someone clicks that link, a new message window appears, allowing that person to send e-mail to that address.

<FONT FACE="Copperplate Gothic Bold"><A HREF="bsched.htm"> New Basket Class! </A></FONT>

A special font face was used for the words New Basket Class! , with the words pointing to a link to another HTML page. If someone were to click on those words, the bsched.htm page would appear.

Browsing the Web with Mozilla Firefox

With the Firefox Web browser (see Figure 9-3), the Mozilla project has gone directly after Microsoft Internet Explorer. Firefox is lightweight (so it performs fast), includes many ease-of-use features, and was built with security as a high priority. If you haven't switched to Fedora yet, you can get Firefox for Windows , Mac OS X, and other Linux systems. If you have the Fedora Core DVD that comes with this book, you can try Firefox out right now.

Figure 9-3: Firefox makes it easy to search, do tabbed browsing, and get plugins in a secure way.

Because Firefox is the default browser for the current Fedora and RHEL, if you have done an install that includes the desktop, Firefox should already be installed. (If it's not, you need to install the firefox package from the Fedora DVD.) To start Firefox from your Fedora desktop, either select the globe icon from your panel or select Internet Firefox Web Browser from the Applications menu.Firefox makes some of its best features available right in its main window (as shown in Figure 9-3). Here are some examples:

Some of the best features in Firefox are not as near the surface. In particular, Firefox was designed for safe computing, so Firefox is very careful about what it will and will not allow by default. Here are some important features of Firefox that can contribute to safe and fun Web browsing:

Figure 9-4: Firefox blocks pop-up windows, but lets you selectively allow or block pop-ups

Go to the Mozilla Firefox site ( www.mozilla.org/products/firefox ) for more information on Firefox. For help transitioning from Internet Explorer to Firefox, see the Firefox site at www.mozilla.org/products/firefox/switch.html .

Setting Up Firefox

There are many things you can do to configure Firefox to run like a champ. The following sections describe some ways to customize your browsing experience in Firefox.

Setting Navigator Preferences

You can set your Firefox preferences in the Preferences window. To open Firefox Preferences, click Edit Preferences. The Preferences window appears, as shown in Figure 9-5.

Figure 9-5: Change settings for navigating the Web from the Firefox Preferences window.

The following list shows some Navigator preferences that you might want to change from the Firefox Preferences window:

The Advanced Preferences tab can be used to fine-tune your Web browsing experience. Here are some Advanced Preferences that might interest you:

Extending Firefox

Firefox can handle most standard Web content (HTML, JPEG, text files) without any trouble. As with any browser, however, some content requires additions of plug-ins or helper applications to be able to play or display that content. Firefox also allows you to add extensions that let you enhance the features available in Firefox.

Using Plug-Ins

To find plug-ins that will work for Firefox in Linux systems, try the Mozilla Plugins page ( http://plugindoc.mozdev.org/linux.html ). Here are a few plug-ins that you will almost certainly want to add to Firefox:

For some plug-ins, you will be prompted for where you want to put the plug-in. You can either install them so they are available to all users on the system or only to the current user. To add a plug-in for the current user only, place it in the ~/.mozilla/plugins directory. To have the plug-in available for all users who run Firefox on the system, put the plug-in in the /usr/lib/firefox-*/plugins directory.

Note 

When Firefox doesn't have a plug-in assigned to handle a particular data type, a pop-up window asks if you want to use the default application from your desktop environment to handle the data. For GNOME, the /usr/share/applications/defaults.list file defines system-wide default applications. For your own desktop, you can change the defaults used to open a particular file type as follows: Open the Nautilus file manager; right-click on any file of the type you want to change; select Properties; select the Open With tab; and choose the application you want to use for that file type from the list. If the application you want to add is not on the list, click Add to add it to the list.

While plug-ins are available for playing select types of content, extensions can be used to add features to the browser itself.

Adding Extensions

To extend Firefox to handle content beyond what is delivered with Fedora or RHEL, start from the Mozilla.org Firefox product page ( www.mozilla.org/products/firefox ). From there, follow links to Firefox extensions. Here are some of the most popular extensions to Firefox that are available from Mozilla.org:

Note 

Some Firefox extensions have been known to cause performance problems with Firefox, primarily from using excessive amounts of memory. If you are having poor performance with Firefox, close all Firefox windows, then restart Firefox in safe mode from a Terminal window by typing the following:

firefox -safe-mode

Refer to http://kb.mozillazine.org/Safe_Mode for further information on using safe mode to debug firefox problems.

After you have installed an extension, you need to restart Firefox for it to take effect. In some cases, a change to an extension's option will also require you to restart Firefox.

If you want to uninstall an extension, change an extension's options, or get more extensions, select Tools Extensions from Firefox. The window that appears shows you a list of installed extensions and lets you change them. Select Get More Extensions to go directly to the Mozilla Firefox Extensions page.

Note 

On the Firefox Extensions page, look for the Firefox Extensions RSS feed. You can use that RSS feed to be notified when new Firefox extensions become available. As new versions of Extensions become available, you should install them since they might fix security issues.

Changing Firefox Themes

There are several themes available for Firefox for changing the look and feel of your Firefox window. From the Mozilla update site ( https://addons.mozilla.org ), select Firefox themes. When you download a theme for Firefox, it knows that it is a Firefox theme and, on the download window, it gives you the option to install the theme by clicking on the Use Theme button.

To change a theme later or get more Themes, select Tools Themes. After you have installed a new theme and selected it as your current theme, you need to restart Firefox for the new theme to take effect. From the dialog window, you can click on the "Get More Themes" link to download other themes. The link takes you to the Mozilla update site.

Securing Firefox

Security has been one of the strongest reasons for people switching to Firefox. By prohibiting the most unsafe types of content from playing in Firefox, and by warning you of potentially dangerous or annoying content before displaying it, Firefox has become the Web browser of choice for many security-conscious people. Here are some ways that Firefox helps make your Web browsing more secure:

Along with all the excellent security features built into Firefox, it's important that you incorporate good security practices in your Web browsing. Download and install software only from sites that are secure and known to you to be safe. For any online transactions, make sure you are communicating with a secure site (look for the https protocol in the location box and closed lock icon in the lower-right corner of the screen). Be careful about being redirected to another Web site when doing a financial transaction. An IP address in the site's address or misspellings on a screen where you enter credit card information are warning signs that you have been directed to an untrustworthy site.

Because new exploits are being discovered all the time, it's important that you keep your Web browser up to date. That means that, at least, you need to get updates of Firefox from the Fedora project as they become available (see Chapter 5 for information on using yum and up2date to get the latest software). To keep up on the latest security news and information about Firefox and other Mozilla products, refer to the Mozilla Security Center ( www.mozilla.org/security ).

Tips for Using Firefox

There are so many nice features in Firefox, it's hard to cover all of them. Just to point you toward a few more fun and useful features, here are some extra tips about Firefox you might enjoy:

There are many more things you can do with Firefox than I have covered in this chapter. If you have questions about Firefox features or you just want to dig up some more cool stuff about Firefox, I recommend checking out the MozillaZine forum for Firefox support ( http://forums.mozillazine.org/viewforum.php?f=38 ). There is a sticky link there to Miscellaneous Firefox Tips and a good FAQ post.

Using Text-Based Web Browsers

If you become a Linux administrator or power user, over time you will inevitably find yourself working on a computer from a remote login or where there is no desktop GUI available. At some point while you are in that state, you will probably want to check an HTML file or a Web page. To solve the problem, Fedora Core and RHEL include several text-based Web browsers.

With text-based Web browsers, any HTML file available from the Web, your local file system, or a computer where you're remotely logged in can be accessed from your shell. There's no need to fire up your GUI or read pages of HTML markup if you just want to take a peek at the contents of a Web page. Besides letting you call up Web pages, move around with those pages, and follow links to other pages, some of these text-based browsers even display graphics right in a Terminal window!

Which text-based browser you use is a matter of which you are more comfortable with. Browsers that are available include:

Note 

You must install the elinks package to get links, the lynx package to get lynx, and the w3m package to get w3m. All of them are included with Fedora Core.

The w3m command seems the most sophisticated of these browsers. It features a nice default font selection, seems to handle frames neatly, and its use of colors also makes it easy to use. The links browser lets you use the mouse to cut and paste text.

You can start any of these text-based Web browsers by giving it a filename, or if you have an active connection to the network, a Web address. For example, to read the w3m documentation (which is in HTML format) with a w3m browser, you can type the following from a Terminal window or other shell interface:

$ w3m /usr/share/doc/w3m-0*/doc/MANUAL.html

An HTML version of the W3M Manual is displayed. Or you can give w3m a URL to a Web page, such as the following:

$ w3m www.handsonhistory.com

After a page is open, you can begin viewing the page and moving around to links included in the page. Start by using the arrow keys to move around and select links. Use the Page Up and Page Down keys to page through text.

Категории