⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lsg46.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 4 页
字号:






<BR>







<PRE>







<FONT COLOR="#000080">httpd stream tcp nowait nobody /usr/web/httpd</FONT></PRE>







<P>The last entry is the path to the httpd binary. Once this is done, restart inetd by killing 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 following 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>You should substitute 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 issue a command in the URL field like this:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">http://machinename</FONT></PRE>







<P>Replace machinename with 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 loaded a Web browser yet, you can still check whether the Web server is running by using telnet. Issue a command like this:







<BR>







<BR>







<PRE>







<FONT COLOR="#000080">telnet www.wizard.tpci.com 80</FONT></PRE>







<P>Substitute the name of your server (and your Web port number if different than 80). 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 should also get 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="E68E244"></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 search paths for data files. 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 any of the subdirectories on your system or obtain files from another Web system through a hyperlink, without ever seeing your home page. Many users, however, want to start at the top, and that's where your home page comes in. A home page file is usually called index.html (or home.html if an index file exists). It usually is 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 (and ensure that the HTML language is properly used). HTML editors are available for many operating systems.







<BR>







<BR>







<A NAME="E69E265"></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 you use depends on personal preference and your confidence in HTML coding, as well as which tools you can obtain easily. 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 afterwards.







<BR>







<P>One of the best sites to look for new editors and filters is CERN. Connect to http://info.cern.ch/WWW/Tools and check the document Overview.html. Also check the NCSA site, accessible at http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/Docs where the document faq-software.html contains an up-to-date list of offerings.







<BR>







<P>You can use any ASCII editor to write HTML pages, including simple line-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, as 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 want to use a plain editor, you should carefully check your document for valid use of tags. One of the easiest methods of checking a document is to import it into an HTML editor that has strong type 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, then import them to Linux. Several popular HTML tools for Windows are available, 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, and others are character-based. Most offer strong verification systems for generated HTML code.







<BR>







<P>For the latest Linux or Windows version of HoTMetaL, try the Web site: ftp://ftp.ncsa.uiuc.edu/Web/html/hotmetal.







<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 processors for these extensions are Word for Windows, WordPerfect, and Word for DOS. Several extension products are available, of 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 almost WYSIWYG view of HTML documents. CU_HTML is a template, meaning that it adds its own DLLs to Word to enhance the system. Graphically, it 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 often-used tasks. Tasks like 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 because they are not in Word format. When CU_HTML creates an HTML document, two versions are 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. ANT_HTML has some advantages and disadvantages over CU_HTML. The documentation and help are better with ANT_HTML, and the toolbar is much better. There's also automatic insertion of opening and closing tags as needed.







<BR>







<P>However, ANT_HTML requires that any inline GIF images be inserted instead of using a DLL. This means that you may have to hunt for a suitable filter. Also, like CU_HTML, ANT_HTML can't handle documents that were not produced with ANT_HTML.







<BR>







<P>One system that has gained popularity among Linux users is tkWWW. 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="ftp://ftp.aud.alcatel.com">ftp.aud.alcatel.com</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 versions of Linux have Tcl and Tk included in the distribution set. As a starting point, try anonymous FTP to <A HREF="ftp://ftp.cs.berkeley.edu">ftp.cs.berkeley.edu</A> in the directory /ucb/tcl.</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. An HTML filter is a tool that lets 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 or nroff.







<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>Filters are 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, 5.2, 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 a Linux platform and FM2HTML executed there.







<BR>







<BLOCKQUOTE>







<BLOCKQUOTE>







<HR ALIGN=CENTER>







<BR>







<NOTE>A copy of FM2HTML is available by anonymous FTP from <A HREF="ftp://bang.nta.no">bang.nta.no</A> in the directory /pub. The UNIX set is called fm2-html.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. Quite a few Linux-based utilities are available, including LATEXTOHTML, which can even handle in-line 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="ftp://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 TARGET="resource window" HREF="http://www.cis.upenn.edu">http://www.cis.upenn.edu</A> in the directory mjd as the file vulcanize.html.</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 you can save an RTF document from your favorite word processor and then run RTFTOHTML against it.







<BR>







<BLOCKQUOTE>







<BLOCKQUOTE>







<HR ALIGN=CENTER>







<BR>







<NOTE>RTFTOHTML is available through anonymous FTP from <A HREF="ftp://ftp.cray.com">ftp.cray.com</A> in the directory src/WWWstuff/RTF. Through the Web, try <A TARGET="resource window" HREF="http://info.cern.ch/hypertext/WWW/Tools">http://info.cern.ch/hypertext/WWW/Tools</A> and look for the file rtftoftml-2.6.html (or a later version).</NOTE>







<BR>







<HR ALIGN=CENTER>







</BLOCKQUOTE></BLOCKQUOTE>







<BR>







<A NAME="E69E266"></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. You must verify these links 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>Several utilities are available to help you check links and 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 moves 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 though of as utilities for users only (to get a list of sites to try), spiders and their kin are useful for document authors, too, as 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 it 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 that it can scan entire documents for matches of any keywords and display the result in an ordered list from closest match to least match.







<BR>







<BLOCKQUOTE>







<BLOCKQUOTE>







<HR ALIGN=CENTER>







<BR>







<NOTE>A copy of World Wide Web Worm can be obtained from <A TARGET="resource window" HREF="http://www.cs.colorado.edu/home/mcbryan/WWWW.html">http://www.cs.colorado.edu/home/mcbryan/WWWW.html</A>. WebCrawler is available from <A TARGET="resource window" HREF="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 (either because the locations or documents have changed). Therefore, it is 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 to all links, 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 &quot;make&quot; utility prior to execution. There are several directories that must be created prior to running HTML_ANALYZER, and it creates several temporary files when it runs that are not cleaned up, so this is not a good utility for a novice.







<BR>







<BR>







<A NAME="E68E245"></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!<A NAME="I2"></A>







<P ALIGN=LEFT>























































</td>
</tr>
</table>

<!-- begin footer information -->



</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -