[-File-Types]
These are often refered to as mime types. The browser needs some information what kind of file it is receiving
in order to display it as intended. Like most other servers dpfTVS uses the file extension to get this information.
The entries have this scheme:
.file-extension mime-type
.HTML text/html
There are a couple of pages in the web where you can find the definitions. Currently the list is not processed
in an optimised way, just gone through linear, so you shouldn't put in more than you really need. Until I have time
to change that you can tune your server up by sorting the entries from most likely to most unlikely. The comparission
is made case insensitive, so you need to include every type only once.(HTML, html, Html and so on is the same)
[-Directories]
In order to protect the files you don't want to share you have to tell dpfTVS which directories the user is allowed
to use. Those directories are always relative paths based on the content_root entry. You may not start the entry
with a '/'. The server takes this away internally for the incoming request and it will never get a match then. The
'*' is the only allowed wildcard and it has 2 purposes. The first is to allow the content_root directory and the
second is to allow a whole subtree. So '**' allows all directories, including the content_root up. A 'content*' will
allow all sub directories starting with "content". However, in case you use the '*' the path is additionally checked
for things that might enable the user to look elsewhere, like "../" and so on to prevent the user to gain access to
other directories.
You can mark a directory with a following additionally 's' or 'h' seperated by one or several white space characters
(' ' or tab). A directory(tree if it had a '*' at the end) with a trailing 's' is read into the static cache and file
requests that match this path will be first looked for in the (sorted) chached file list. If it has a trailing
'h', the files are made part of the half-static cache which are part of the same sorted list. Of course a file is only
taken once into the cache. The checking is done using the whole file path, starting from the root directory of the system.
So if you store a file at two different places the cache won't recognice the similarity (for now), but if you add the same
directory in several virtual servers with different content_roots which translate into the same complete path the file
will be cached only once. Only files with a size smaller or equal to max_cached_size will be cached. This part will be
changed when the dynamic file cache is added to make it more user friendly. Please see the config example from the previous
side for some demonstration directory entries.
[-Virtual-Servers]
dpfTVS supports virtual servers. Modern browsers always include the "Host:" header field and the content of that is
compared to the names you have defined here. If it is an unknown name the server will use the default entry. In case
you wonder, if you register a host name like "myserver.com" only the last two part strings are compared to find out
the targets ip-address. So "www.myserver.com" and "home.myserver.com" as well as "my.home.myserver.com" will result
in the browser getting the right address. You can use this to define basically a whole bunch of virtual servers. The
entries are a name followed by a marker that defines the entry name of the config file to use to find the right settings:
| myserver.com | - |
| forum.myserver.com | * |
| dpftvs.myserver.com | mine |
| 192.168.0.1 | mine |
The name is followed either by '-', by '*' or by a string. A '-' tells the server to use the default settings for this name. A
'*' tells the server to look for an entry starting with the given name while a string acts as an alias to look under. For the
examples above the server will do the following. "myserver.com" will get the defaults. For "forum.myserver.com" the server will
look for an entry of "[forum.myserver.com-Configuration]" and take the values found there. For "dpftvs.myserver.com" it will take the values found under "[mine-Configuration]". The space between the name and the definition can be regular spaces as well as tabulators
or a combination of them.
[-Registered-Mugis]
To register a MUGI you need 3 values. First is of course the name. This name can be, but usually isn't, identical to the
file name. The next in the line is the port the MUGI listens to and the last entry has to be its ip-address. dpfTVS doesn't
support symbolic names, so the port has to be a number and the address has to be the raw format too. So for a local MUGI
you have to give "127.0.0.1". Some wrong entries might be recognised at start up, but you should test new entries to make
sure that the server is capable to connect to it properly. Typically the three values are seperated by spaces, tabulators
or a combination of them.
hallo 9000 127.0.0.1
If the user types an address which starts with "hallo", dpfTVS will call the local MUGI at port 9000. So http://myserver.com/hallo?ich=2
http://myserver.com/hallo
http://myserver.com/hallo/ich/page
will all be passed on to the same MUGI. So your code has to deal with that. It also doesn't matter which method is used,
so GET, POST, HEAD or OPTIONS will reach your program just the same. Only TRACE is directly processed and send back to the
browser, so the value of a successfull TRACE is nothing you can take seriously as it is always successfull if it reaches
dpfTVS at all.
|