X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=etc%2Fkoha-httpd.conf;h=a1fef2a814d5cd526a96b280c763a114c5e51770;hb=76bf4a898e38a76596ee198d893a8fbfa79a0bfb;hp=dd5ec4185c59833d6cc897847e31d7c897ae326a;hpb=8101d83af67f696fc12cc1830d9b51fd120ef6a4;p=koha-ffzg.git diff --git a/etc/koha-httpd.conf b/etc/koha-httpd.conf index dd5ec4185c..a1fef2a814 100644 --- a/etc/koha-httpd.conf +++ b/etc/koha-httpd.conf @@ -16,9 +16,14 @@ # CustomLog __LOG_DIR__/koha-opac-access.log combined # TransferLog __LOG_DIR__/koha-opac-access.log SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml" - SetEnv PERL5LIB "__PERL_MODULE_DIR__" - SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__" - SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__" + SetEnv PERL5LIB "__PERL5LIB_DIRS__" + + # This syntax allows you to override a system preference + # for a given virtual host. Use with caution! + # You should add all the system preferences you override + # in one or more vhosts to the environment variable + # OVERRIDE_SYSPREF_NAMES for your staff intranet vhost + # SetEnv OVERRIDE_SYSPREF_PrefName Value Options -Indexes @@ -26,8 +31,7 @@ # Secure internal stuff - Order deny,allow - Deny from all + Require all denied @@ -96,15 +100,33 @@ # Rewrite Rules RewriteEngine On - # Uncomment to turn on rewrite logging - #RewriteLog __LOG_DIR__/koha-opac-rewrite.log - #RewriteLogLevel 1 - - RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*) - #RewriteRule (.+) $1?%1%2 [N,R,NE] RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/opac-detail\.pl?bib=$1 [PT] RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] + RewriteRule ^(.*)_[0-9]{2}\.[0-9]{7}\.(js|css)$ $1.$2 [L] + + # REST API configuration + Alias "/api" "__API_CGI_DIR__" + + Options +ExecCGI +FollowSymlinks + AddHandler cgi-script .pl + + SetEnv MOJO_MODE "production" + + RewriteEngine On + RewriteBase /api/ + RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl + RewriteRule ^(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L] + + + + + + ExpiresActive on + ExpiresByType text/css "access plus 60 days" + ExpiresByType application/javascript "access plus 60 days" + ExpiresByType image/png "access plus 12 hours" + ExpiresByType image/gif "access plus 12 hours" @@ -116,16 +138,19 @@ # ServerAlias intranet.mydomain.com ScriptAlias /cgi-bin/koha/ "__INTRANET_CGI_DIR__/" ScriptAlias /index.html "__INTRANET_CGI_DIR__/mainpage.pl" - ScriptAlias /search "__INTRANET_CGI_DIR__/search.pl" + ScriptAlias /search "__INTRANET_CGI_DIR__/catalogue/search.pl" Alias /plugin/ "__PLUGINS_DIR__/" ErrorLog __LOG_DIR__/koha-error_log # TransferLog __LOG_DIR__/koha-access.log SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml" - SetEnv PERL5LIB "__PERL_MODULE_DIR__" - SetEnv MEMCACHED_SERVERS "__MEMCACHED_SERVERS__" - SetEnv MEMCACHED_NAMESPACE "__MEMCACHED_NAMESPACE__" + SetEnv PERL5LIB "__PERL5LIB_DIRS__" Options +FollowSymLinks + # If you are overriding any system preferences, + # list them in this variable so the preference editor + # knows that they have been overridden. + # SetEnv OVERRIDE_SYSPREF_NAMES "Pref1,Pref2,Pref3" + ErrorDocument 400 /cgi-bin/koha/errors/400.pl ErrorDocument 401 /cgi-bin/koha/errors/401.pl ErrorDocument 403 /cgi-bin/koha/errors/403.pl @@ -138,8 +163,10 @@ # Secure internal stuff - Order deny,allow - Deny from all + Require all denied + + Require all granted + @@ -193,14 +220,61 @@ # Rewrite Rules RewriteEngine On - # Uncomment to turn on rewrite logging - #RewriteLog __LOG_DIR__/koha-intranet-rewrite.log - #RewriteLogLevel 1 - - RewriteCond %{QUERY_STRING} (.*?)(?:[A-Za-z0-9_-]+)=&(.*) - #RewriteRule (.+) $1?%1%2 [N,R,NE] - RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/detail\.pl?bib=$1 [PT] + RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/catalogue/detail.pl?biblionumber=$1 [PT] RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] RewriteRule ^/issn/([^\/]*)/?$ /search?q=issn:$1 [PT] + RewriteRule ^(.*)_[0-9]{2}\.[0-9]{7}\.(js|css)$ $1.$2 [L] + + + # REST API configuration + Alias "/api" "__API_CGI_DIR__" + + Options +ExecCGI +FollowSymlinks + AddHandler cgi-script .pl + + SetEnv MOJO_MODE "production" + + RewriteEngine On + RewriteBase /api/ + RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl + RewriteRule ^(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L] + + + + + ExpiresActive on + ExpiresByType text/css "access plus 60 days" + ExpiresByType application/javascript "access plus 60 days" + ExpiresByType image/png "access plus 12 hours" + ExpiresByType image/gif "access plus 12 hours" + +# Uncomment this VirtualHost to enable API access through +# api.__WEBSERVER_HOST__:__WEBSERVER_PORT__ +# +# ServerAdmin __WEBMASTER_EMAIL__ +# DocumentRoot __INTRANET_CGI_DIR__/api +# ServerName api.__WEBSERVER_HOST__:__WEBSERVER_PORT__ +# SetEnv KOHA_CONF "__KOHA_CONF_DIR__/koha-conf.xml" +# SetEnv PERL5LIB "__PERL5LIB_DIRS__" +# ErrorLog __LOG_DIR__/koha-api-error_log +# +# +# +# Options +ExecCGI +FollowSymlinks +# AddHandler cgi-script .pl +# +# SetEnv MOJO_MODE "production" +# +# RewriteEngine on +# +# RewriteRule ^api/(.*) $1 [L] +# +# RewriteCond %{REQUEST_FILENAME} !-f +# RewriteCond %{REQUEST_FILENAME} !-d +# RewriteCond %{DOCUMENT_ROOT}/$1/app.pl -f +# RewriteRule ^(.*?)/.* $1/app.pl/api/$0 [L] +# +# +#