# The Webserver pywwetha

## Introduction

pywwetha is a webserver with a small footprint.

## Features

- Serves static html and CGI.
- Runs as daemon
- Tests configuration file
- Any user can start/stop the service

## Installation

    # Get the debian packet
    dpkg -i pywwetha*.deb

### The Steps of the Installation

    # copy files to /etc/pywwetha/, /etc/init.d/ and /usr/share/pywwetha
    insserv pywwetha
    /etc/init.d/pywwetha check-config
    /etc/init.d/pywwetha start
    /etc/init.d/pywwetha status

## Configuration

Each file with the pattern /etc/pywwetha/*.conf will be treated as a configuration file.

    # /etc/pywwetha/pywwetha.conf:
    #
    # Port where pywwetha is listen
    port=8086
    # pywwetha is running under this user:
    user=www-data
    # pywwetha is running under this group:
    group=www-data
    # Logging if pywwetha is running as daemon:
    daemon-log=false

    # /etc/pywwetha/localhost.conf:
    #
    # default virtual host is localhost:
    # Definitions of localhost are the default definitions for the other vhosts.

    # The path where the documents are lying
    localhost:documentRoot=/var/www

    # The program to build dynamic content
    localhost:cgiProgram=/usr/bin/php-cgi

    # Arguments for the cgi program: separated by |
    # Possible placeholder: ${file} (the input for the cgi program)
    localhost:cgiArgs=${file}|-C|-c|/etc/wywetha/php.ini

    # File extensions of the CGI scripts, separated by |
    localhost:cgiExt=php|php5

## Virtual Hosts

pywwetha supports virtual hosts:
Each virtual host has its own properties: documentRoot cgiProgram ...

Note: Don't forget to define the virtual host in the DNS, e.g. in /etc/host.

## Program Options

--daemon | Start as daemon process.
--check-config | Tests and shows the configuration data.
--verbose | Shows additional info.
--log | Writes the requests to /tmp/pywwetha.log.

## Auxiliary files

- /etc/init.d/pywwetha starts/stops/queries the service.
- /etc/sudoers/pywwetha allows the usage of the above script by any user.
- pywwetha-control is a script for start/stop/query the service. Can be used by any user.

## The Project's Name

- Piwwetha is a native american tribe (in its own language Tiwa). See here.
- The project is written in python.
- It makes similar things which the well known apache does.
- pywwetha is not known by some search engines at its birth.