[ckan-dev] mounting CKAN at a non-root URL

Giuliano Veronese - Provincia di Pordenone veronese at provincia.pordenone.it
Fri Aug 14 07:40:28 UTC 2015


Hello Nigel,
thank you for your answer.
I can not link you the site because it is offline (virtual machine for 
experiments).

This is the output you asked:
{"Help": "Return a dictionary with information about the site's 
configuration.", "Success": true, "result": {"ckan_version": "2.1a", 
"site_url": "http: //catalog.data .gov "," site_description ":" "," 
SITE_TITLE ":" Data.gov "," error_emails_to ":" 
catalog-notification at googlegroups.com "," locale_default ":" en "," 
extensions ": [" geodatagov "," datagov_harvest "," 
geodatagov_geoportal_harvester "," z3950_harvester "," arcgis_harvester 
"," waf_harvester_collection "," geodatagov_csw_harvester "," 
geodatagov_doc_harvester "," geodatagov_waf_harvester "," 
spatial_metadata "," spatial_query "," resource_proxy "," 
spatial_harvest_metadata_api ", "recline_preview", "pdf_preview", 
"googleanalytics", "SAML2", "datajson", "datajson_harvest", "archiver", 
"qa", "ckan_harvester", "report", "broken_link_report", "datagovtheme", 
"extlink "]}}

I send you the contents of ckan file (/etc/apache2/sites-availables/ckan):

<VirtualHost *:80>
         ServerAdmin webmaster at localhost
         DocumentRoot /var/www

     ProxyPass        /geoserver   http://localhost:8090/geoserver
         ProxyPassReverse /geoserver http://localhost:8090/geoserver
         ProxyPass        /mapstore http://localhost:8081/mapstore
         ProxyPassReverse /mapstore http://localhost:8081/mapstore
         ProxyPass        /mapstore   ajp://localhost:8013/mapstore
         ProxyPassReverse /mapstore   ajp://localhost:8013/mapstore
         ProxyPass        /geostore   ajp://localhost:8013/geostore
         ProxyPassReverse /geostore   ajp://localhost:8013/geostore
         ProxyPass        /http_proxy ajp://localhost:8013/http_proxy
         ProxyPassReverse /http_proxy ajp://localhost:8013/http_proxy
         ProxyPass        /geonetwork http://localhost:8082/geonetwork
         ProxyPassReverse /geonetwork http://localhost:8082/geonetwork
         ProxyPass        /ckan http://localhost:5000
         ProxyPassReverse /ckan http://localhost:5000

         <Directory />
                 Options FollowSymLinks
                 AllowOverride None
         </Directory>

     <Directory /var/www/>
                 Options Indexes FollowSymLinks MultiViews
                 AllowOverride None
                 Order allow,deny
                 allow from all
         </Directory>


### Abilitare FCGI http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html

    # FcgidMaxRequestsPerProcess should be <= PHP_FCGI_MAX_REQUESTS
    # The example PHP wrapper script overrides the default PHP setting.
     FcgidMaxRequestsPerProcess 10000

    # Uncomment the following line if cgi.fix_pathinfo is set to 1 in
    # php.ini:
    # FcgidFixPathinfo 1

     Alias /phpapp/ /usr/local/phpapp/
   <Location /phpapp/>
     AddHandler fcgid-script .php
     Options +ExecCGI
     FcgidWrapper /usr/local/bin/php-wrapper .php

     # Customize the next two directives for your requirements. 
Configurata sopra
     # Order allow,deny
     # Allow from all
   </Location>

### fine inserimento FCGI


     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
         <Directory /usr/lib/cgi-bin>
                 AllowOverride None
                 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                 Order allow,deny
                 Allow from all
         </Directory>

         ErrorLog ${APACHE_LOG_DIR}/error.log

         # Possible values include: debug, info, notice, warn, error, crit,
         # alert, emerg.

         LogLevel warn
         CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

And finally, the row that contains "data-site-root" and 
"data-locale-root" in source of the page:

<body data-site-root="http://localhost:7000/" 
data-locale-root="http://localhost:7000/" >

I tried to manually edit the file "base.html" and to change the 
'data-site-root' and 'data-locale-root', but did not work and I have 
restored the original version:
ORIGINAL: <body{% block bodytag %} data-site-root="{{ h.url('/', 
locale='default', qualified=true) }}" data-locale-root="{{ h.url('/', 
qualified=true) }}" {% endblock %}>
RESULT: <body data-site-root="http://localhost:7000/" 
data-locale-root="http://localhost:7000/" >
CHANGED (but now restored): <body{% block bodytag %} data-site-root="{{ 
h.url('/ckan', locale='default', qualified=true) }}" 
data-locale-root="{{ h.url('/ckan', qualified=true) }}" {% endblock %}>
RESULT: <body data-site-root="http://localhost:7000/ckan" 
data-locale-root="http://localhost:7000/ckan" > (do not work)

Note: that "localhost:7000" is only redirection used by VirtualBox ( the 
server CKAN runs, on the virtual machine, on port 5000)
Thanks for your help.

Giuliano



Il 13/08/2015 16:23, Nigel Babu ha scritto:
> Can you link me to the site? If not, please paste the output of
> /api/action/status_show. In your case, it might be
> ckan/api/action/status_show.
>
> Can you also view the source of the page and paste the <body> tag? I'd
> like to see the values of data-site-root and data-locale-root.
>




More information about the ckan-dev mailing list