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