---
name: "wnsd"
section: "8"
platform: "linux"
package: "wn"
version: "2.2.9-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/wnd"
---

# wnsd(8)

inetd and stand-alone daemons for wn HTTP server

Part of [wnd(8)](/wnd/8.md).

## NAME

wnd, wnsd - inetd and stand-alone daemons for wn HTTP server

## SYNOPSIS

**wnd** \[**-a** *numeric\_uid*\] \[**-A** *numeric\_gid*\] \[**-d**\] \[**-e**\] \[**-E**\] \[**-h** *hostname*\] \[**-L** *access\_logfile*\] \[**-l** *error\_logfile*\] \[**-S**\] \[**-t** *trusted\_uid*\] \[**-T** *trusted\_gid*\] \[**-u**\] \[**-v common**\|**verbose**\|**ncsa**\] \[**-V** *virtual\_host\_file*\] *directory*

**wnsd** \[**-a** *numeric\_uid*\] \[**-A** *numeric\_gid*\] \[**-d**\] \[**-e**\] \[**-E**\] \[**-h** *hostname*\] \[**-L** *access\_logfile*\] \[**-l** *error\_logfile*\] \[**-q** *pid\_file*\] \[**-S**\] \[**-t** *trusted\_uid*\] \[**-T** *trusted\_gid*\] \[**-u**\] \[**-v common**\|**verbose**\|**ncsa**\] \[**-V** *virtual\_host\_file*\] \[**-p** *port*\] \[**-q** *pid\_file*\] *directory*

## DESCRIPTION

**wnd** and **wnsd** are **C** programs that are part of the [**wn**(1)](/wn/1.md) HTTP server package. **wnd** is an HTTP daemon that is designed to be run from the [**inetd**(8)](/inetd/8.md) internet super-server usually from an entry in the */etc/inetd.conf* file. **wnsd** is a stand-alone HTTP daemon that can be started from a command line or from the [**init**(8)](/init/8.md) process.

The argument *directory* is the root data directory that the server will use to server documents.

## OPTIONS

- **-a** *numeric\_uid*

  Set trusted numeric uid for authentication.  The server will only allow password authentication (see **http:/doc/wn/access.html )** if one of the options **-a**, **-A**, **-t**, or **-T** is used.  Then the *index.cache* file for a password protected directory must be owned by the user id specified with the **-a** or **-t** option.  The **-a** option only affects authentication while **-t** has other effects.  The four command line arguments **-a**, **-A**, **-t**, and **-T** all take a numeric argument.  Thus the command should be

  ```
          ./wnsd -a 203
  ```

  and not

  ```
          ./wnsd -a joe
  ```

  if user *joe* has user id *203*.

- **-A** *numeric\_gid*

  Set trusted numeric gid for authentication. This is similar to the **-a** option except the group owner (gid) of the *index.cache* file is used instead of the uid.

- **-d**

  Really verbose log.  When the server is run with this option it will include copies of all the client headers plus some additional information in the log file.  This is only useful for debugging or if you are curious about what clients actually send.

- **-e**

  Forbid CGI and execs.  When the server is run with this option it will not execute a CGI script, a filter or any executable in an include. In addition the server will reject any request with the **POST** method.

- **-E**

  Forbid CGI and execs to trusted users.  This is similar to the **-e** option except that *index.cache* files owned by a trusted user id or trusted group id (set with the **-t** or **-T** option) are exempt from the restrictions.  That is, only scripts listed in *index.cache* files owned by the trusted user or group will be executed.  If neither the **-t** or **-T** are used then no scripts, filters or includes will be executed.  This option takes precedence over the **-u** option, i.e. if both are used execution of scripts and programs behaves as if the **-u** were not present (although the **-u** option still grants permission for the serving of ordinary files).

- **-h** *hostname*

  Set hostname. Tell the server that its name is *hostname*. This is only used for two things: to pass to CGI scripts and for redirects generated when a trailing '/' is omitted in a URL path to a directory.  It is a shame browsers can't handle relative URL redirects!

- **-L** *access\_logfile*

  Set access logfile name.  Write log information to the file *access\_logfile*. This will override the value specified when you ran the configure program during installation of [**wn**(1)](/wn/1.md) HTTP server package.  If the empty string "" is used as the value of this option then no transaction logging will be done.

- **-l** *error\_logfile*

  Set error logfile name. Write information about errors to the file *error\_logfile*. This will override the value specified when you ran the configure program during installation of [**wn**(1)](/wn/1.md) HTTP server package.  If the empty string "" is used as the value of this option then the logfile given with **-L** is used for errors as well as regular transactions.

- **-p** *port*

  Set the port.  For **wnsd** only.  Running the command

  ```
          ./wnsd -p 8080
  ```

  will run the server on port *8080* rather than the default which is normally *80* but can be set in *config.h*. If a value less than or equal to *1024* is used then the server must be run by **root** (it will change its permissions after opening the port).  This option is only used by **wnsd** since when **wnd** is run under [**inetd**(8)](/inetd/8.md) the port is determined by the setting in */etc/services*.

- **-q** *pid\_file*

  Set the file name which contains the **wnsd** server process id.  For **wnsd** only.  Write the process id or "pid" of the main server process to the file *pid\_file*. This file name should be the full path relative to the system root. If this is not set either with the **-q** option or via the configure script then the pid will be written to standard output when the server is started.

- **-S**

  Use the UNIX [**syslogd**(8)](/syslogd/8.md) logging facility.  Instead of writing log messages to a file specified with **-L** or in *config.h*, use the UNIX [**syslogd**(8)](/syslogd/8.md) facility.  If **WN\_ERRORLOGFILE** is set to "" and the server is run with the **-S** option then error logging will be handled by the [**syslogd**(8)](/syslogd/8.md) facility.  If **WN\_ERRORLOGFILE** is given a value or the **-l** option is used then errors will be logged there rather than using the [**syslogd**(8)](/syslogd/8.md) facility.

- **-t** *trusted\_uid*

  Set trusted numeric user id.  When invoked with the **-t** option alone **wnd** or **wnsd** will not serve a document unless the *index.cache* file listing it has the prescribed owner (uid), *trusted\_uid*. This numeric uid should be that of the maintainer not the one under which **wnd** or **wnsd** runs if started by **root**. Indeed, for security reasons the server will refuse to use an *index.cache* file whose owner is the uid under which the server is running, in this case.  If on your server all *index.cache* files are created by a single user or a single group this option or the **-T option** are highly recommended.  This added security is weakened somewhat if you also use the **-u** option which allows *index.cache* files owned by untrusted users to permit the serving of files owned by the same user.  If both **-u** and **-t** are used the trusted user specified by **-t** is exempt from the restrictions imposed by the **-u** argument.

- **-T** *trusted\_gid*

  Set trusted numeric group id.  This is similar to the **-t** option except the numeric group owner (gid) of the *index.cache* file is used instead of the numeric uid.

- **-u**

  Restricted untrusted users.  When this option is invoked the server requires that every file served (including wrappers and includes) have the same owner as the *index.cache* file which grants it permission to be served.  This means that untrusted users can only serve files which they own.  If the **-t** or **-T** option (described above) is used with **-u** then *index.cache* files owned by the trusted user or trusted group are exempt from this requirement and they may grant permission to serve any file the server can read.  If the **-u** and **-E** options are used together then the **-E** takes precedence for execution of CGI scripts, filters and executable includes, but the **-u** still has effect for ordinary files being served.

  Notice that if none of **-t**, **-T**, and **-u** are used then a user with his own home page can make a symbolic link to any file readable by the server and that document will be served. This is true even if the linked to document is in a directory with limited access (see **http:/doc/wn/access.html )** or is outside the server data hierarchy.

**-v common**\| **verbose**\| **ncsa**

Set access logfile format.  They cause the logfile to be written in the so-called common log format, or [**wn**(1)](/wn/1.md) verbose format including user agent, referrer and cookies, or in the NCSA extended format which includes referrer and user agent.

- **-V** *virtual\_host\_file*

  Set file name which contains the list of virtual hosts and their root directories.  The file *virtual\_host\_file* should be the name of the file containing the list of "virtual hosts" and their corresponding IP numbers and root directories.  The format of this file is one line per virtual host.  Each such line should have the form

  ```
    hostname           ip_address       root_path
  ```

  with the three parts separated by white space.  For example an entry might be

  ```
    myhost.school.edu  111.222.333.444  /usr/local/wn
  ```

  In particular the hostname should be the fully qualified domain name. Lines in this file which are empty or start with '#' are ignored.

  If the virtual host file is changed you will need to restart the server for the change to take effect.

## FILES

- */etc/wn/wn.conf*

  Main Debian specific configuration file for [**wn**(1)](/wn/1.md) package.

- */etc/wn/wn.rc*

  Debian specific [**sh**(1)](/sh/1.md) wrapper program to start [**wn**(1)](/wn/1.md) daemon with proper options.

- */etc/init.d/wn*

  Debian specific [**sh**(1)](/sh/1.md) program to start **wnsd** stand-alone daemon from [**init**(8)](/init/8.md) process.

- Debian specific

  */etc/cron.daily/wn* [**sh**(1)](/sh/1.md) program to re-index standard documentation directories.  It is run daily by the [**cron**(8)](/cron/8.md) daemon.

## SEE ALSO

[**wn**(1)](/wn/1.md), [**wn\_mkdigest**(1)](/wn_mkdigest/1.md), [**wn\_uncache**(1)](/wn_uncache/1.md), [**wndex**(1)](/wndex/1.md), [**wnindexmaker**(1)](/wnindexmaker/1.md), [**wnpnuts**(1)](/wnpnuts/1.md), [**wnauth**(3)](/wnauth/3.md), [**wncat**(3)](/wncat/3.md), [**wnhtmlify**(3)](/wnhtmlify/3.md), [**wnredir**(3)](/wnredir/3.md), [**wnsectsearch**(3)](/wnsectsearch/3.md), [**wnseven\_m**(3)](/wnseven_m/3.md), [**wn\_md5passwd**(8)](/wn_md5passwd/8.md), [**wn\_mkpasswd**(8)](/wn_mkpasswd/8.md), [**wnconfig**(8)](/wnconfig/8.md), [**wnupdatewww**(8)](/wnupdatewww/8.md), [**wnv2c**(8)](/wnv2c/8.md)\
 **http:/doc/wn/appendixA1.html**\
 **http:/doc/wn/manual.html**\
 **http://hopf.math.nwu.edu/**

## AUTHOR

**wn** is written by John Franks \<john@math.nwu.edu\>.  Modified by Jean Pierre LeJacq \<jplejacq@quoininc.com\> as part of packaging for the Debian GNU/Linux distribution. Manual page also added by Jean Pierre LeJacq.

## BUGS

I'm not sure I have all the interactions of the options properly documented.
