mighttpd2 2.0.0 → 2.0.1
raw patch · 6 files changed
+53/−21 lines, 6 files
Files
- Config/Internal.hs +15/−12
- Mighty.hs +4/−6
- Types.hs +1/−1
- mighttpd2.cabal +3/−2
- sample.conf +14/−0
- sample.route +16/−0
Config/Internal.hs view
@@ -23,6 +23,7 @@ , opt_log_buffer_size = 16384 , opt_log_flush_period = 10 , opt_index_file = "index.html"+ , opt_connection_timeout = 30 , opt_server_name = programName ++ "/" ++ programVersion } @@ -38,6 +39,7 @@ , opt_log_buffer_size :: !Int , opt_log_flush_period :: !Int , opt_index_file :: !String+ , opt_connection_timeout :: !Int , opt_server_name :: !String } deriving (Eq,Show) @@ -50,18 +52,19 @@ makeOpt :: Option -> [Conf] -> Option makeOpt def conf = Option {- opt_port = get "Port" opt_port- , opt_debug_mode = get "Debug_Mode" opt_debug_mode- , opt_user = get "User" opt_user- , opt_group = get "Group" opt_group- , opt_pid_file = get "Pid_File" opt_pid_file- , opt_log_file = get "Log_File" opt_log_file- , opt_log_file_size = get "Log_File_Size" opt_log_file_size- , opt_log_backup_number = get "Log_Backup_Number" opt_log_backup_number- , opt_log_buffer_size = get "Log_Buffer_Size" opt_log_buffer_size- , opt_log_flush_period = get "Log_Flush_Period" opt_log_flush_period- , opt_index_file = get "Index_File" opt_index_file- , opt_server_name = get "Server_Name" opt_server_name+ opt_port = get "Port" opt_port+ , opt_debug_mode = get "Debug_Mode" opt_debug_mode+ , opt_user = get "User" opt_user+ , opt_group = get "Group" opt_group+ , opt_pid_file = get "Pid_File" opt_pid_file+ , opt_log_file = get "Log_File" opt_log_file+ , opt_log_file_size = get "Log_File_Size" opt_log_file_size+ , opt_log_backup_number = get "Log_Backup_Number" opt_log_backup_number+ , opt_log_buffer_size = get "Log_Buffer_Size" opt_log_buffer_size+ , opt_log_flush_period = get "Log_Flush_Period" opt_log_flush_period+ , opt_index_file = get "Index_File" opt_index_file+ , opt_connection_timeout = get "Connection_Timeout" opt_connection_timeout+ , opt_server_name = get "Server_Name" opt_server_name } where get k func = maybe (func def) fromConf $ lookup k conf
Mighty.hs view
@@ -40,7 +40,7 @@ unless debug writePidFile setGroupUser opt chan <- if debug then setoutInit else fileInit logspec- serveConnections ignore port (fileCgiApp (spec chan) route) s+ serveConnections' setting (fileCgiApp (spec chan) route) s where debug = opt_debug_mode opt port = opt_port opt@@ -59,13 +59,11 @@ , log_buffer_size = opt_log_buffer_size opt , log_flush_period = opt_log_flush_period opt * 1000000 }-{-- warpspec = defaultSettings {- settingsPort = opt_port opt+ setting = defaultSettings {+ settingsPort = opt_port opt , settingsOnException = ignore- , settingsTimeout = 30+ , settingsTimeout = opt_connection_timeout opt }--} pidfile = opt_pid_file opt writePidFile = do pid <- getProcessID
Types.hs view
@@ -15,4 +15,4 @@ programName = "Mighttpd" programVersion :: String-programVersion = "2.0.0"+programVersion = "2.0.1"
mighttpd2.cabal view
@@ -1,5 +1,5 @@ Name: mighttpd2-Version: 2.0.0+Version: 2.0.1 Author: Kazu Yamamoto <kazu@iij.ad.jp> Maintainer: Kazu Yamamoto <kazu@iij.ad.jp> License: BSD3@@ -8,9 +8,10 @@ Description: A classical web server on WAI/warp. Static files and CGI can be handled. Homepage: http://www.mew.org/~kazu/proj/mighttpd/-Category: Distribution+Category: Network, Web Cabal-Version: >= 1.6 Build-Type: Simple+Data-Files: sample.conf sample.route Executable mighty Main-Is: Mighty.hs if impl(ghc >= 6.12)
+ sample.conf view
@@ -0,0 +1,14 @@+# Sample configuration for Mighttpd 2+Port: 80+Debug_Mode: Yes # Yes or No+User: nobody+Group: nobody+Pid_File: /var/run/mighty.pid+Log_File: /var/log/mighty # The directory must be writable by Users:+Log_File_Size: 16777216 # bytes+Log_Backup_Number: 10 # seconds+Log_Buffer_Size: 16384 # bytes+Log_Flush_Period: 10 # seconds+Index_File: index.html+Connection_Timeout: 30 # seconds+# Server_Name: Mighttpd/2.x.y
+ sample.route view
@@ -0,0 +1,16 @@+# Sample routing for Mighttpd 2++# Domain lists+[localhost www.example.com]++# Entries are looked up in the specified order+# All paths must end with "/"++# A path to CGI scripts should be specified with "=>"+/~alice/cgi-bin/ => /home/alice/public_html/cgi-bin/++# A path to static files should be specified with "->"+/~alice/ -> /home/alice/public_html/++/cgi-bin/ => /export/cgi-bin/+/ -> /export/www/