rhl50.htm

来自「linux的初学电子书」· HTM 代码 · 共 1,716 行 · 第 1/4 页

HTM
1,716
字号
<HTML>

<HEAD>

<TITLE>Red Hat Linux Unleashed rhl50.htm </TITLE>

<LINK REL="ToC" HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm">

<LINK REL="Index" HREF="htindex.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/htindex.htm">

<LINK REL="Next" HREF="rhl51.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl51.htm">

<LINK REL="Previous" HREF="rhl49.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl49.htm"></HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">

<A NAME="I0"></A>

<H2>Red Hat Linux Unleashed rhl50.htm</H2>

<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="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>


<HR ALIGN=CENTER>

<P>

<UL>

<UL>

<UL>

<LI>

<A HREF="#E68E391" >Web Server Software</A>

<UL>

<LI>

<A HREF="#E69E512" >Unpacking the Web Files</A>

<LI>

<A HREF="#E69E513" >Compiling the Web Software</A>

<LI>

<A HREF="#E69E514" >Configuring the Web Software</A>

<LI>

<A HREF="#E69E515" >Starting the Web Software</A></UL>

<LI>

<A HREF="#E68E392" >Setting Up Your Web Site</A>

<UL>

<LI>

<A HREF="#E69E516" >HTML Authoring Tools</A>

<LI>

<A HREF="#E69E517" >Maintaining HTML</A></UL>

<LI>

<A HREF="#E68E393" >Summary</A></UL></UL></UL>

<HR ALIGN=CENTER>

<A NAME="E66E50"></A>

<H1 ALIGN=CENTER>

<CENTER>

<FONT SIZE=6 COLOR="#FF0000"><B>50</B></FONT></CENTER></H1>

<BR>

<A NAME="E67E50"></A>

<H2 ALIGN=CENTER>

<CENTER>

<FONT SIZE=6 COLOR="#FF0000"><B>Configuring a WWW Site</B></FONT></CENTER></H2>

<BR>

<P>Just about everyone on the planet knows about the World Wide Web. It's the most talked about aspect of the Internet. With the Web's popularity, more system users are getting into the game by setting up their own WWW servers and home pages. There are now 
sophisticated packages that act as Web servers for many operating systems. Linux, based on UNIX, has the software necessary to provide a Web server.

<BR>

<P>You don't need fancy software to set up a Web site, only a little time and the correct configuration information. That's what this chapter is about. We look at how you can set up a World Wide Web server on your Linux system&#151;whether for friends, 
your LAN, or the Internet as a whole.

<BR>

<P>The major aspect of the Web that attracts users and makes it so powerful, aside from its multimedia capabilities, is the use of hyperlinks. A hyperlink lets one mouse click move you from document to document, site to site, graphic to movie, and so on. 
All the instructions of the move are built into the Web code.

<BR>

<P>There are two main aspects to the World Wide Web: server and client. Client software, such as Mosaic and Netscape, is probably the most familiar. However, many different Web client packages other than these two are also available, some specifically for 
X or Linux.

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>The Red Hat distribution that accompanies this book already includes the Apache Web server software that is preconfigured on your Linux system during the installation process. However, this chapter provides an overview on manually setting up server 
software so that you can become more familiar with generic httpd server configurations.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BR>

<A NAME="E68E391"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Web Server Software</B></FONT></CENTER></H3>

<BR>

<P>There are three primary versions of Web server software that will run under Linux. They are from NCSA, CERN, and Plexus. The most readily available system is from NCSA, which also produces Mosaic. NCSA's Web system is fast and quite small, can run under 
inetd or as a stand-alone daemon, and provides pretty good security. For this chapter, we will use NCSA's Web software, although you can easily use either of the other two packages instead (although the configuration information will be different, of 
course).

<BR>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>The Web server software for one of the three is available via anonymous FTP or WWW from one of the sites listed here, depending on the type of server software you want: 

<BR>ERN: <A HREF="tppmsgs/msgs1.htm#165" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/httpd">ftp//ftp.w3.org/pub/httpd</A> (FTP)

<BR>NCSA: <A HREF="tppmsgs/msgs1.htm#166" tppabs="ftp://ftp.ncsa.uiuc.edu/web/httpd/unix/ncsa_httpd">ftp.ncsa.uiuc.edu/web/httpd/unix/ncsa_httpd</A> (FTP)

<BR><A HREF="tppmsgs/msgs1.htm#167" tppabs="http://hoohoo.ncsa.uiuc.edu/">http://hoohoo.ncsa.uiuc.edu</A> (WWW)

<BR>Plexus: <A HREF="tppmsgs/msgs1.htm#168" tppabs="ftp://austin.bsdi.com/plexus/2.2.1/dist/Plexus-2.2.1.tar.Z">ftp://austin.bsdi.com/plexus/2.2.1/dist/Plexus-2.2.1.tar.Z</A> (WWW).</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<P>The NCSA Web software is available for Linux in both compiled and source code forms. Using the compiled version is much easier because you don't have to configure and compile the source code for the Linux platform. The binaries are often provided 
compressed and tarred, so you will have to uncompress and then extract the tar library. Alternatively, many CD-ROMs provide the software ready to go. If you do obtain the compressed form of the Web server software, follow the installation or README files 
to place the Web software in the proper location.

<BR>

<BR>

<A NAME="E69E512"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Unpacking the Web Files</B></FONT></CENTER></H4>

<BR>

<P>If you have obtained a library of source code or binaries from an FTP or BBS site, you probably have to untar and uncompress them first. (Check with any README files, if there are any, before you do this; otherwise you may be doing this step for 
nothing.) Usually, you will proceed by creating a directory for the Web software, and then changing into it and expanding the library with a command such as this:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">zcat httpd_X.X_XXX.tar.Z | tar xvf -</FONT></PRE>

<P>The software is often named by the release and target platform, such as httpd_1.5_linux.tar.Z. Use whatever name your tar file has in the preceding line. Installation instructions are sometimes in a separate tar file, such as Install.tar.z, which you 
have to obtain and uncompress with the command:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">zcat Install.tar.z</FONT></PRE>

<P>Make sure you are in the target directory when you issue these commands, though, or you will have to move a lot of files. You can place the files anywhere; however, it is often a good idea to create a special area for the Web software that can have its 
permissions controlled, such as /usr/web, var/web, or a similar name.

<BR>

<P>Once you have extracted the contents of the Web server distribution and the library files are in their proper directories, you can look at what has been created automatically. You should find the following subdirectories:

<BR>



<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

cgi-bin

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Common gateway interface binaries and scripts</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

conf

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Configuration files</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

icons

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Icons for home pages</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

src

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Source code and (sometimes) executables</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

support

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Support applications</FONT>

</TABLE><BR>

<A NAME="E69E513"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Compiling the Web Software</B></FONT></CENTER></H4>

<BR>

<P>If you don't have to modify the source and recompile for Linux (because your software is the Linux version), you can skip the configuration details mentioned in the rest of this section. On the other hand, you may want to know what is happening in the 
source code anyway, because you can better understand how Linux works with the Web server code. If you obtained a generic, untailored version of the NCSA Web server, you have to configure the software.

<BR>

<P>Begin by editing the src/Makefile file to specify your platform. There are several variables that you have to check for proper information:

<BR>



<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

AUX_CFLAGS

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Uncomment the entry for Linux (identified by comment lines and symbols, usually).</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

CC

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

The name of the C compiler (usually cc or gcc).</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

EXTRA_LIBS

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Add any extra libraries that need to be linked in (none are required or Linux).</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

FLAGS

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Add any flags you need for linking (none are required for most Linux linkers).</FONT>

</TABLE><P>Finally, look for the CFLAGS variable. Some of the values for CFLAGS may be set already. The following are valid values for CFLAGS:

<BR>



<TABLE  BORDERCOLOR=#000040 BORDER=1 CELLSPACING=2 WIDTH="100%" CELLPADDING=2 >

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

-DSECURE_LOGS

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Prevents CGI scripts from interfering with any log files written by the server software.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

-DMAXIMUM_DNS

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Provides a more secure resolution system at the cost of performance.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

-DMINIMAL_DNS

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Doesn't allow reverse name resolution, but speeds up performance.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

-DNO_PASS

</FONT>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

Prevents multiple children from being spawned.</FONT>

<TR>

<TD VALIGN=top  BGCOLOR=#80FFFF ><FONT COLOR=#000080>

-DPEM_AUTH

</FONT>

⌨️ 快捷键说明

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