rhl50.htm
来自「linux的初学电子书」· HTM 代码 · 共 1,716 行 · 第 1/4 页
HTM
1,716 行
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Displays the version number.</FONT>
</TABLE><P>If you are using inetd to start your Web server software, you need to make a change to the etc/services file to permit the Web software. Add a line similar to this to the /etc/services file:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">http port/tcp</FONT></PRE>
<P>where port is the port number used by your Web server software (usually 80).
<BR>
<P>Next, modify the /etc/inetd.conf file to include the startup commands for the Web server where the last entry is the path to the httpd binary:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">httpd stream tcp nowait nobody /usr/web/httpd</FONT></PRE>
<P>Once this is done, restart inetd by killing and restarting the inetd process or by rebooting your system, and the service should be available through whatever port you specified in /etc/services.
<BR>
<P>If you are running the Web server software as a daemon, you can start it at any time from the command line with the command:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">httpd &</FONT></PRE>
<P>Even better, add the startup commands to the proper rc startup files. The entry usually looks like this:
<BR>
<PRE>
<FONT COLOR="#000080"># start httpd
if [ -x /usr/web/httpd ]
then
/usr/web/httpd
fi</FONT></PRE>
<P>substituting the proper paths for the httpd binary, of course. Rebooting your machine should start the Web server software on the default port number.
<BR>
<P>To test the Web server software, use any Web browser and type in the URL field:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">http://machinename</FONT></PRE>
<P>where machinename is the name of your Web server. If you see the contents of the root Web directory or the index.html file, all is well. Otherwise, check the log files and configuration files for clues as to the problem.
<BR>
<P>If you haven't installed a Web browser yet, you can still check to see if the Web server is running by using telnet. Issue a command like this, substituting the name of your server (and your Web port number if different than 80):
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">telnet www.wizard.tpci.com 80</FONT></PRE>
<P>You should get a message similar to this if the Web server is responding properly:
<BR>
<PRE>
<FONT COLOR="#000080">Connected to wizard.tpci.com
Escape character is '^]'.
HEAD/HTTP/1.0
HTTP/1.0 200 OK</FONT></PRE>
<P>You'll also see some more lines showing details about the date and content. You may not be able to access anything, but this shows that the Web software is responding properly.
<BR>
<BR>
<A NAME="E68E392"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Setting Up Your Web Site</B></FONT></CENTER></H3>
<BR>
<P>Having a server with nothing for content is useless, so you need to set up the information you will share through your Web system. This begins with Uniform Resource Locators (URLs), which are an address to file locations. Anyone using your service only
has to know the URL. You don't need to have anything fancy. If you don't have a special home page, anyone connecting to your system will get the contents of the Web root directory's index.html file, or failing that, a directory listing of the Web root
directory. That's pretty boring, though, and most users want fancy home pages. To write a home page, you need to use HTML (HyperText Markup Language).
<BR>
<P>A home page is like a main menu. Many users may not ever see it because they can enter into any of the subdirectories on your system, or obtain files from another Web system through a hyperlink, without ever seeing your home page. However, many users
want to start at the top, and that's where your home page comes in. A home page file is usually called index.html. It is usually at the top of your Web source directories.
<BR>
<P>Writing an HTML document is not too difficult. The language uses a set of tags to indicate how the text is to be treated (such as headlines, body text, figures, and so on). The tricky part of HTML is getting the tags in the right place, without extra
material on a line. HTML is rather strict about its syntax, so errors must be avoided to prevent problems.
<BR>
<P>In the early days of the Web, all documents were written with simple text editors. As the Web expanded, dedicated Web editors that understand HTML and the use of tags began to appear. Their popularity has driven developers to produce dozens of editors,
filters, and utilities—all aimed at making a Web documenter's life easier (as well as to ensure that the HTML language is properly used). There are HTML editors for many operating systems.
<BR>
<BR>
<A NAME="E69E516"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>HTML Authoring Tools</B></FONT></CENTER></H4>
<BR>
<P>You can write HTML documents in many ways: You can use an ASCII editor, a word processor, or a dedicated HTML tool. The choice of which method you use depends on personal preference and your confidence in HTML coding, as well as which tools you can
easily obtain. Because many HTML-specific tools have checking routines or filters to verify that your documents are correctly laid out and formatted, they can be appealing. They also tend to be more friendly than non-HTML editors. On the other hand, if you
are a veteran programmer or writer, you may want to stick with your favorite editor and use a filter or syntax checker afterward.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>One of the best sites to look for new editors and filters is <A HREF="tppmsgs/msgs1.htm#169" tppabs="http://www.ncsaa.uiuc.edu/SDG/Software/Mosaic/Docs/FAQ-Software.html">http://www.ncsaa.uiuc.edu/SDG/Software/Mosaic/Docs/FAQ-Software.html</A> which contains an up-to-date list of
offerings.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>You can use any ASCII editor to write HTML pages, including simple screen-oriented editors based on vi or emacs. They all enable you to enter tags into a page of text, but the tags are treated as words with no special meaning. There is no validity
checking performed by simple editors, because they simply don't understand HTML. There are some extensions for emacs and similar full-screen editors that provide a simple template check, but they are not rigorous in enforcing HTML styles.
<BR>
<P>If you wish to use a plain editor, you should carefully check your document for the valid use of tags. One of the easiest methods of checking a document is to import it into an HTML editor that has strong HTML tag checking. Another easy method is to
simply call up the document on your Web browser and carefully study its appearance.
<BR>
<P>You can obtain a dedicated HTML authoring package from some sites, although they are not as common for Linux as for DOS and Windows. If you are running both operating systems, you can always develop your HTML documents in Windows, and then import them
to Linux. There are several popular HTML tools for Windows, such as HTML Assistant, HTMLed, and HoTMetaL. A few of the WYSIWYG editors are also available for X, and hence run under Linux, such as HoTMetaL. Some HTML authoring tools are fully WYSIWYG, while
others are character-based. Most offer strong verification systems for generated HTML code.
<BR>
<P>An alternative to using a dedicated editor for HTML documents is to enhance an existing WYSIWYG word processor to handle HTML properly. The most commonly targeted word processor for these extensions is Word for Windows, WordPerfect, and Word for DOS.
Several extension products are available in varying degrees of complexity. Most run under Windows; although a few have been ported to Linux.
<BR>
<P>The advantage to using one of these extensions is that you retain a familiar editor and make use of the near-WYSIWYG features it can provide for HTML documents. Although it can't show you the final document in Web format, it can be close enough to
prevent all but the most minor problems.
<BR>
<P>CU_HTML is a template for Microsoft's Word for Windows that gives a very-near-to WYSIWYG view of HTML documents. Graphically, CU_HTML looks much the same as Word, but with a new toolbar and pull-down menu item. CU_HTML provides a number of different
styles and a toolbar of oft-used tasks. Tasks such as linking documents are easy, as are most tasks that tend to worry new HTML document writers. Dialog boxes are used for many tasks, simplifying the interface considerably.
<BR>
<P>The only major disadvantage to CU_HTML is that it can't be used to edit existing HTML documents if they are not in Word format. When CU_HTML creates an HTML document, there are two versions produced, one in HTML and the other as a Word DOC file. Without
both, the document can't be edited. An existing document can be imported, but it loses all the tags.
<BR>
<P>Like CU_HTML, ANT_HTML is an extension to Word. There are some advantages and disadvantages of ANT_HTML over CU_HTML. The documentation and help is better with ANT_HTML, and the toolbar is much better. It also has automatic insertion of opening and
closing tags as needed.
<BR>
<P>One system that has gained popularity among Linux users is tkWWW. tkWWW is a tool for the Tcl language and its Tk extension for X. tkWWW is a combination of a Web browser and a near-WYSIWYG HTML editor. Although originally UNIX based, tkWWW has been
ported to several other platforms, including Windows and Macintosh.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>tkWWW can be obtained through anonymous FTP to <A HREF="tppmsgs/msgs1.htm#170" tppabs="ftp://harbor.ecn.purdue.edu/">harbor.ecn.purdue.edu</A> in the directory /pub/tcl/extensions. Copies of Tcl and Tk can be found in several sites depending on the platform required, although most
distributions of Linux have Tcl and Tk included in the distribution set. As a starting point, try anonymous FTP to <A HREF="tppmsgs/msgs1.htm#171" tppabs="ftp://ftp.aud.alcatel.com/">ftp.aud.alcatel.com</A> in the directory tcl/extensions.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>When you create a Web page with tkWWW in editor mode, you can then flip modes to browser to see the same page properly formatted. In editor mode, most of the formatting is correct, but the tags are left visible. This makes for fast development of a Web
page.
<BR>
<P>Unfortunately, tkWWW must rely on Tk for its windowing, which tends to slow things down a bit on average processors. Also, the browser aspect of tkWWW is not impressive, using standard Tk frames. However, as a prototyping tool, tkWWW is very attractive,
especially if you know the Tcl language.
<BR>
<P>Another option is to use an HTML filter. HTML filters are tools that let you take a document produced with any kind of editor (including ASCII text editors) and convert the document to HTML. Filters are useful when you work in an editor that has its own
proprietary format, such as Word.
<BR>
<P>HTML filters are attractive if you want to continue working in your favorite editor and simply want a utility to convert your document with tags to HTML. Filters tend to be fast and easy to work with, because they take a filename as input and generate
an HTML output file. The degree of error checking and reporting varies with the tool.
<BR>
<P>There are filters available for most types of documents, many of which are available directly for Linux, or as source code that can be recompiled without modification under Linux. Word for Windows and Word for DOS documents can be converted to HTML with
the CU_HTML and ANT_HTML extensions mentioned earlier. A few stand-alone conversion utilities have also begun to appear. The utility WPTOHTML converts WordPerfect documents to HTML. WPTOHTML is a set of macros for WordPerfect versions 5.1 and 6.0. The
WordPerfect filter can also be used with other word processor formats that WordPerfect can import.
<BR>
<P>FrameMaker and FrameBuilder documents can be converted to HTML format with the tool FM2HTML. FM2HTML is a set of scripts that converts Frame documents to HTML, while preserving hypertext links and tables. It also handles GIF files without a problem.
Because Frame documents are platform independent, Frame documents developed on a PC or Macintosh could be moved to the Linux platform and FM2HTML executed there.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>A copy of FM2HTML is available by anonymous FTP from bang.nta.no in the directory /pub. The UNIX set is called fm2html.tar.v.0.n.m.Z.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>LaTeX and TeX files can be converted to HTML with several different utilities. There are quite a few Linux-based utilities available, including LATEXTOHTML, which can even handle inline LaTeX equations and links. For simpler documents, the utility
VULCANIZE is faster but can't handle mathematical equations. Both LATEXTOHTML and VULCANIZE are Perl scripts.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>LATEXTOHTML is available through anonymous FTP from <A HREF="tppmsgs/msgs1.htm#172" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/ftp.tex.ac.uk">ftp.tex.ac.uk</A> in the directory pub/archive/support as the file latextohtml. VULCANIZE can be obtained from the Web site <A
HREF="tppmsgs/msgs1.htm#173" tppabs="http://www.cis.upenn.edu/%7emjd/vulcanize.html">http://www.cis.upenn.edu/~mjd/vulcanize.html</A>.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>RTFTOHTML is a common utility for converting RTF format documents to HTML. Many word processors handle RTF formats, so an RTF document can be saved from your favorite word processor and then RTFTOHTML run to convert the files.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>RTFTOHTML is available through
<BR><A HREF="tppmsgs/msgs1.htm#174" tppabs="http://www.w3.org/hypertext/www/tools/rtftohtml-2.6.html">http:\\www.w3.org/hypertext/www/tools/rtftohtml-2.6.html</A>.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BR>
<A NAME="E69E517"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Maintaining HTML</B></FONT></CENTER></H4>
<BR>
<P>Once you have written a Web document and it is available to the world, your job doesn't end. Unless your document is a simple text file, you will have links to other documents or Web servers embedded. These links must be verified at regular intervals.
Also, the integrity of your Web pages should be checked at intervals, to ensure that the flow of the document from your home page is correct.
<BR>
<P>There are several utilities available to help you check links and also to scan the Web for other sites or documents you may want to provide a hyperlink to. These utilities tend to go by a number of names, such as robot, spider, or wanderer. They are all
programs that move across the Web automatically, creating a list of Web links that you can access. (Spiders are similar to the Archie and Veronica tools for the Internet, although neither of these cover the Web.)
<BR>
<P>Although they are often thought of as utilities for users only (to get a list of sites to try), spiders and their kin are useful for document authors, too, because they show potentially useful and interesting links. One of the best known spiders is the
World Wide Web Worm, or WWWW. WWWW enables you to search for keywords or create a Boolean search, and can cover titles, documents, and several other search types (including a search of all known HTML pages).
<BR>
<P>A similarly useful spider is WebCrawler, which is similar to WWWW except it can scan entire documents for matches of any keywords. It displays the result in an ordered list from closest match to least likely match.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE>A copy of World Wide Web Worm can be obtained from
<BR><A HREF="tppmsgs/msgs1.htm#175" tppabs="http://www.cs.colorado.edu/home/mcbryan/WWWW.html">http://www.cs.colorado.edu/home/mcbryan/WWWW.html</A>.
<BR>WebCrawler is available from
<BR><A HREF="tppmsgs/msgs1.htm#176" tppabs="http://www.biotech.washington.edu/WebCrawler/WebCrawler.html">http://www.biotech.washington.edu/WebCrawler/WebCrawler.html</A>.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>A common problem with HTML documents as they age is that links that point to files or servers may no longer exist (because either the locations or the documents have changed). It is therefore good practice to validate the hyperlinks in a document on a
regular basis. A popular hyperlink analyzer is HTML_ANALYZER. It examines each hyperlink and the contents of the hyperlink to ensure that they are consistent. HTML_ANALYZER functions by examining a document for all links, and then creating a text file that
has a list of the links in it. HTML_ANALYZER uses the text files to compare the actual link content to what it should be.
<BR>
<P>HTML_ANALYZER actually does three tests: It validates the availability of the documents pointed to by hyperlinks (called validation); it looks for hyperlink contents that occur in the database but are not themselves hyperlinks (called completeness); and
it looks for a one-to-one relation between hyperlinks and the contents of the hyperlink (called consistency). Any deviations are listed for the user.
<BR>
<P>HTML_ANALYZER users should have a good familiarity with HTML, their operating system, and the use of command-line driven analyzers. The tool must be compiled using the make utility prior to execution. There are several directories that must be created
prior to running HTML_ANALYZER, and when it runs, it creates several temporary fil<A NAME="I2"></A>es when that are not cleaned up, so this is not a good utility for a novice.
<BR>
<BR>
<A NAME="E68E393"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Summary</B></FONT></CENTER></H3>
<BR>
<P>Setting up your home page requires you to either use an HTML authoring tool or write HTML code directly into an editor. The HTML language is beyond the scope of this book, but you should find several good guides to HTML at your bookstore. HTML is rather
easy to learn. With the information in this chapter, you should be able to set up your Web site to enable anyone on the Internet to connect to you. Enjoy the Web!
<P ALIGN=LEFT>
<A HREF="rhl49.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl49.htm" TARGET="_self"><IMG SRC="purprev.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>
<A HREF="#I0" TARGET="_self"><IMG SRC="purtop.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purtop.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Page Top"></A>
<A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm" TARGET="_self"><IMG SRC="purtoc.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>
<A HREF="rhl51.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl51.htm" TARGET="_self"><IMG SRC="purnext.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>
</BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?