View | Details | Raw Unified | Return to bug 14747
Collapse All | Expand All

(-)a/etc/koha-httpd.conf (-57 / +24 lines)
Lines 27-32 Link Here
27
   # OVERRIDE_SYSPREF_NAMES for your staff intranet vhost
27
   # OVERRIDE_SYSPREF_NAMES for your staff intranet vhost
28
   # SetEnv OVERRIDE_SYSPREF_PrefName Value
28
   # SetEnv OVERRIDE_SYSPREF_PrefName Value
29
29
30
   ##REVERSE PROXY REQUESTS TO THE KOHA API DAEMON
31
   Alias /v1/doc __INTRANET_CGI_DIR__/api/v1/doc
32
   Alias /v1/swagger.json "__INTRANET_CGI_DIR__/api/v1/swagger.json"
33
34
   ProxyRequests Off #Disable anonymous forward proxying
35
   ProxyPreserveHost On
36
   ProxyPass        /v1/doc !
37
   ProxyPass        /v1/swagger.json !
38
   ProxyPass        /v1/  http://localhost:8081/v1/ keepalive=On
39
   ProxyPassReverse /v1/  http://localhost:8081/v1/
40
   ##REVERSE PROXYING OK
41
30
   <Directory "__OPAC_WWW_DIR__">
42
   <Directory "__OPAC_WWW_DIR__">
31
      Options -Indexes
43
      Options -Indexes
32
   </Directory>
44
   </Directory>
Lines 112-131 Link Here
112
     RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT]
124
     RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT]
113
     RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
125
     RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
114
     RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
126
     RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
115
116
     # REST API configuration
117
     Alias "/api" "__OPAC_CGI_DIR__/api"
118
     <Directory __OPAC_CGI_DIR__/api>
119
       Options +ExecCGI +FollowSymlinks
120
       AddHandler cgi-script .pl
121
122
       RewriteEngine On
123
       RewriteBase /api/
124
       RewriteCond %{REQUEST_FILENAME} !-f
125
       RewriteCond %{REQUEST_FILENAME} !-d
126
       RewriteCond %{DOCUMENT_ROOT}/../api/$1/app.pl -f
127
       RewriteRule ^(.*?)/.* $1/app.pl/api/$0 [L]
128
     </Directory>
129
   </IfModule>
127
   </IfModule>
130
</VirtualHost>
128
</VirtualHost>
131
129
Lines 158-163 Link Here
158
   ErrorDocument 404 /cgi-bin/koha/errors/404.pl
156
   ErrorDocument 404 /cgi-bin/koha/errors/404.pl
159
   ErrorDocument 500 /cgi-bin/koha/errors/500.pl
157
   ErrorDocument 500 /cgi-bin/koha/errors/500.pl
160
158
159
   ##REVERSE PROXY REQUESTS TO THE KOHA API DAEMON
160
   Alias /v1/doc __INTRANET_CGI_DIR__/api/v1/doc
161
   Alias /v1/swagger.json "__INTRANET_CGI_DIR__/api/v1/swagger.json"
162
163
   ProxyRequests Off #Disable anonymous forward proxying
164
   ProxyPreserveHost On
165
   ProxyPass        /v1/doc !
166
   ProxyPass        /v1/swagger.json !
167
   ProxyPass        /v1/  http://localhost:8081/v1/ keepalive=On
168
   ProxyPassReverse /v1/  http://localhost:8081/v1/
169
   ##REVERSE PROXYING OK
170
161
   <Directory "__INTRANET_WWW_DIR__">
171
   <Directory "__INTRANET_WWW_DIR__">
162
      Options -Indexes
172
      Options -Indexes
163
   </Directory>
173
   </Directory>
Lines 228-274 Link Here
228
     RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT]
238
     RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT]
229
     RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
239
     RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT]
230
     RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
240
     RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT]
231
232
233
     # REST API configuration
234
     Alias "/api" "__INTRANET_CGI_DIR__/api"
235
     <Directory __INTRANET_CGI_DIR__/api>
236
       Options +ExecCGI +FollowSymlinks
237
       AddHandler cgi-script .pl
238
239
       RewriteEngine On
240
       RewriteBase /api/
241
       RewriteCond %{REQUEST_FILENAME} !-f
242
       RewriteCond %{REQUEST_FILENAME} !-d
243
       RewriteCond %{DOCUMENT_ROOT}/../api/$1/app.pl -f
244
       RewriteRule ^(.*?)/.* $1/app.pl/api/$0 [L]
245
     </Directory>
246
   </IfModule>
241
   </IfModule>
247
</VirtualHost>
242
</VirtualHost>
248
249
# Uncomment this VirtualHost to enable API access through
250
# api.__WEBSERVER_HOST__:__WEBSERVER_PORT__
251
#<VirtualHost __WEBSERVER_IP__:__WEBSERVER_PORT__>
252
#  ServerAdmin __WEBMASTER_EMAIL__
253
#  DocumentRoot __INTRANET_CGI_DIR__/api
254
#  ServerName api.__WEBSERVER_HOST__:__WEBSERVER_PORT__
255
#  SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml"
256
#  SetEnv PERL5LIB "__PERL_MODULE_DIR__"
257
#  ErrorLog __LOG_DIR__/koha-api-error_log
258
#
259
#  <IfModule mod_rewrite.c>
260
#    <Directory __INTRANET_CGI_DIR__/api>
261
#      Options +ExecCGI +FollowSymlinks
262
#      AddHandler cgi-script .pl
263
#
264
#      RewriteEngine on
265
#
266
#      RewriteRule ^api/(.*) $1 [L]
267
#
268
#      RewriteCond %{REQUEST_FILENAME} !-f
269
#      RewriteCond %{REQUEST_FILENAME} !-d
270
#      RewriteCond %{DOCUMENT_ROOT}/$1/app.pl -f
271
#      RewriteRule ^(.*?)/.* $1/app.pl/api/$0 [L]
272
#    </Directory>
273
#  </IfModule>
274
#</VirtualHost>
275
- 

Return to bug 14747