summaryrefslogtreecommitdiffhomepage
path: root/README.txt
blob: d8783aff2938efd42b8d3ccd2a609310c44ab4f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
Reichwein.IT Webserver
======================

Features
--------

* Support for IPv4 and IPv6
* Support for HTTP and HTTPS via OpenSSL
* Virtual servers
* Plugin interface
* CGI interface
* FastCGI interface


Configuration
-------------

* Edit /etc/webserver.conf

* Enable in Debian:

  # systemctl enable webserver.service

* Start:

  # systemctl start webserver

* Query Status:

  # systemctl status webserver

  or observe /var/log/syslog


Example Configuration
---------------------

An example configuration is included in the package.

<webserver>
 <user>www-data</user>
 <group>www-data</group>
 <threads>10</threads>
 <plugin-directory>/usr/lib/webserver/plugins</plugin-directory>
 <sites>
  <site>
   <name>reichwein.it</name>
   <host>reichwein.it</host>
   <host>www.reichwein.it</host>
   <host>blog.reichwein.it</host>
   <path requested="/">
    <plugin>static-files</plugin>
    <target>/var/www/homepage</target>
   </path>
   <certpath>/etc/ssl/webserver/fullchain.pem</certpath>
   <keypath>/etc/ssl/webserver/privkey.pem</keypath>
  </site>
 </sites>
 <sockets>
  <socket>
   <address>127.0.0.1</address>
   <port>80</port>
   <protocol>http</protocol>
  </socket>
  <socket>
   <address>::1</address>
   <port>80</port>
   <protocol>http</protocol>
  </socket>
  <socket>
   <address>127.0.0.1</address>
   <port>443</port>
   <protocol>https</protocol>
  </socket>
  <socket>
   <address>::1</address>
   <port>443</port>
   <protocol>https</protocol>
  </socket>
 </sockets>
</webserver>


HTTP Auth
---------

For every plugin configuration (subdir in directory tree), an "auth"
configuration can be added for HTTP AUTH (basic). E.g.:

    <auth login="reichwein" password="wfewqbjkjbw"/>

Passwords are hashed with basic Unix crypt(). So don't make the configuration
file available to others.

Passwords can be prepared by calling "webserver" with the parameter "-p":

# webserver -p mypass3
70cjNwWBtNpWw


Plugin Configuration
--------------------

Plugin: cgi
~~~~~~~~~~~

Configuration example:

   <path requested="/cgi-bin">
    <plugin>cgi</plugin>
    <target>/usr/lib/webserver/cgi-bin</target>
   </path>


Plugin: fcgi
~~~~~~~~~~~~

Configuration example:

   <path requested="/fcgi">
    <plugin>fcgi</plugin>
    <target>127.0.0.1:9000</target>
   </path>


Plugin: redirect
~~~~~~~~~~~~~~~~

Parameters:

   target: URL to redirect to
   STATUS_CODE: Valid 3xx HTTP status code for redirection. Usually, one of:
                301 - Moved Permanently
                302 - Found (moved temporarily)
                303 - See Other
                307 - Temporary Redirect
                308 - Permanent Redirect
   MESSAGE: Message included in reply, normally not visible in the protocol or to the user

Configuration example:

   <path requested="/blog">
    <plugin>redirect</plugin>
    <target>https://blog.reichwein.it/</target>
    <STATUS_CODE>301</STATUS_CODE>
    <MESSAGE>Redirecting to antcom.de ...</MESSAGE>
   </path>


Plugin: static-files
~~~~~~~~~~~~~~~~~~~~

Configuration example:

   <path requested="/">
    <plugin>static-files</plugin>
    <target>/var/www/homepage</target>
   </path>


Plugin: statistics
~~~~~~~~~~~~~~~~~~

Configuration example:

   <path requested="/stats">
    <plugin>statistics</plugin>
    <target></target>
   </path>


Plugin: webbox
~~~~~~~~~~~~~~

This plugin needs a combination of static-files (for statically served parts)
and webbox plugins (for dynamic contents).

Configuration example:

   <path requested="/webbox1">
    <plugin>static-files</plugin>
    <target>/usr/lib/webbox/html</target>
   </path>
   <path requested="/webbox1/bin">
    <plugin>webbox</plugin>
    <target>/home/rr/testbox</target>
    <WEBBOX_NAME>Testbox1</WEBBOX_NAME>
    <WEBBOX_READONLY>0</WEBBOX_READONLY>
    <auth login="reichwein" password="wfewqbjkjbw"/>
   </path>


Plugin: weblog
~~~~~~~~~~~~~~

Configuration example:

   <path requested="/blog">
    <plugin>weblog</plugin>
    <target>/home/reichwein/testblog</target>
    <WEBLOG_NAME>My Blog</WEBLOG_NAME>
    <WEBLOG_KEYWORDS>Reichwein, Reichwein IT, Blog</WEBLOG_KEYWORDS>
   </path>