You can modify the MIME types used by MyServer by modifing the file "MIMEtypes.xml".
The following is an example of the .xml file:
<MIMETYPES>
-
<MIMETYPE>
-
<MIMETYPE defaultAction="DENY">
<EXT>htm</EXT>
<MIME>text/html</MIME>
<CMD>SEND</CMD>
<ACTION name="Host" value="localhost">ALLOW</ACTION>
<FILTER>gzip</FILTER>
<MANAGER>NONE</MANAGER>
</MIMETYPE>
Each block describes a different MIME type.
<EXT> is the type of file
<MIME> is the Mime type.
<CMD> is the way to send the file to the
client.
<ACTION name="Host" value="localhost">ALLOW</ACTION>
will allow access to the desired MIME Type if the Host is "localhost".
In the line <MIMETYPE defaultAction="DENY">
we tell that our MIME Type will DNY access from any host we don't set
in the proper ACTION tag (so, it will have to exist in the configuration).
Also, the property
defaultAction is optional (when it's omitted,
it's set to "ALLOW"). So, in the above example, HTML files will
be accessed only through the hostname "localhost".
The tag <ACTION> is optional, unless you specify "DENY"
for your defaultAction in your MIME Type.
<FILTER> defines a filter for that Mime
Type. The data will pass through the filter before being sent to the user.
In the example above, the data would be sent gzipped to the user. It means
Gzip works as a filter in MyServer. you can define Gzip to automatically
run for every file based in its size, setting the <GZIP_THRESHOLD>,
in myserver.xml file. For obvious reasons, data will be sent gzipped only
if the client supports gzip - otherwise he'd receive a lot of wierd characters
instead of the site requested.
In general, filters can also be applied to dynamic data - like CGI, ISAPI,
FastCGI - but they need to be filters that don't modify the contents of
the page to be shown to the user.
<MANAGER> completes
the <CMD> command specifying, if
necessary for the command, an external application to use.
For example using the RUNCGI command, it will be necessary to specify
an external process to execute the CGI command, MANAGER under
GNU/Linux will be something like this:
<MANAGER>/usr/bin/php-cgi</MANAGER>
or under Windows:
<MANAGER>c:\php\php-cgi.exe</MANAGER>
The following values for sending the file to the client are valid in the
<CMD> section: