Linux All-in-One For Dummies, 5th Edition (2014)
Book IV. The Internet
Visit www.dummies.com/extras/linuxaio for great Dummies content online.
Contents at a Glance
Chapter 1: Browsing the Web
Chapter 2: Reading Newsgroups and RSS Feeds
Chapter 3: Using FTP
Chapter 4: Hosting Internet Services
Chapter 5: Managing Mail and News Servers
Chapter 6: Managing DNS
Chapter 1. Browsing the Web
In This Chapter
Discovering the web
Understanding a URL
Checking out web servers and web browsers
Taking stock of web browsers for Linux
Web browsing with Mozilla Firefox
I suspect you already know about the web or have been living under a rock for a number of years. However, did you know that the web (or more formally, the World Wide Web) made the Internet what it is today? The Internet’s been around for quite a while, but it didn’t reach the masses until the web came along in 1993.
Before the web was created, you had to use arcane Unix commands to download and use files, which was simply too complicated for most of us. With the web, however, anyone can enjoy the benefits of the Internet by using a web browser — a graphical application that downloads and displays web documents. A click of the mouse is all you need to go from reading a document from your company website to downloading a video clip from across the country.
In this chapter, I briefly describe the web and introduce Mozilla Firefox — the primary web browser (and, for that matter, mail and newsreader, too) in most Linux distributions.
There are many other web browsers available and some are included with various distributions, but after you’ve used one web browser, you can easily use any other web browser.
Discovering the Web
If you’ve used a file server at work, you know the convenience of sharing files. You can use the word processor on your desktop to get to any document on the shared server.
Now imagine a word processor that enables you to open and view a document that resides on any computer on the Internet. You can view the document in its full glory, with formatted text and graphics. If the document makes a reference to another document (possibly residing on yet another computer), you can open that linked document simply by clicking the reference. That kind of easy access to distributed documents is essentially what the web provides.
Of course, the documents have to be in a standard format so that any computer (with the appropriate web browser software) can access and interpret the document. And a standard protocol is necessary for transferring web documents from one system to another.
The standard web document format is HyperText Markup Language (HTML), and the standard protocol for exchanging web documents is HyperText Transfer Protocol (HTTP). HTML documents are text files and don’t depend on any specific operating system, so they work on any system from Windows and Mac to any type of Unix and Linux.
A web server is software that provides HTML documents to any client that makes the appropriate HTTP requests. A web browser is the client software that actually downloads an HTML document from a web server and displays the contents graphically.
Like a giant spider’s web
The web is the combination of the web servers and the documents (HTML) that the servers offer. When you look at the web in this way, the web is like a giant book whose pages are scattered throughout the Internet. You use a web browser running on your computer to view the pages — the pages are connected like a giant spider’s web, with the documents everywhere.
Imagine that the web pages — HTML documents — are linked by network connections that resemble a giant spider’s web, so you can see why the web is called the web. The World Wide part comes from the fact that the web pages are scattered around the world.
Links and URLs
Like the pages of printed books, web pages contain text and graphics. Unlike printed books, however, web pages can include multimedia, such as video clips, sound, and links to other web pages.
The links in a web page are references to other web pages that you can follow to go from one page to another. The web browser typically displays these links as underlined text (in a different color) or as images. Each link is like an instruction to you — something like “For more information, please consult Chapter 4,” as you might find in a book. In a web page, all you have to do is click the link; the web browser brings up the referenced page, even though that document may actually reside on a faraway computer somewhere on the Internet.
The links in a web page are referred to as hypertext links because when you click a link, the web browser jumps to the web page referenced by that link.
This arrangement brings up a question. In a printed book, you might ask the reader to go to a specific chapter or page in the book. How does a hypertext link indicate the location of the referenced web page? In the web, each web page has a special name, called a Uniform Resource Locator (URL). A URL uniquely specifies the location of a file on a computer. Figure 1-1 shows the parts of a URL.
Figure 1-1: The parts of a Uniform Resource Locator (URL).
As Figure 1-1 shows, a URL has the following parts:
· Protocol: Name of the protocol that the web browser uses to access the data from the file the URL specifies. In Figure 1-1, the protocol is http://, which means that the URL specifies the location of a web page. Here are some of the common protocol types and their meanings:
· file:// means the URL points to a local file. You can use this URL to view HTML files without having to connect to the Internet. For example, file:///var/www/html/index.html opens the file /var/www/html/index.htmlfrom your Linux system.
· ftp:// means that you can download a file using the File Transfer Protocol (FTP). For example, ftp://ftp.purdue.edu/pub/uns/NASA/nasa.jpg refers to the image file nasa.jpg from the /pub/uns/NASA directory of the FTP server ftp.purdue.edu. If you want to access a specific user account via FTP, use a URL in the following form:
· with username and password embedded in the URL.
· The password is in plain text and not secure.
· http:// means that you download the file using the HyperText Transfer Protocol (HTTP). This protocol is the well-known format of URLs for all websites, such as http://fedoraproject.org for the Fedora Project’s home page. If the URL doesn’t have a filename, the web server sends a default HTML file named index.html. (That’s the default filename for the popular Unix-based Apache web servers; Microsoft Windows web servers use a different default filename.)
· https:// specifies that you access the file through a Secure Sockets Layer (SSL) connection — a protocol designed by Netscape Communications for encrypted data transfers across the Internet. Typically, this form of URL is used when the web browser sends sensitive information (such as credit card number, username, and password) to a web server. For example, a URL such as
· may display an HTML form that requests credit card information and other personal information (such as name, address, and phone number).
· mailto: specifies an e-mail address that you can use to send an e-mail message. This URL opens your e-mail program, from which you can send the message. For example, mailto:firstname.lastname@example.org refers to the webmaster at the host someplace.com.
· news:// specifies a newsgroup that you can read by means of the Network News Transfer Protocol (NNTP). For example:
· accesses the comp.os.linux.setup newsgroup at the news server news.md.comcast.giganews.com. If you have a default news server configured for the web browser, you can omit the news server’s name and use the URLnews:comp.os.linux.setup to access the newsgroup.
· Domain name: Contains the fully qualified domain name of the computer that has the file this URL specifies. You can also provide an IP address in this field. The domain name is not case-sensitive.
· Port: Port number that is used by the protocol listed in the first part of the URL. This part of the URL is optional; all protocols have default ports. The default port for HTTP, for example, is 80. If a site configures the web server to listen to a different port, the URL has to include the port number.
· Directory path: Directory path of the file referred to in the URL. For web pages, this field is the directory path of the HTML file. The directory path is case-sensitive.
· Filename: Name of the file. For web pages, the filename typically ends with .htm or .html. If you omit the filename, the web server returns a default file (often named index.html). The filename is case-sensitive.
· HTML anchor: Optional part of the URL that makes the web browser jump to a specific location in the file. If this part starts with a question mark (?) instead of a pound sign(#), the browser takes the text following the question mark to be a query. The web server returns information based on such queries.
Web servers and web browsers
The web server serves up the web pages, and the web browser downloads them and displays them to the user. That’s pretty much the story with these two cooperating software packages that make the web work.
In a typical scenario, the user sits in front of a computer that’s connected to the Internet and runs a web browser. When the user clicks a link or types a URL into the web browser, the browser connects to the web server and requests a document from the server. The web server sends the document (usually in HTML format) and ends the connection. The web browser interprets and displays the HTML document with text, graphics, and multimedia (if applicable).
The web browser’s connection to the web server ends after the server sends the document. When the user browses through the downloaded document and clicks another hypertext link, the web browser again connects to the web server named in the hypertext link, downloads the document, ends the connection, and displays the new document. That’s how the user can move from one document to another with ease.
A web browser can do more than simply “talk” HTTP with the web server; web browsers can also download documents and files using FTP, and many have integrated mail and newsreaders as well.
Web Browsing in Linux
As web pages become more interactive and complex, web browsing turns into a stimulating, engaging experience. Also, there’s always the element of surprise: You can click a link and end up at unexpected web pages. Links are the most curious (and useful) aspect of the web. You can start at a page that shows today’s weather, and a click later, you can be reading this week’s issue of an online magazine.
Checking out web browsers for Linux
Many Linux distributions come with the Mozilla Firefox web browser. Firefox is Mozilla’s improvement on their original browser, an open source version of the venerable Netscape Communicator. Chrome, from Google, is popular as well — and commonly used today. Several others that you might run across, or consider using, are
· Epiphany: A GNOME web browser that uses parts of the Mozilla code to draw the web pages but has a simpler user interface than Mozilla.
· Konqueror: A KDE web browser that can also double as a file manager and a universal viewer.
In addition to dedicated browser applications such as these, many other applications are capable of downloading and displaying web pages.
If your distribution doesn’t install Firefox by default, you can easily install it by typing su - to become root and then typing apt-get install mozilla-firefox.
Introducing Firefox’s user interface
You can typically start Firefox by clicking an icon on the panel or by choosing Firefox from the GUI desktop’s menu.
When Firefox starts, it displays a browser window with a default home page. (The main web page on a web server is the home page.) You can configure Firefox to use a different web page as the default home page.
Figure 1-2 shows a web page from a U.S. government website (www.irs.gov), as well as the main elements of the Firefox browser window.
Figure 1-2: The Firefox web browser in action.
Firefox supports tabbed browsing, which means that you can open a new tab (by pressing Ctrl+T or clicking the plus sign to the right of the last open tab) and view a web page in that tab. That way you can view multiple web pages in a single window.
The Firefox web browser includes lots of features in its user interface, but you can master it easily. You can start with just the basics to get going with Firefox and then gradually expand to areas that you haven’t yet explored.
By default, the standard toolbar is hidden. When the cursor is moved to the upper right, however, the toolbar — and the options associated with the standard menus (File, Edit, and so forth) — appear. You can configure what appears here, but the following is standard.
To start with, here’s what you can do with the buttons and text boxes on the Navigation toolbar, from left to right:
· Back: Move to the previous web page.
· Forward: Move to the page from which you have gone backward.
· Recent Pages: Open a drop-down list of recently visited web pages.
· Reload: Reload the current web page.
· Stop: Stop loading the current page.
· Home: Go to the home page.
· Location: Show the URL of the current web page. (Type a URL in this box and press Enter to view that web page.)
· Bookmark: Bookmark the page you are currently viewing. (Click the star icon at the end of the location bar.)
· Search: Search various websites such as Google, Yahoo!, Amazon.com, Dictionary.com, and eBay. (Type text and press Enter to search the currently selected website; the default is Google.)
You can think of the bar along the bottom edge of the Firefox window as the status bar because the middle part of that area displays status information while Firefox loads a web page.
In the right corner of Firefox’s status bar, a security padlock icon appears when you access a secure website. Firefox supports a secure version of HTTP that uses SSL to transfer encrypted data between the browser and the web server. When Firefox connects to a web server that supports secure HTTP, a locked security padlock icon appears on the right edge of the status bar. Otherwise there’s no security padlock icon, an absence that signifies an insecure connection. The URL for secure HTTP transfers begins with https:// instead of the usual http://(note the extra s in https). You can click the padlock icon for more security information about the page.
Firefox displays status messages in the left part of the status bar. You can watch the messages in this area to see what’s going on. If you mouse over a link on the web page, the status bar displays the URL for that link.
I haven’t mentioned the Firefox menus much. That’s because you can usually get by without having to go to them. Nevertheless, taking a quick look through the Firefox menus is worthwhile so you know what each one offers. Table 1-1 gives you an overview of the Firefox menus.
Table 1-1 Firefox Menus
Enables You to Do the Following
Open a file or web location, open or close a tab, send a web page or link by e-mail, edit a web page, print the current page, import settings and data, and quit Firefox.
Copy and paste selections, find text in the current page, and edit your preferences.
Show or hide various toolbars, reload the current page, make the text larger or smaller, and view the HTML code for the page.
Go backward and forward in the list of pages you’ve visited, or jump to other recently visited web pages.
Bookmark a page, organize the bookmarks, and add links to the Bookmarks toolbar folder. (These links appear in the Bookmarks toolbar.)
Search the web and manage various aspects of the web page, such as themes; view information about the current page; and clear browsing history.
Get online help on Firefox.
Changing your home page
Your home page is the page that Firefox loads when you start it. The default home page depends on the distribution. Often the home page is a file from your system’s hard drive. Changing the home page is easy.
First, locate the page on the web that you want to be the home page. You can get to that page any way you want. You can search with a search engine to find the page you want, you can type in the URL in the Location text box, or you may even accidentally end up on a page that you want to make your home page. It doesn’t matter.
When you’re viewing the web page that you want to make your home page in Firefox, choose Edit⇒Preferences from the Firefox menu. The Preferences dialog box appears, as shown in Figure 1-3.
Figure 1-3: Configure the Firefox browser to suit your preferences.
In Figure 1-3, notice the Home Page text box. Below the text box is a Use Current Page button. Click that button to make the current page your home page. If you select this option while multiple tabs are open, the browser will open each tab with every new session.
You can set a lot of other options using the Preferences dialog box. Three sets of options worth noting are those that appear under Content (shown in Figure 1-4), Privacy (shown in Figure 1-5), and Security (shown in Figure 1-6).
Figure 1-4: You can block pop-ups beneath the Content configuration settings.
Figure 1-5: You can choose not to be tracked beneath the Privacy configuration settings.
Figure 1-6: Under the Security configuration settings, you can opt for notification each time a site tries to install an add-on.
Although I don’t explain all the options here, you can click around to explore everything that you can do from this window. For example, you can click the Use Bookmark button to select a saved URL bookmark as the home page. (You have to select the bookmark from a dialog box.)
Surfing the Internet with Firefox
Where you go from the home page depends on you. All you have to do is click and see where you end up. Move your mouse around. You know when you’re on a link because the mouse pointer changes to a hand with an extended index finger. Click the link, and Firefox downloads the web page referenced by that link.
How you use the web depends on what you want to do. When you first get started, you may explore a lot — browsing through websites and following links without any specific goal in mind (what you may call web window-shopping).
The other, more purposeful, use of the web is to find specific information from the Internet. For example, you might want to locate all the websites that contain documents with a specified keyword. For such searches, you can use one of many web search tools available on the Net. Firefox’s Search textbox takes you to the Google Web Search page (www.google.com).
A third type of use is a visit to a specific site with a known URL. For example, when reading about a particular topic in this book, you may come across a specific URL. In that case, you want to go directly to that web page.
If you want to surf the Internet with Firefox, all you need is a starting web page — then you can click whatever catches your fancy. For example, select the text in the Location text box in Firefox’s Navigation toolbar, type www.wiley.com, and then press Enter. You get to the Wiley home page that shows the various imprints (including the Dummies series) that Wiley publishes. There’s your starting point. All you have to do is click and you’re on your way.