📄 options.html
字号:
proceeds as usual.
<P>
If you leave this undefined then thttpd will not implement authentication
at all and will not check for auth files, which saves a bit of CPU time.
<P>
A typical value is ".htpasswd".
<H4><A NAME="DEFAULT_CHARSET">DEFAULT_CHARSET</A></H4>
<P>
The default character set name to use with text MIME types.
This gets substituted into the MIME types where they have a "%s".
<P>
You can override this in the config file with the "charset" setting,
or on the command like with the -T flag.
<P>
A typical value is "iso-8859-1".
<H4><A NAME="SERVER_NAME">SERVER_NAME</A> and <A NAME="SERVER_NAME_LIST">SERVER_NAME_LIST</A></H4>
<P>
This controls the SERVER_NAME environment variable that gets
passed to CGI programs. By default thttpd does a gethostname(), which
gives the host's canonical name. If you want to always use some other name
you can define it here.
<P>
Alternately, if you want to run the same thttpd binary on multiple
machines, and want to build in alternate names for some or all of
them, you can define a list of canonical name to altername name
mappings. thttpd seatches the list and when it finds a match on
the canonical name, that alternate name gets used. If no match
is found, the canonical name gets used.
<P>
If both SERVER_NAME and SERVER_NAME_LIST are defined here, thttpd searches
the list as above, and if no match is found then SERVER_NAME gets used.
<P>
In any case, if thttpd is started with the -h flag, that name always
gets used.
<H4><A NAME="SHOW_SERVER_VERSION">SHOW_SERVER_VERSION</A></H4>
<P>
Undefine this if you want thttpd to hide its specific version
when returning into to browsers. Instead it'll just say "thttpd" with
no version.
<H4><A NAME="ALWAYS_CHROOT">ALWAYS_CHROOT</A></H4>
<P>
Define this if you want to always chroot(), without having
to give the -r command line flag. Some people like this as a security
measure, to prevent inadvertant exposure by accidentally running without -r.
You can still disable it at runtime with the -nor flag.
<H4><A NAME="ALWAYS_VHOST">ALWAYS_VHOST</A></H4>
<P>
Define this if you want to always do virtual hosting, without
having to give the -v command line flag. You can still disable it at
runtime with the -nov flag.
<H4><A NAME="VHOST_DIRLEVELS">VHOST_DIRLEVELS</A></H4>
<P>
If you're using the vhost feature and you have a LOT of
virtual hostnames (like, hundreds or thousands), you will want to
enable this feature. It avoids a problem with most Unix filesystems,
where if there are a whole lot of items in a directory then name lookup
becomes very slow. This feature makes thttpd use subdirectories
based on the first characters of each hostname. You can set it to use
from one to three characters. If the hostname starts with "www.", that
part is skipped over. Here are some examples of how hostnames would
get turned into directory paths, for each different setting:
<BLOCKQUOTE><PRE>
1: www.acme.com -> a/www.acme.com
1: backup.acme.com -> b/backup.acme.com
2: www.acme.com -> a/c/www.acme.com
2: backup.acme.com -> b/a/backup.acme.com
3: www.acme.com -> a/c/m/www.acme.com
3: backup.acme.com -> b/a/c/backup.acme.com
</PRE></BLOCKQUOTE>
Note that if you compile this setting in but then forget to set up
the corresponding subdirectories, the only error indication you'll
get is a "404 Not Found" when you try to visit a site. So be careful.
<H4><A NAME="DEFAULT_USER">DEFAULT_USER</A></H4>
<P>
When started as root, the default username to switch to after
initializing. If this user (or the one specified by the -u flag)
does not exist, the program will refuse to run.
A typical values is "nobody".
<H4><A NAME="USE_USER_DIR">USE_USER_DIR</A></H4>
<P>
When started as root, the program can automatically chdir()
to the home directory of the user specified by -u or <A HREF="#DEFAULT_USER">DEFAULT_USER</A>.
An explicit -d still overrides this.
<H4><A NAME="EXPLICIT_ERROR_PAGES">EXPLICIT_ERROR_PAGES</A></H4>
<P>
If this is defined, some of the built-in error pages will
have more explicit information about exactly what the problem is.
Some sysadmins don't like this, for security reasons.
<H4><A NAME="ERR_DIR">ERR_DIR</A></H4>
<P>
Subdirectory for custom error pages. The error filenames are
$WEBDIR/$ERR_DIR/err%d.html - if virtual hosting is enabled then
$WEBDIR/hostname/$ERR_DIR/err%d.html is searched first. This allows
different custom error pages for each virtual hosting web server. If
no custom page for a given error can be found, the built-in error page
is generated. If ERR_DIR is not defined at all, only the built-in error
pages will be generated.
<H4><A NAME="ERR_APPEND_SERVER_INFO">ERR_APPEND_SERVER_INFO</A></H4>
<P>
Define this if you want a standard HTML tail containing
$SERVER_SOFTWARE and $SERVER_ADDRESS to be appended to the custom error
pages. (It is always appended to the built-in error pages.)
<H4><A NAME="CGI_NICE">CGI_NICE</A></H4>
<P>
nice(2) value to use for CGI programs. If this is left
undefined, CGI programs run at normal priority.
A typical value, if defined, is 10.
<H4><A NAME="CGI_PATH">CGI_PATH</A></H4>
$PATH to use for CGI programs.
A typical value is "/usr/local/bin:/usr/ucb:/bin:/usr/bin".
<H4><A NAME="CGI_LD_LIBRARY_PATH">CGI_LD_LIBRARY_PATH</A></H4>
If defined, $LD_LIBRARY_PATH to use for CGI programs.
A typical value, if defined, is "/usr/local/lib:/usr/lib".
<H4><A NAME="OCCASIONAL_TIME">OCCASIONAL_TIME</A></H4>
How often to run the occasional cleanup job.
<H4><A NAME="STATS_TIME">STATS_TIME</A></H4>
Seconds between stats syslogs. If this is undefined then
no stats are accumulated and no stats syslogs are done.
A typical value is 3600 (an hour).
<H4><A NAME="MIN_REAP_TIME">MIN_REAP_TIME</A> and <A NAME="MAX_REAP_TIME">MAX_REAP_TIME</A></H4>
Minimum and maximum intervals between child-process reaping, in seconds.
<H4><A NAME="CGI_BYTECOUNT">CGI_BYTECOUNT</A></H4>
<P>
When throttling CGI programs, we don't know how many bytes
they send back to the client because it would be inefficient to
interpose a counter. CGI programs are much more expensive than
regular files to serve, so we set an arbitrary and high byte count
that gets applied to all CGI programs for throttling purposes.
<P>
A typical value is 200000.
<H4><A NAME="DEFAULT_PORT">DEFAULT_PORT</A></H4>
<P>
The default port to listen on. 80 is the standard HTTP port.
<H4><A NAME="INDEX_NAMES">INDEX_NAMES</A></H4>
<P>
A list of index filenames to check.
The files are searched for in this order.
A typical value is "index.html", "index.htm", "index.cgi".
<H4><A NAME="GENERATE_INDEXES">GENERATE_INDEXES</A></H4>
<P>
If this is defined then thttpd will automatically generate
index pages for directories that don't have an explicit index file.
If you want to disable this behavior site-wide, perhaps for security
reasons, just undefine this. Note that you can disable indexing of
individual directories by merely doing a "chmod 711" on them - the
standard Unix file permission to allow file access but disable "ls".
<H4><A NAME="LOG_UNKNOWN_HEADERS">LOG_UNKNOWN_HEADERS</A></H4>
<P>
Whether to log unknown request headers. Most sites will not
want to log them, which will save them a bit of CPU time.
<H4><A NAME="THROTTLE_TIME">THROTTLE_TIME</A></H4>
Time between updates of the throttle table's rolling averages.
A typical value is 60.
<H4><A NAME="LISTEN_BACKLOG">LISTEN_BACKLOG</A></H4>
<P>
The listen() backlog queue length. The 1024 doesn't actually
get used, the kernel uses its maximum allowed value. This is a config
parameter only in case there's some OS where asking for too high a queue
length causes an error. Note that on many systems the maximum length is
way too small - see
<A HREF="notes.html#throttle"" tppabs="http://www.acme.com/software/thttpd/notes.html#throttle"">http://www.acme.com/software/thttpd/notes.html</A>
<H4><A NAME="MAXTHROTTLENUMS">MAXTHROTTLENUMS</A></H4>
<P>
Maximum number of throttle patterns that any single URL can
be included in. This has nothing to do with the number of throttle
patterns that you can define, which is unlimited.
A typical value is 50.
<H4><A NAME="SPARE_FDS">SPARE_FDS</A></H4>
<P>
Number of file descriptors to reserve for uses other than
connections. Currently this is 5, representing one for the listen fd,
one for dup()ing at connection startup time, one for reading
the file, one for syslog, and one possibly for the log file.
<H4><A NAME="LINGER_TIME">LINGER_TIME</A></H4>
How many seconds to leave a connection open while doing a
lingering close.
A typical value is 2.
<H4><A NAME="MAX_LINKS">MAX_LINKS</A></H4>
Maximum number of symbolic links to follow before
assuming there's a loop.
A typical value is 32.
<H4><A NAME="MIN_WOULDBLOCK_DELAY">MIN_WOULDBLOCK_DELAY</A></H4>
<P>
You don't even want to know.
<HR>
Back to the <A HREF="thttpd.html" tppabs="http://www.acme.com/software/thttpd/thttpd.html">thttpd page</A>.
<P>
<ADDRESS><A HREF="mailto:webmaster@acme.com">ACME Labs Webmaster <webmaster@acme.com></A></ADDRESS>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -