PageRenderTime 50ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/config/lispweb-init.lisp

http://github.com/kmi/irs
Lisp | 114 lines | 6 code | 42 blank | 66 comment | 0 complexity | 3f2a350fd05c5c46bb01ee4c76190785 MD5 | raw file
Possible License(s): CC0-1.0
  1. ;;; Sample initialization file for the LispWeb server.
  2. ;;; When starting up, the server first loads the file whose name is
  3. ;;; the value of *LispWeb-init-file* in the directory indicated in
  4. ;;; *LispWeb-conf-dir*; subsequently, it looks for *LispWeb-init-file*
  5. ;;; (with a prepended ".") in the user's personal directory. Specific
  6. ;;; options can also be passed to START-TCP-SERVICES, e.g.
  7. ;;; (START-TCP-SERVICES '(*http-port* 8080 *eval-port* 8081))
  8. (in-package :http)
  9. ;;; General setup - Ports, root directory, init file.
  10. ;;; This sets the TCP port used by the HTTP server. The standard value is
  11. ;;; 80, but you must be root to use it, and it might not be a wise
  12. ;;; thing to do for security reasons.
  13. (setq *http-port* 3000)
  14. ;;; The TCP port used by the Telnet listener. Set to NIL to disable it.
  15. (setq *eval-port* 3001)
  16. ;;; This is the path to the root of the server file system.
  17. ;;; (setq *lispweb-default-dir* "/users/ipvaim/staff/Alberto/lisp/http/stuff/")
  18. ;;; The name of the initialization file to load at startup.
  19. ;;; (It makes very little sense to change it from here :))
  20. ;;; (setq *lispweb-init-file* "lispweb-init.lisp")
  21. ;;; The email address of the server operator. NOTE: the hostname is
  22. ;;; required.
  23. ;;; (setq *operator-address* "alb@ipvaim")
  24. ;;; The password to use the setup page and the Network Listener.
  25. (setq *operator-password* "On The Run")
  26. ;;; Set to T if you want Lisp source for all pages to be visible by default.
  27. ;;; (setq *LispWeb-visible-pages* nil)
  28. ;;; Timeout for Keep-alive connections in seconds (not working yet)
  29. ;;; (setq *http-keepalive-timeout* 10)
  30. ;;; Allow serving regular HTML files? (Might be dangerous...)
  31. ;;; (setq *LispWeb-allow-html-files* nil)
  32. ;;; Allow the server to enter the debugger in case of errors?
  33. ;;; (setq *LispWeb-debug* nil)
  34. ;;; Logging - Log streams can be changed at run-time with the
  35. ;;; LW-SET-LOG function, e.g. (lw-set-log :debug nil).
  36. ;;; The name of the log file for server requests. Set to NIL to
  37. ;;; disable logging, or to T to send messages to standard output.
  38. (setq *lispweb-log-file* (translate-logical-pathname "irs:log;lispweb-log-file.txt"))
  39. ;;; The name of the log file for debugging info. Set to NIL to disable
  40. ;;; logging, or to T to send messages to standard output.
  41. (setq *lispweb-debug-file* (translate-logical-pathname "irs:log;lispweb-debug-file.txt"))
  42. ;;; The name of the log file for timing info. Set to NIL to disable
  43. ;;; logging, or to T to send messages to standard output.
  44. ;;; (setq *lispweb-timing-file* nil)
  45. ;;; Robot access - contents of the /robots.txt file, used to prevent
  46. ;;; robots from accessing the server.
  47. ;;; (setq *LispWeb-robots-txt* "")
  48. ;;; Server extensions -
  49. ;;; The HTTP-REPLY generic function can be specialized in order to
  50. ;;; define new methods:
  51. ;;; (defmethod http-reply ((method :stat) request)
  52. ;;; "Handle requests of the form: STAT request HTTP/1.0"
  53. ;;; (handle-stat-request request))
  54. ;;; The HTTP-DELIVER generic function can be specialized to handle
  55. ;;; different file types in GET requests. The file type must be
  56. ;;; added to the list of known file types, identified by a name
  57. ;;; and a keyword. Example:
  58. ;;; (setq *lispweb-type-table*
  59. ;;; (add-obj *lispweb-type-table* "/xdb" :xdb))
  60. ;;; (defmethod http-deliver ((type (eql :xdb)) request)
  61. ;;; "Handle requests of the form GET /xdb/request HTTP/1.0"
  62. ;;; (serve-xdb-file request))
  63. ;;; The HTTP-LOG generic function can be specialized to modify
  64. ;;; the way logging takes place. The two defined methods are:
  65. ;;; defmethod http-log ((info http-info))
  66. ;;; defmethod http-log ((message string))
  67. ;;; The first one is the top-level logging function, it is called
  68. ;;; after the request has been processed with the *http-info*
  69. ;;; structure as argument. Redefine it to change *what* will be logged.
  70. ;;; The second one deals with the actual output of the log message,
  71. ;;; putting it in the appropriate format. Redefine this to change
  72. ;;; *how* requests are logged.