1 # Koha Apache Configuration Directives
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 # TransferLog __LOG_DIR__/koha-opac-access_log
17 SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
18 SetEnv PERL5LIB "__PERL_MODULE_DIR__"
23 mod_gzip_keep_workfiles No
24 mod_gzip_can_negotiate yes
25 mod_gzip_update_static No
26 mod_gzip_temp_dir /tmp
27 mod_gzip_minimum_file_size 512
28 mod_gzip_maximum_file_size 1000000
29 mod_gzip_maximum_inmem_size 1000000
30 mod_gzip_handle_methods GET POST
31 mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
32 mod_gzip_item_exclude mime ^image/.*
33 mod_gzip_item_exclude rspheader Content-Type:image/*
34 mod_gzip_item_include file \.js$
35 mod_gzip_item_include mime ^application/javascript$
36 mod_gzip_item_include mime ^application/x-javascript$
37 mod_gzip_item_include file \.php$
38 mod_gzip_item_include mime ^text/html$
39 mod_gzip_item_include file \.css$
40 mod_gzip_item_include mime ^text/css$
43 <IfModule mod_deflate.c>
45 # Compress content with type html, text, and css, ...
46 AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
47 AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
49 DeflateCompressionLevel 9
51 # Properly handle old browsers that do not support compression
52 BrowserMatch ^Mozilla/4 gzip-only-text/html
53 BrowserMatch ^Mozilla/4\.0[678] no-gzip
54 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
56 DeflateFilterNote Input instream
57 DeflateFilterNote Output outstream
58 DeflateFilterNote Ratio ratio
60 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
61 <IfModule mod_headers.c>
62 #properly handle requests coming from behind proxies
63 Header append Vary User-Agent
68 # Repeat this virtualhost stanza changing the following environment vars to
69 # create multiple OPAC interfaces with custom css and/or search limits:
70 # SetEnv OPAC_CSS_OVERRIDE mystyle.css
71 # SetEnv OPAC_SEARCH_LIMIT branch:CODE
72 # SetEnv OPAC_LIMIT_OVERRIDE 1
74 Options +FollowSymLinks
76 ErrorDocument 400 /cgi-bin/koha/errors/400.pl
77 ErrorDocument 401 /cgi-bin/koha/errors/401.pl
78 ErrorDocument 403 /cgi-bin/koha/errors/403.pl
79 ErrorDocument 404 /cgi-bin/koha/errors/404.pl
80 ErrorDocument 500 /cgi-bin/koha/errors/500.pl
85 # Uncomment to turn on rewrite logging
86 # RewriteLog __LOG_DIR__/koha-opac-rewrite.log
88 RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*)
89 RewriteRule (.+) $1?%1%2 [N,R,NE]
91 RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT]
92 RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
93 RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
97 <VirtualHost __WEBSERVER_IP__:__WEBSERVER_PORT_LIBRARIAN__>
98 ServerAdmin __WEBMASTER_EMAIL__
99 DocumentRoot __INTRANET_WWW_DIR__
100 ServerName __WEBSERVER_HOST__:__WEBSERVER_PORT_LIBRARIAN__
101 # ServerAlias intranet.mydomain.com
102 ScriptAlias /cgi-bin/koha/ "__INTRANET_CGI_DIR__/"
103 ScriptAlias /index.html "__INTRANET_CGI_DIR__/mainpage.pl"
104 ScriptAlias /search "__INTRANET_CGI_DIR__/search.pl"
105 ErrorLog __LOG_DIR__/koha-error_log
106 # TransferLog __LOG_DIR__/koha-access_log
107 SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
108 SetEnv PERL5LIB "__PERL_MODULE_DIR__"
109 Options +FollowSymLinks
111 ErrorDocument 400 /cgi-bin/koha/errors/400.pl
112 ErrorDocument 401 /cgi-bin/koha/errors/401.pl
113 ErrorDocument 403 /cgi-bin/koha/errors/403.pl
114 ErrorDocument 404 /cgi-bin/koha/errors/404.pl
115 ErrorDocument 500 /cgi-bin/koha/errors/500.pl
117 <IfModule mod_gzip.c>
120 mod_gzip_keep_workfiles No
121 mod_gzip_can_negotiate yes
122 mod_gzip_update_static No
123 mod_gzip_temp_dir /tmp
124 mod_gzip_minimum_file_size 512
125 mod_gzip_maximum_file_size 1000000
126 mod_gzip_maximum_inmem_size 1000000
127 mod_gzip_handle_methods GET POST
128 mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
129 mod_gzip_item_exclude mime ^image/.*
130 mod_gzip_item_exclude rspheader Content-Type:image/*
131 mod_gzip_item_include file \.js$
132 mod_gzip_item_include mime ^application/javascript$
133 mod_gzip_item_include mime ^application/x-javascript$
134 mod_gzip_item_include file \.php$
135 mod_gzip_item_include mime ^text/html$
136 mod_gzip_item_include file \.css$
137 mod_gzip_item_include mime ^text/css$
140 <IfModule mod_deflate.c>
142 # Compress content with type html, text, and css, ...
143 AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
144 AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
146 DeflateCompressionLevel 9
148 # Properly handle old browsers that do not support compression
149 BrowserMatch ^Mozilla/4 gzip-only-text/html
150 BrowserMatch ^Mozilla/4\.0[678] no-gzip
151 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
153 DeflateFilterNote Input instream
154 DeflateFilterNote Output outstream
155 DeflateFilterNote Ratio ratio
157 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
158 <IfModule mod_headers.c>
159 #properly handle requests coming from behind proxies
160 Header append Vary User-Agent
165 # Uncomment to turn on rewrite logging
166 # RewriteLog __LOG_DIR__/koha-intranet-rewrite.log
169 RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*)
170 RewriteRule (.+) $1?%1%2 [N,R,NE]
171 RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT]
172 RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
173 RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]