rhl50.htm

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

HTM
1,716 行
字号
</FONT>

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

Absolute path to the HTML document directory. Default is /usr/local/etc/httpd/htdocs.</FONT>

<TR>

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

FancyIndexing

</FONT>

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

Adds icons and filename information to the file list for indexing. Default is on. (This option is for backward compatibility with the first release of HTTP.)</FONT>

<TR>

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

HeaderName

</FONT>

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

The filename used at the top of a list of files being indexed. Default is Header.</FONT>

<TR>

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

IndexOptions

</FONT>

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

Indexing parameters (including FancyIndexing, IconsAreLinks, ScanHTMLTitles, SuppressLastModified, SuppressSize, and SuppressDescription).</FONT>

<TR>

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

ReadmeName

</FONT>

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

The footer file is displayed with directory indexes. Default is README.</FONT>

<TR>

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

Redirect

</FONT>

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

Maps a path to another URL.</FONT>

<TR>

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

ScriptAlias

</FONT>

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

Similar to Alias but for scripts.</FONT>

<TR>

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

UserDir

</FONT>

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

Directory users can use this for httpd access. Default is public_html. Usually set to a user's home page directory. Can be set to DISABLED.</FONT>

</TABLE><P>The third file to examine and modify is access.conf-dist, which defines the services available to WWW browsers. Usually, everything is accessible to a browser, but you may want to modify the file to tighten security or disable some services not 
supported on your Web site. The format of the conf-dist file is different than the two preceding configuration files. It uses a set of &quot;sectioning directives&quot; delineated by angle brackets. The general format of an entry is

<BR>

<PRE>

<FONT COLOR="#000080">&lt;Directory Dir_Name&gt;

...

&lt;/Directory&gt;</FONT></PRE>

<P>and anything between the beginning and ending delimiters (&lt;Directory&gt; and &lt;/Directory&gt;, respectively) are directives. It's not quite that easy, because there are several variations that can exist in the file. The best way to customize the 
access.conf-dist file is to follow these steps for a typical Web server installation:

<BR>

<OL>

<LI> Locate the Options directive and remove the Indexes option. This prevents users from browsing the httpd directory. Valid Options entries are discussed shortly.

<BR>

<BR>

<LI>Locate the first Directory directive and check the path to the cgi-bin directory. The default path is /usr/local/etc/httpd/cgi-bin.

<BR>

<BR>

<LI>Find the AllowOverride variable and set it to None (this prevents others from changing the settings). The default is All. Valid values for the AllowOverride variable are discussed shortly.

<BR>

<BR>

<LI>Find the Limit directive and set to whichever value you want.

<BR>

<BR>

</OL>

<P>The Limit directive controls access to your server. The following are valid values for the Limit directive:

<BR>

<UL>

<UL>

<P>allow Allows specific host names following the allow keyword to access the service.

<BR>

</UL></UL>

<UL>

<UL>

<P>deny Denies specific host names following the deny keyword from accessing the service.

<BR>

</UL></UL>

<UL>

<UL>

<P>order Specifies the order in which allow and deny directives are evaluated (usually set to deny,allow but can also be allow,deny).

<BR>

</UL></UL>

<UL>

<UL>

<P>require Requires authentication through a user file specified in the AuthUserFile entry.

<BR>

</UL></UL>

<P>The Options directive can have several entries, all of which have a different purpose. The default entry for Options is

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">Options Indexes FollowSymLinks</FONT></PRE>

<P>You removed the Indexes entry from the Options directive in the first step of the preceding customization procedure. These entries all apply to the directory the Options field appears in. The valid entries for the Options directive are:

<BR>



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

<TR>

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

All

</FONT>

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

All features enabled.</FONT>

<TR>

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

ExecCGI

</FONT>

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

cgi scripts can be executed from this directory.</FONT>

<TR>

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

FollowSymLinks

</FONT>

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

Allows httpd to follow symbolic links.</FONT>

<TR>

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

Includes

</FONT>

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

Include files for the server are enabled.</FONT>

<TR>

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

IncludesNoExec

</FONT>

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

Include files for the server are enabled but the exec option is disabled.</FONT>

<TR>

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

Indexes

</FONT>

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

Enables users to retrieve server-generated indexes (doesn't affect precompiled indexes).</FONT>

<TR>

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

None

</FONT>

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

No features enabled.</FONT>

<TR>

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

SymLinksIfOwnerMatch

</FONT>

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

Follows symbolic links only if the user ID of the symbolic link matches the user ID of the file.</FONT>

</TABLE><P>The AllowOverride variable is set to All by default, and this should be changed. There are several valid values for AllowOverride, but the recommended setting for most Linux systems is None. The valid values for AllowOverride are as follows:

<BR>



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

<TR>

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

All

</FONT>

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

Access controlled by a configuration file in each directory.</FONT>

<TR>

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

AuthConfig

</FONT>

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

Enables some authentication routines. Valid values: AuthName (sets authorization name of directory); AuthType (sets authorization type of the directory, although there is only one legal value: Basic); AuthUserFile (specifies a file containing user names 
and passwords); and AuthGroupFile (specifies a file containing group names).</FONT>

<TR>

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

FileInfo

</FONT>

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

Enables AddType and AddEncoding directives.</FONT>

<TR>

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

Limit

</FONT>

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

Enables Limit directive.</FONT>

<TR>

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

None

</FONT>

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

No access files allowed.</FONT>

<TR>

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

Options

</FONT>

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

Enables Options directive.</FONT>

</TABLE><P>After all that, the configuration files should be properly set. While the syntax is a little confusing, reading the default values shows you the proper format to use when changing entries. Next, you can start the Web server software.

<BR>

<BR>

<A NAME="E69E515"></A>

<H4 ALIGN=CENTER>

<CENTER>

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

<BR>

<P>With the configuration complete, it's time to try out the Web server software. In the configuration files, you made a decision as to whether the Web software will run as a daemon (stand-alone) or will start from inetd. The startup procedure is a little 
different for each method (as you would expect), but both startup procedures can use one of the following three options on the command line:

<BR>



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

<TR>

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

-d

</FONT>

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

The absolute path to the root directory of the server files (used only if the default location is not valid).</FONT>

<TR>

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

-f

</FONT>

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

The configuration file to read if not the default value of httpd.conf.</FONT>

<TR>

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

-v

⌨️ 快捷键说明

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