\chapter{Configuration}\index{Configuration}

This chapter will explain how to configure WendzelNNTPd after installation.

\textbf{Note:} The configuration file for WendzelNNTPd is named \textit{/usr/local/etc/wendzelnntpd.conf}. The format of the configuration file should be self-describing and the default config file includes many comments which will help you to understand the lines you can see and modify there.

\textbf{Note:} On *nix-like operating systems the default installation path is \textit{/usr/local/*} what means that the configuration file of WendzelNNTPd will be \textit{/usr/local/etc/wendzelnntpd.conf}, and the binaries will be placed in \textit{/usr/local/sbin}. %On Windows all files are placed in the directory you have chosen during the installation.

\section{Choosing a database engine}

The first and most important step is to choose a database engine. You can use either SQLite3 (what is the default case and easy to use, but not suitable for larger systems with many thousand postings) or MySQL (which is of course the better solution, but also a little bit more complicated to realize). By default, WendzelNNTPd is configured for SQLite3 and is ready to run. If you want to keep this setting, you do not have to read this section.

\subsection{Modifying wendzelnntpd.conf}

In the configuration file you will find a line called \textbf{database-engine}. You can choose to use either MySQL or SQLite as the backend storage system by appending either \textbf{sqlite} or \textbf{mysql}.

\begin{verbatim}
database-engine mysql
\end{verbatim}

If you choose to use MySQL then you will also need to specify the user and password which WendzelNNTPd should use to connect to the MySQL server. If your server does not run on localhost or uses a non-default MySQL port then you will have to modify these values too.

\begin{verbatim}
; Your database hostname (not needed for sqlite3)
database-server 127.0.0.1

; the database connection port (not needed for sqlite3)
; Comment out to use the default port of your database engine
database-port 3306

; Server authentication (not needed for sqlite3)
database-username mysqluser
database-password supercoolpass
\end{verbatim}

\subsection{Generating your database tables}

Once you have chosen your database backend you will need to create the database and the required tables.

\subsubsection{SQLite}

If you chose SQLite as your database backend then you can skip this step as running \textbf{make install} does this for you.

\textbf{Note:} The SQLite database file as well as the posting management files will be stored in \textit{/var/spool/news/wendzelnntpd/}.

\subsubsection{MySQL}

For MySQL, a SQL script file is included called \textit{mysql\_db\_struct.sql}. It creates the WendzelNNTPd database as well as all the needed tables. Use the MySQL console tool to execute the script.

\begin{verbatim}
$ cd /path/to/your/extracted/wendzelnntpd-archive/
$ mysql -u YOUR-USER -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 5.1.37-1ubuntu5.1 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> source mysql\_db\_struct.sql
...
mysql> quit
Bye
\end{verbatim}

\section{Network Settings}

Now you should specify the IP addresse(s) (IPv4 or IPv6) for WendzelNNTPd to accept connections on and the TCP port (the default NNTP port is 119) to run on.

\begin{verbatim}
; You have to specify the port _before_ using the 'listen' command!
port	119
; network addresses to listen on
listen	127.0.0.1
listen	::1
listen	192.168.0.1
\end{verbatim}

You \textit{could} also use different ports for each IP address by placing a \textbf{port} command right before each \textbf{listen} command but this is not recommended.

\section{Setting the Allowed Size of Postings}

To change the maximum size of a post to be sent to the server, change the variable \textbf{max-size-of-postings}. The value must be set in Bytes and the default value is 20971520 (20 MBytes).

\begin{verbatim}
max-size-of-postings 20971520
\end{verbatim}

\section{Verbose Mode}

If you have any problems running WendzelNNTPd or if you simply want more information about what is happening, you can uncomment the \textbf{verbose-mode} line.

\begin{verbatim}
; Uncomment 'verbose-mode' if you want to find errors or if you
; have problems with the logging subsystem. All log strings are
; written to stderr too, if verbose-mode is set. Additionally all
; commands sent by clients are written to stderr too (but not to
; logfile)
verbose-mode
\end{verbatim}

\section{Security Settings}

Please note that WendzelNNTPd does not support SSL/TLS!

\subsection{Authentication and Access Control Lists (ACL)}

WendzelNNTPd contains an extensive access control subsystem. If you want to only allow authenticated users access to the server, you should uncomment \textbf{use-authentication}. This gives every authenticated user access to each newsgroup.

\begin{verbatim}
; Activate authentication
use-authentication
\end{verbatim}

If you need a slightly more advanced authentication system, you can activate Access Control Lists (ACL) by uncommenting \textbf{use-acl}. This activates the support for Role-based ACL too.

\begin{verbatim}
; If you activated authentication, you can also activate access
; control lists (ACL)
use-acl
\end{verbatim}

\subsection{Anonymized Message-ID}

By default, WendzelNNTPd makes a user's hostname or IP address part of new message-IDs when a user sends a post using the NNTP POST command. If you do not want that, you can force WendzelNNTPd not to do so by uncommenting \textbf{enable-anonym-mids}, which enables anonymized Message-IDs.

\begin{verbatim}
; This prevents that IPs or Hostnames will become part of the
; message ID generated by WendzelNNTPd what is the default case.
; Uncomment it to enable this feature.
enable-anonym-mids
\end{verbatim}

\subsection{Changing the Default Salt for Password Hashing}

When uncommenting the keyword \textbf{hash-salt}, the default salt value that is used to enrich the password hashes can be changed. Please note that you have to define the salt \textit{before} you set-up the first password since it will otherwise be stored as hashed with an old salt, rendering it unusable. For this reason, it is best to define your salt right after running \textbf{make install}.

\begin{verbatim}
; This keyword defines a salt to be used in conjunction with the
; passwords to calculate the cryptographic hashes. The salt must
; be in the form [a-zA-Z0-9.:\/-_]+.
; ATTENTION: If you change the salt after passwords have been
; stored, they will be rendered invalid! If you comment out
; hash-salt, then the default hash salt defined in the source
; code will be used.
hash-salt 0.hG4//3baA-::_\
\end{verbatim}

WendzelNNTPd applies the SHA-2 hash algorithm using a 256 bit hash value. Please also note that the final hash is calculated using a string that combines salt, username and password as an input to prevent password-identification attacks when an equal password is used by multiple users. However, utilizing the username is less secure than having a completely separate salt for every password.


