/Webserver ODB tree

From MidasWiki
(Redirected from Webserver ODB tree)
Jump to navigation Jump to search


Links

Creating the /Webserver tree

The /Webserver ODB tree is created automatically when the mhttpd program is first run.

Purpose

The /Webserver ODB tree configures the behaviour and security features of mhttpd.


Examples

When initially created, the /Webserver tree contains the following keys:

[local:dev_expt:S]/WebServer>ls -lrt
Key name                        Type    #Val  Size  Last Opn Mode Value
---------------------------------------------------------------------------
WebServer                       DIR
   Enable localhost port       BOOL    1     4     12m  0   RWD  y
   localhost port              INT     1     4     12m  0   RWD  8080
   localhost port passwords    BOOL    1     4     12m  0   RWD  n
   Enable insecure port        BOOL    1     4     12m  0   RWD  n
   insecure port               INT     1     4     12m  0   RWD  8081
   insecure port passwords     BOOL    1     4     12m  0   RWD  y
   insecure port host list     BOOL    1     4     12m  0   RWD  y
   Enable https port           BOOL    1     4     12m  0   RWD  n
   https port                  INT     1     4     12m  0   RWD  8443
   https port passwords        BOOL    1     4     12m  0   RWD  y
   https port host list        BOOL    1     4     12m  0   RWD  n
   Host list                   STRING  10    32    12m  0   RWD
                                       [0]             localhost
                                       [1]
                                       [2]
                                       [3]
                                       [4]
                                       [5]
                                       [6]
                                       [7]
                                       [8]
                                       [9]
   Enable IPv6                 BOOL    1     4     12m  0   RWD  y
   Proxy                       DIR
       example                 STRING  1     23    12m  0   RWD  #http://localhost:8080
   mime.types                  DIR
       .HTML                   STRING  1     10    12m  0   RWD  text/html
       .HTM                    STRING  1     10    12m  0   RWD  text/html
       .CSS                    STRING  1     9     12m  0   RWD  text/css
       .TXT                    STRING  1     11    12m  0   RWD  text/plain
       .ASC                    STRING  1     11    12m  0   RWD  text/plain
       .ICO                    STRING  1     13    12m  0   RWD  image/x-icon
       .GIF                    STRING  1     10    12m  0   RWD  image/gif
       .JPG                    STRING  1     11    12m  0   RWD  image/jpeg
       .JPEG                   STRING  1     11    12m  0   RWD  image/jpeg
       .PNG                    STRING  1     10    12m  0   RWD  image/png
       .SVG                    STRING  1     14    12m  0   RWD  image/svg+xml
       .BMP                    STRING  1     10    12m  0   RWD  image/bmp
       .MP3                    STRING  1     11    12m  0   RWD  audio/mpeg
       .OGG                    STRING  1     10    12m  0   RWD  audio/ogg
       .MID                    STRING  1     11    12m  0   RWD  audio/midi
       .WAV                    STRING  1     10    12m  0   RWD  audio/wav
       .XML                    STRING  1     16    12m  0   RWD  application/xml
       .JS                     STRING  1     23    12m  0   RWD  application/javascript
       .JSON                   STRING  1     17    12m  0   RWD  application/json
       .PS                     STRING  1     23    12m  0   RWD  application/postscript
       .EPS                    STRING  1     23    12m  0   RWD  application/postscript
       .PDF                    STRING  1     16    12m  0   RWD  application/pdf
       .ZIP                    STRING  1     16    12m  0   RWD  application/zip
       .XLS                    STRING  1     22    12m  0   RWD  application/x-msexcel
       .DOC                    STRING  1     19    12m  0   RWD  application/msword

Keys in /Webserver tree

Enable localhost port

  • Type: BOOL
  • Default: y

This key in the /Webserver tree tells mhttpd whether to bind to a port on localhost. The port to bind to is specified by the localhost port key.

localhost port

  • Type: INT
  • Default: 8080

This key in the /Webserver tree tells mhttpd which port to bind to on localhost (if Enable localhost port is true). If there are multiple experiments running on the same machine, each experiment should specify a different port.

localhost port passwords

  • Type: BOOL
  • Default: n

This key in the /Webserver tree tells mhttpd whether localhost connections require a password. See Create a password file in the mhttpd documentation for details on how to define the usernames/passwords.


Enable insecure port

  • Type: BOOL
  • Default: n

This key in the /Webserver tree tells mhttpd whether to allow http connections from other machines. The port to bind to is specified by the insecure port key.

insecure port

  • Type: INT
  • Default: 8081

This key in the /Webserver tree tells mhttpd which port to allow http connections on (if Enable insecure port is true). If there are multiple experiments running on the same machine, each experiment should specify a different port.

insecure port passwords

  • Type: BOOL
  • Default: y

This key in the /Webserver tree tells mhttpd whether http connections require a password. See Create a password file in the mhttpd documentation for details on how to define the usernames/passwords.

insecure port host list

  • Type: BOOL
  • Default: y

This key in the /Webserver tree tells mhttpd whether to only allow http connections from certain machines. The list of allowed machines is specified by the Host list key. Setting this to n allows http connections from any machine.


Enable https port

  • Type: BOOL
  • Default: n

This key in the /Webserver tree tells mhttpd whether to allow https connections from other machines. The port to bind to is specified by the https port key.

https port

  • Type: INT
  • Default: 8443

This key in the /Webserver tree tells mhttpd which port to allow https connections on (if Enable https port is true). If there are multiple experiments running on the same machine, each experiment should specify a different port.

https port passwords

  • Type: BOOL
  • Default: y

This key in the /Webserver tree tells mhttpd whether https connections require a password. See Create a password file in the mhttpd documentation for details on how to define the usernames/passwords.

https port host list

  • Type: BOOL
  • Default: n

This key in the /Webserver tree tells mhttpd whether to only allow https connections from certain machines. The list of allowed machines is specified by the Host list key. Setting this to n allows https connections from any machine.

Host list

  • Type: Array of STRING
  • Default: 10 elements, first entry set to localhost, all others empty.

This key in the /Webserver tree tells mhttpd which machines to allow connections from, if insecure port host list and/or https port host list are true. Specify one acceptable hostname per entry. You may increase the array length if you need to specify more that 10 hostnames.

Enable IPv6

  • Type: BOOL
  • Default: y

This key in the /Webserver tree tells mhttpd whether to allow connections via IPv6 as well as IPv4.

Proxy

  • Type: DIR

This key in the /Webserver tree configures mhttpd as a proxy to other http servers.

For each server you want to proxy to, add a STRING key to the /Webserver/Proxy directory. The key is the proxy name and the value is the server address to proxy to. The URL to access the proxy is http://<your_hostname>:<your_port>/proxy/<key_name>.

By default, one entry is included with a key of example, and a value that is an invalid URL (#http://localhost:8080). If you changed this to a valid URL, you could access it at http://<your_hostname>:<your_port>/proxy/example.

If your server was running on port 8080 and you set up a proxy to port 7000, then http://localhost:8080/proxy/example/foo/bar/baz would proxy to http://localhost:7000/foo/bar/baz

mime.types

  • Type: DIR

This directory tells mhttpd which MIME type to use for different file extensions. You may add more file types if desired, but most users will not need to touch this directory. Each entry in this directory is a STRING, where the key specifies the file extension (in upper case with a preceeding period, e.g. .PNG) and the value is the MIME type to use (e.g. image/png). MIME types tell web browsers what to do with different file types.