[ckan-dev] FileStore integration with Apache does not work

User66 user66 at arcor.de
Tue Apr 2 09:58:12 UTC 2013


> Are you using two different CKAN ini files, one with the development
> server and one with Apache? Is there a difference between the
> configuration files?

No, the setup is exactly the same. No config difference. I just switch between the built-in server and Apache (you can even run both at the same time, but the "data/sessions" files must be deleted before you use the other one, since there is in deed a permission problem else).

Config:
ckan.plugins = stats json_preview recline_preview synchronous_search
ckan.site_url = http://domain.de/ckan
ofs.impl = pairtree
ofs.storage_dir = /opt/ckan/pyenv/src/ckan/data/uploads
ckanext.storage.max_content_length = 1000000

> Is this a UNIX permissions problem? When you run the development server
> that is run as your unix user, but when you run Apache then CKAN runs as
> apache's unix user (www-data on ubuntu).

This was always kept in mind. Should not be the problem.

# la /opt/ckan/pyenv/src/ckan/data
drwxrwxr-x 4 ckan www 4096 2. Apr 08:56 sessions
drwxrwxr-x 3 ckan www 4096 2. Apr 08:52 uploads

If wrong permissions would be the reason I would in deed assume that upload does not work but to get an error in the web interface. But the "Upload" link does even not appear at all.

>> So, I assume that Apache does not have the right path to the API. The
>> only Apache config so far is
> 
> This seems unlikely. Try visiting a url like /api/3/action/package_list
> when running CKAN in Apache, and see if you get a response from CKAN's
> action API.

That seems to work, the output is:
{"help": "Return a list of the names of the site's datasets (packages).\n\n :rtype: list of strings\n\n ", "success": true, "result": ["test"]}

> I think the problem is probably something to do with your FileStore
> setup when running under Apache.

Yes. I would need to understand and debug how FileStore and the helper applications integrate into the web interface and under which circumstances the "Upload" link does appear or even not.

Thanks
Ralf



----------------ursprüngliche Nachricht-----------------
Von: "Sean Hammond" sean.hammond at okfn.org 
An: ckan-dev at lists.okfn.org 
Datum: Tue, 2 Apr 2013 11:01:17 +0200
-------------------------------------------------
 
 
>> I did following test:
>> 
>> 1) Start the paster web server.
>> 2) Add a resource to a dataset and upload an image to it (via the port 5000 web 
>> service)
>> 3) Stop the paster web server (and delete the session files in 
>> "pyenv/src/ckan/data/sessions" due to potential permission conflict ckan 
>> user vs. www user)
>> 4) Access CKAN via Apache web service. Result: The image is still available 
>> via the Apache web service. But the "Upload" button/link does not appear!
>> 
>> So, the general integration to the storage area works, but to some
>> extent the Phython API is not fully working with Apache. Is there
>> something to consider regarding the API path described at
>> http://docs.ckan.org/en/latest/filestore-api.html ? Since after
>> initial Apache integration I got errors like
> 
> File storage doesn't work any differently in the development server than
> with apache.
> 
> Are you using two different CKAN ini files, one with the development
> server and one with Apache? Is there a difference between the
> configuration files?
> 
> Is this a UNIX permissions problem? When you run the development server
> that is run as your unix user, but when you run Apache then CKAN runs as
> apache's unix user (www-data on ubuntu).
> 
>> So, I assume that Apache does not have the right path to the API. The
>> only Apache config so far is
> 
> This seems unlikely. Try visiting a url like /api/3/action/package_list
> when running CKAN in Apache, and see if you get a response from CKAN's
> action API.
> 
> I think the problem is probably something to do with your FileStore
> setup when running under Apache.
> 
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org 
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
> 






More information about the ckan-dev mailing list