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__"
20 SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
21 SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
23 <Directory "__OPAC_WWW_DIR__">
27 # Secure internal stuff
28 <DirectoryMatch "__OPAC_WWW_DIR__/.*/(modules|xslt|includes)">
36 mod_gzip_keep_workfiles No
37 mod_gzip_can_negotiate yes
38 mod_gzip_update_static No
39 mod_gzip_temp_dir /tmp
40 mod_gzip_minimum_file_size 512
41 mod_gzip_maximum_file_size 1000000
42 mod_gzip_maximum_inmem_size 1000000
43 mod_gzip_handle_methods GET POST
44 mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
45 mod_gzip_item_exclude mime ^image/.*
46 mod_gzip_item_exclude rspheader Content-Type:image/*
47 mod_gzip_item_include file \.js$
48 mod_gzip_item_include mime ^application/javascript$
49 mod_gzip_item_include mime ^application/x-javascript$
50 mod_gzip_item_include file \.php$
51 mod_gzip_item_include mime ^text/html$
52 mod_gzip_item_include file \.css$
53 mod_gzip_item_include mime ^text/css$
56 <IfModule mod_deflate.c>
58 # Compress content with type html, text, and css, ...
59 AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
60 AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
62 DeflateCompressionLevel 9
64 # Properly handle old browsers that do not support compression
65 BrowserMatch ^Mozilla/4 gzip-only-text/html
66 BrowserMatch ^Mozilla/4\.0[678] no-gzip
67 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
69 DeflateFilterNote Input instream
70 DeflateFilterNote Output outstream
71 DeflateFilterNote Ratio ratio
73 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
74 <IfModule mod_headers.c>
75 #properly handle requests coming from behind proxies
76 Header append Vary User-Agent
81 # Repeat this virtualhost stanza changing the following environment vars to
82 # create multiple OPAC interfaces with custom css and/or search limits:
83 # SetEnv OPAC_CSS_OVERRIDE mystyle.css
84 # SetEnv OPAC_SEARCH_LIMIT branch:CODE
85 # SetEnv OPAC_LIMIT_OVERRIDE 1
87 Options +FollowSymLinks
89 ErrorDocument 400 /cgi-bin/koha/errors/400.pl
90 ErrorDocument 401 /cgi-bin/koha/errors/401.pl
91 ErrorDocument 403 /cgi-bin/koha/errors/403.pl
92 ErrorDocument 404 /cgi-bin/koha/errors/404.pl
93 ErrorDocument 500 /cgi-bin/koha/errors/500.pl
95 <IfModule mod_rewrite.c>
99 # Uncomment to turn on rewrite logging
100 #RewriteLog __LOG_DIR__/koha-opac-rewrite.log
103 RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*)
104 #RewriteRule (.+) $1?%1%2 [N,R,NE]
105 RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT]
106 RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
107 RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
112 <VirtualHost __WEBSERVER_IP__:__WEBSERVER_PORT_LIBRARIAN__>
113 ServerAdmin __WEBMASTER_EMAIL__
114 DocumentRoot __INTRANET_WWW_DIR__
115 ServerName __WEBSERVER_HOST__:__WEBSERVER_PORT_LIBRARIAN__
116 # ServerAlias intranet.mydomain.com
117 ScriptAlias /cgi-bin/koha/ "__INTRANET_CGI_DIR__/"
118 ScriptAlias /index.html "__INTRANET_CGI_DIR__/mainpage.pl"
119 ScriptAlias /search "__INTRANET_CGI_DIR__/search.pl"
120 Alias /plugin/ "__PLUGINS_DIR__/"
121 ErrorLog __LOG_DIR__/koha-error_log
122 # TransferLog __LOG_DIR__/koha-access.log
123 SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
124 SetEnv PERL5LIB "__PERL_MODULE_DIR__"
125 SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__"
126 SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__"
127 Options +FollowSymLinks
129 ErrorDocument 400 /cgi-bin/koha/errors/400.pl
130 ErrorDocument 401 /cgi-bin/koha/errors/401.pl
131 ErrorDocument 403 /cgi-bin/koha/errors/403.pl
132 ErrorDocument 404 /cgi-bin/koha/errors/404.pl
133 ErrorDocument 500 /cgi-bin/koha/errors/500.pl
135 <Directory "__INTRANET_WWW_DIR__">
139 # Secure internal stuff
140 <DirectoryMatch "__INTRANET_WWW_DIR__/.*/(modules|xslt|includes)">
145 <IfModule mod_gzip.c>
148 mod_gzip_keep_workfiles No
149 mod_gzip_can_negotiate yes
150 mod_gzip_update_static No
151 mod_gzip_temp_dir /tmp
152 mod_gzip_minimum_file_size 512
153 mod_gzip_maximum_file_size 1000000
154 mod_gzip_maximum_inmem_size 1000000
155 mod_gzip_handle_methods GET POST
156 mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
157 mod_gzip_item_exclude mime ^image/.*
158 mod_gzip_item_exclude rspheader Content-Type:image/*
159 mod_gzip_item_include file \.js$
160 mod_gzip_item_include mime ^application/javascript$
161 mod_gzip_item_include mime ^application/x-javascript$
162 mod_gzip_item_include file \.php$
163 mod_gzip_item_include mime ^text/html$
164 mod_gzip_item_include file \.css$
165 mod_gzip_item_include mime ^text/css$
168 <IfModule mod_deflate.c>
170 # Compress content with type html, text, and css, ...
171 AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css
172 AddOutputFilterByType DEFLATE application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
174 DeflateCompressionLevel 9
176 # Properly handle old browsers that do not support compression
177 BrowserMatch ^Mozilla/4 gzip-only-text/html
178 BrowserMatch ^Mozilla/4\.0[678] no-gzip
179 BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
181 DeflateFilterNote Input instream
182 DeflateFilterNote Output outstream
183 DeflateFilterNote Ratio ratio
185 LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
186 <IfModule mod_headers.c>
187 #properly handle requests coming from behind proxies
188 Header append Vary User-Agent
192 <IfModule mod_rewrite.c>
196 # Uncomment to turn on rewrite logging
197 #RewriteLog __LOG_DIR__/koha-intranet-rewrite.log
200 RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*)
201 #RewriteRule (.+) $1?%1%2 [N,R,NE]
202 RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT]
203 RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
204 RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]