BACK
Configuration

The server configuration is part of a config file that is meant to hold all of the services I am writing. So the server part has to start with a [server] entry. Below that follow the normal entries and after those a couple of sub-blocks. Between the single entries are no empty lines allowed, as the config processing routine interpretes an empty line as the end of the master block. The basic structure looks like this:

[server]
scheduler settings
global settings
default values
[-File-Types]
list of known file types
[-Directories]
list of allowed directories
[-Virtual-Servers]
list of virtual server names
[-Registered-Mugis]
list of registered MUGIs

The virtual servers have their own configuration, taking over the values from above and replacing them as needed. So every aspect of the virtual server can of course be changed. If something isn't there at all, the default values are used, so if you want to take over the registered MUGI list for example the [-Registered-Mugis] line may not be there at all. If you have the [-Registered-Mugis] entry followed by no line whatsoever the default list is also overwritten, in that case by an empty list.

[server_name-Configuration]
replacement of default values
[-Directories]
list of allowed directories
[-Registered-Mugis]
list of registered MUGIs

Normal entries look like this:
entry_name=value; // comment

Depending on the type the value can either be a number or a string. A string should be placed in "" to avoid problems. It's also recommended to end the line with a ';'. Flag entries like "use nagle" don't take arguments and anything behind such an entry will be ignored

Those list type blocks are read line wise, so a comment is not possible. It's also no good idea to place comments behind subblock or block definitions. As long as you keep a line away from blocks however you can pretty much write anything you want within the file.


Example config file, comments would not be in the file:
Ouside of the main Blocks you can write just like this. But it would be a bad idea to use text
that might be mistaken as a block definition the config processing routine might actually seek.
Don't forget to use at least one empty line as seperation.

[Server]
main_sched=0;
main_nice=-20;
cgi_sched=0;
cgi_nice=0;
use fork;				 activates fork mode
use nagle;				 activates nagle
max_threads=250;			 maximum number of 250 workers
listenlength=1000;			 length of the listensockets listenqueue
listen_ip="192.168.0.1";		 the IP address the server listens to
socket=80;				 listen on socket 80
keep_alive=1;				 keep alive only for 1 second
keep_alive_num=20;			 limit it to 20 requests per connection
max_in_pipe=5;				 process up to 5 piped requests
readbuffer=20;				 maximum read size is 20KByte
sendbuffersize=10000;			 sendbuffersize is 10000 Bytes
max_cached_size=4096;			 files above 4096 Bytes will be sent using sendfile
versionstring="dpfTVS/2.0.914 Beta";
mainpage="Seiten/index.html";		 path to the main page of the default virtual server
content_root="";			 content root is current working directory
cgi_root="cgi";				 cgi is enabled and the scripts are located in the folder "cgi"
cgi_user=0;				 keep root rights for cgi scripts
cgi_timeout=120;			 kill cgi script if there was no response within 120 seconds
mugi_socket=-1;				 no direct forwarding to a mugi
mugi_ip="";
[-File-Types]				 that's a list of the known mime types, is case insensitive
.GIF	image/gif
.HTML	text/html			 files that end with ".html" are of content-type text/html
.JPG	image/jpeg
.PNG	image/png
.TXT	text/plain
.CSS	text/css
.HTM	text/html
[-Directories]				 the list of directories the content might be in
pages*					 allows all paths starting with "/pages"
private					 allows only the folder private,
private/pics				 so additional sub folders have to be permitted explicitely
[-Virtual-Servers]			 the list of the virtual server names
www.myserver.com	-
new.myserver.com	-		 the '-' orders to use all the default values
myserver.com		-
forum.myserver.com	*		 The '*' orders to look for a definition entry of the very same name
dpftvs.myserver.com	mine
192.168.0.1		mine		 Is there a name it is the alias to look for to get the settings
[-Registered-Mugis]
hallo	9000	127.0.0.1		 registers the name "hallo" as keyword for a mugi to be found at 127.0.0.1:9000

[forum.myserver.com-Configuration]	 this virtual server is set to auto forward incoming requests
mugi_socket=7600;			 to the mugi found at 127.0.0.1:7600
mugi_ip="127.0.0.1";
cgi_root="/home/mine/dpfTVS/cgi";	 cgi is enabled and the scripts are located here
[-Registered-Mugis]			 The empty line closes the definition block, clearing the rmugi list

[mine-Configuration]
content_root="/home/mine/manual";
mainpage="index.html";			 mainpage would be "/home/mine/manual/index.html"
cgi_root="";				 the servers cgi function is disabled
[-Directories]
*					 "*" allows the content root directory, "**" would allow the whole sub-tree
content					 allows the folder content ("/home/mine/manual/content")
content/pics1	s			 files smaller than max_cached_size within folder are put into the static cache
content/pics2	h			 files smaller than max_cached_size within folder are put into the half-static cache
[-Registered-Mugis]
cgi	9001	127.0.0.1		 registers "cgi" as name of the mugi found at 127.0.0.1:9001
ext-cgi	7500	192.168.0.2		 registers "ext-cgi" as name of a mugi in the lan at 192.168.0.2:7500


BACK