# mathopd.conf
# configure mathopd to run under perp supervision
# (configuration for mathopd-1.6b9 on netbsd 5.0)
# wcm, 2009.12.31 - 2010.01.05
# ===

## secure umask:
Umask 026

## unprivileged user:
User mathopd
StayRoot On

## pid file unnecessary with perpetrate:
#PIDFile

##
## logging:
## direct all logging to stderr for tinylog:
##
Log  /dev/stderr
ErrorLog /dev/stderr


##
## tuning:
##
Tuning {
  NumConnections 64
  BufSize 12288
  InputBufSize 2048
  ScriptBufSize 4096
  NumHeaders 100
  Timeout 60
  ScriptTimeout 60
}


##
## default controls:
##
## IMPORTANT:
## default Control block **must precede** Server block!
## (empirical)
##
Control {
  ChildLog /dev/stderr
  Types {
      text/html  { .html .htm }
      text/css   { .css }
      text/plain { .txt }
      image/gif  { .gif }
      image/jpeg { .jpg }
      image/png  { .png }
      application/octet-stream { * }
  }
  # ScriptUser must be different from User:
  ScriptUser mathopd-cgi
  Specials {
      Dump { /dump }
      CGI  { .cgi }
      Imagemap { map }
      Redirect { url }
  }
  External {
      /usr/local/bin/php { php }
  }
  IndexNames { index.html }
}


##
## server:
##
Server {
## specifying ipv4 only:
  Family inet
## listen on any interface address:
  Address 0.0.0.0
## change to listen on non-standard port:
  Port 80
## define default document root:
  Virtual {
    AnyHost
    Control {
      Alias /
      Location /var/www
    }
  }
## virtual host example: thedjbway:
  Virtual {
      Host thedjbway.org
      Host www.thedjbway.org
      Control {
          Alias /
          Location /var/public/mathopd/thedjbway.org
      }
  }
## virtual host example (running cgi):
  Virtual {
      Host foobar.com
      Host www.foobar.com
      Control {
          Alias /
          Location /home/foobar/www
          IndexNames { index.html site.cgi }
          ## configure cgi environment (netbsd path example):
          #PutEnv { PATH=/usr/bin:/bin:/usr/pkg/bin }
      }
  }
 
}


##
## log format:
##
LogFormat {
  #Ctime
  #LocalAddress
  #LocalPort
  Status
  ServerName
  RemoteAddress
  #RemotePort
  Method
  URI
  QueryString
  UserAgent
}
LogGMT Off


### EOF (mathopd.conf)
