Bug 7804 - Add Koha Plugin System
[koha-equinox.git] / etc / koha-httpd.conf
1 # Koha Apache Configuration Directives
2
3 #NameVirtualHost *
4
5 ## OPAC
6 <VirtualHost __WEBSERVER_IP__:__WEBSERVER_PORT__>
7    ServerAdmin  __WEBMASTER_EMAIL__
8    DocumentRoot __OPAC_WWW_DIR__
9    ServerName __WEBSERVER_HOST__
10 #  ServerAlias opac.mydomain.com
11    ScriptAlias /cgi-bin/koha/ "__OPAC_CGI_DIR__/opac/"
12    ScriptAlias /index.html "__OPAC_CGI_DIR__/opac/opac-main.pl"
13    ScriptAlias /opac-search.pl "__OPAC_CGI_DIR__/opac/opac-search.pl"
14    ScriptAlias /search "__OPAC_CGI_DIR__/opac/opac-search.pl"
15    ErrorLog __LOG_DIR__/koha-opac-error_log
16 #  CustomLog __LOG_DIR__/koha-opac-access.log combined
17 #  TransferLog __LOG_DIR__/koha-opac-access.log
18    SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
19    SetEnv PERL5LIB "__PERL_MODULE_DIR__"
20    SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
21    SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
22
23    <IfModule mod_gzip.c>
24      mod_gzip_on yes
25      mod_gzip_dechunk yes
26      mod_gzip_keep_workfiles No
27      mod_gzip_can_negotiate yes
28      mod_gzip_update_static No
29      mod_gzip_temp_dir /tmp
30      mod_gzip_minimum_file_size 512
31      mod_gzip_maximum_file_size 1000000
32      mod_gzip_maximum_inmem_size 1000000
33      mod_gzip_handle_methods GET POST
34      mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
35      mod_gzip_item_exclude mime ^image/.*
36      mod_gzip_item_exclude rspheader Content-Type:image/*
37      mod_gzip_item_include file \.js$
38      mod_gzip_item_include mime ^application/javascript$
39      mod_gzip_item_include mime ^application/x-javascript$
40      mod_gzip_item_include file \.php$
41      mod_gzip_item_include mime ^text/html$
42      mod_gzip_item_include file \.css$
43      mod_gzip_item_include mime ^text/css$
44   </IfModule>
45
46   <IfModule mod_deflate.c>
47
48     # Compress content with type html, text, and css, ...
49     AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
50     AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
51
52     DeflateCompressionLevel 9
53
54     # Properly handle old browsers that do not support compression
55     BrowserMatch ^Mozilla/4 gzip-only-text/html
56     BrowserMatch ^Mozilla/4\.0[678] no-gzip
57     BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
58
59     DeflateFilterNote Input instream
60     DeflateFilterNote Output outstream
61     DeflateFilterNote Ratio ratio
62
63     LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
64     <IfModule mod_headers.c>
65        #properly handle requests coming from behind proxies
66        Header append Vary User-Agent
67     </IfModule>
68   </IfModule>
69
70
71 #  Repeat this virtualhost stanza changing the following environment vars to
72 #  create multiple OPAC interfaces with custom css and/or search limits:
73 #  SetEnv OPAC_CSS_OVERRIDE mystyle.css
74 #  SetEnv OPAC_SEARCH_LIMIT branch:CODE
75 #  SetEnv OPAC_LIMIT_OVERRIDE 1
76
77    Options +FollowSymLinks
78
79    ErrorDocument 400 /cgi-bin/koha/errors/400.pl
80    ErrorDocument 401 /cgi-bin/koha/errors/401.pl
81    ErrorDocument 403 /cgi-bin/koha/errors/403.pl
82    ErrorDocument 404 /cgi-bin/koha/errors/404.pl
83    ErrorDocument 500 /cgi-bin/koha/errors/500.pl
84
85 #  Rewrite Rules
86    RewriteEngine On
87
88 #  Uncomment to turn on rewrite logging
89 #  RewriteLog __LOG_DIR__/koha-opac-rewrite.log
90 #  RewriteLogLevel 1
91    RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*)
92    RewriteRule (.+) $1?%1%2 [N,R,NE]
93
94    RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT]
95    RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
96    RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
97 </VirtualHost>
98
99 ## Intranet
100 <VirtualHost __WEBSERVER_IP__:__WEBSERVER_PORT_LIBRARIAN__>
101    ServerAdmin __WEBMASTER_EMAIL__
102    DocumentRoot __INTRANET_WWW_DIR__
103    ServerName __WEBSERVER_HOST__:__WEBSERVER_PORT_LIBRARIAN__
104 #  ServerAlias intranet.mydomain.com
105    ScriptAlias /cgi-bin/koha/ "__INTRANET_CGI_DIR__/"
106    ScriptAlias /index.html "__INTRANET_CGI_DIR__/mainpage.pl"
107    ScriptAlias /search "__INTRANET_CGI_DIR__/search.pl"
108    Alias /plugin/ "__PLUGINS_DIR__/"
109    ErrorLog __LOG_DIR__/koha-error_log
110 #  TransferLog __LOG_DIR__/koha-access.log
111    SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
112    SetEnv PERL5LIB "__PERL_MODULE_DIR__"
113    SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
114    SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
115    Options +FollowSymLinks
116
117    ErrorDocument 400 /cgi-bin/koha/errors/400.pl
118    ErrorDocument 401 /cgi-bin/koha/errors/401.pl
119    ErrorDocument 403 /cgi-bin/koha/errors/403.pl
120    ErrorDocument 404 /cgi-bin/koha/errors/404.pl
121    ErrorDocument 500 /cgi-bin/koha/errors/500.pl
122
123    <IfModule mod_gzip.c>
124      mod_gzip_on yes
125      mod_gzip_dechunk yes
126      mod_gzip_keep_workfiles No
127      mod_gzip_can_negotiate yes
128      mod_gzip_update_static No
129      mod_gzip_temp_dir /tmp
130      mod_gzip_minimum_file_size 512
131      mod_gzip_maximum_file_size 1000000
132      mod_gzip_maximum_inmem_size 1000000
133      mod_gzip_handle_methods GET POST
134      mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
135      mod_gzip_item_exclude mime ^image/.*
136      mod_gzip_item_exclude rspheader Content-Type:image/*
137      mod_gzip_item_include file \.js$
138      mod_gzip_item_include mime ^application/javascript$
139      mod_gzip_item_include mime ^application/x-javascript$
140      mod_gzip_item_include file \.php$
141      mod_gzip_item_include mime ^text/html$
142      mod_gzip_item_include file \.css$
143      mod_gzip_item_include mime ^text/css$
144    </IfModule>
145
146    <IfModule mod_deflate.c>
147
148      # Compress content with type html, text, and css, ...
149      AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
150      AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
151
152      DeflateCompressionLevel 9
153
154      # Properly handle old browsers that do not support compression
155      BrowserMatch ^Mozilla/4 gzip-only-text/html
156      BrowserMatch ^Mozilla/4\.0[678] no-gzip
157      BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
158
159      DeflateFilterNote Input instream
160      DeflateFilterNote Output outstream
161      DeflateFilterNote Ratio ratio
162
163      LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
164      <IfModule mod_headers.c>
165        #properly handle requests coming from behind proxies
166        Header append Vary User-Agent
167      </IfModule>
168   </IfModule>
169
170    RewriteEngine On    
171 #  Uncomment to turn on rewrite logging
172 #  RewriteLog __LOG_DIR__/koha-intranet-rewrite.log
173 #  RewriteLogLevel 1
174
175    RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*)
176    RewriteRule (.+) $1?%1%2 [N,R,NE]
177    RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT]
178    RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
179    RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
180 </VirtualHost>