File: options.h.in

package info (click to toggle)
weborf 0.13-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 916 kB
  • ctags: 429
  • sloc: ansic: 3,069; sh: 1,165; python: 535; makefile: 76
file content (125 lines) | stat: -rw-r--r-- 5,313 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
Weborf
Copyright (C) 2007  Salvo "LtWorf" Tomaselli

Weborf is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

@author Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it>
 */

#include "config.h"
#include <unistd.h> //Needed because it defines the _POSIX_IPV6

#ifndef WEBORF_OPTIONS_H
#define WEBORF_OPTIONS_H

#define NAME PACKAGE
//#define VERSION PACKAGE_VERSION
#define SIGNATURE NAME "/" VERSION  " (GNU/Linux)"

//----------System
#define ROOTUID 0               //Uid for superuser

//----------Network
#define MAXQ 40                 //Queue for connect requests
#define PORT "8080"             //Default port

#ifdef _POSIX_IPV6              //Enables ipv6 if supported
//Delete the following line to use IPv4 instead.
#define IPV6
#endif

//-----------Threads
#define MAXTHREAD 300           //Max threads
#define INITIALTHREAD 12        //Thread started when free threads are low and when starting
#define LOWTHREAD 3             //Minimum number of free threads, before starting new ones
#define MAXFREETHREAD 12        //Maximum number of free threads, before starting to slowly close them
#define THREADCONTROL 10        //Polling frequence in seconds

//------------Server
#define INDEX "index.html"      //Default index file that weborf will search
#define BASEDIR "/var/www"      //Default basedir
#define READ_TIMEOUT 5000       //Timeout before closing inactive keep-alive connections, in milliseconds

//------------Buffers
#define INBUFFER 1024           //Size for buffer with the HTTP request
#define FILEBUF 4096            //Size of reads
#define MAXSCRIPTOUT  512000    //Maximum size for a page generated by a script or internally
#define HEADBUF 1024            //Buffer for headers
#define PWDLIMIT 300            //Max size for password
#define INDEXMAXLEN 30
#define NBUFFER 15              //Buffer to contain the string representation of an integer
#define RBUFFER 128             //Buffer to contain a range
#define BUFFERED_READER_SIZE 2048
#define DATEBUFFER 50           //Buffer for text date
#define URI_LEN 256
#define PATH_LEN 1024
#define MIMETYPELEN 15          //Size of mimetype string

//Number of index pages allowed to search
#define MAXINDEXCOUNT 10

//-------------LIMITS
#define POST_MAX_SIZE 2000000   //Maximum allowed size for POST data

//-------------HTML
#define HTMLHEAD "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"><html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\"><head><title>" NAME "</title><style type=\"text/css\">a, a:active {text-decoration: none; color: blue;}a:visited {color: #48468F;}a:hover, a:focus {text-decoration: underline; color: red;}body {background-color: #F5F5F5;}h2 {margin-bottom: 12px;}table {margin-left: 12px;}th, td { font: 90% monospace; text-align: left;}th { font-weight: bold; padding-right: 14px; padding-bottom: 3px;}td {padding-right: 14px;}td.s, th.s {text-align: right;}div.list { background-color: white; border-top: 1px solid #646464; border-bottom: 1px solid #646464; padding-top: 10px; padding-bottom: 14px;}div.foot { font: 90% monospace; color: #787878; padding-top: 4px;}</style></head><body><div class=\"list\"> "
#define HTMLFOOT "</div><div class=\"foot\">" SIGNATURE "</div></body></html> "

//#define HTMLHEAD "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><title>" NAME "</title></head><body>"
//#define HTMLFOOT "<p>Generated by " SIGNATURE "</p></body></html>"

//-------------SCRIPTS
#define SCRPT_TIMEOUT 30        //Timeout for the scripts, in seconds
#define HIDE_CGI_ERRORS         //Hides all the errors.

//#define CGI_PHP "@cgibindir@/php5"
//#define CGI_PY "@cgibindir@/weborf_py_wrapper"
#define CGI_PHP "/usr/lib/cgi-bin/php5"
#define CGI_PY "/usr/lib/cgi-bin/weborf_py_wrapper"

//-------------COMPRESSING PAGES
//#define __COMPRESSION         //enables support for compressing pages, comment to disable
#ifdef __COMPRESSION
#define SIZE_COMPRESS_MIN 512
#define SIZE_COMPRESS_MAX 4000000000
#define GZIPNICE 4              //Nice value for gzip process
#endif

//The following header can be disabled to increase a little the speed
//#define SEND_LAST_MODIFIED_HEADER

#ifdef HAVE_LIBMAGIC
#define SEND_MIMETYPES          //Enables support to sending the mimetype to the client
#endif


//-------------RANGE
#define __RANGE                 //Enables support to range (partial download)

//-------------WEBDAV
#define WEBDAV                  //Enables webdav support
#ifdef WEBDAV
#define MAXPROPCOUNT 40         //Number of supported properties
#define HIDE_HIDDEN_FILES       //Hides hidden files
#endif

//-------------Logging options
//#define THREADDBG
//#define SOCKETDBG
//#define SENDINGDBG
#define SERVERDBG
#define REQUESTDBG

#endif