[ckan-dev] Stackoverflow Issue

Pedro G Silva pedro.gracio at deimos.com.pt
Tue Dec 1 10:18:16 UTC 2015


I have deployed ckan 2.4.0 and I documented everything. The only thing i
did different was using tomcat server, since i was having similar
datapusher issues and switching to tomcat solved (dunno why)

*CKAN*


sudo apt-get install python-dev postgresql libpq-dev python-pip
python-virtualenv git-core solr-jetty openjdk-6-jdk

sudo apt-get install python-pastescript

mkdir -p ~/ckan/lib

sudo ln -s ~/ckan/lib /usr/lib/ckan

mkdir -p ~/ckan/etc

sudo ln -s ~/ckan/etc /etc/ckan


sudo mkdir -p /usr/lib/ckan/default

sudo chown `whoami` /usr/lib/ckan/default

virtualenv --no-site-packages /usr/lib/ckan/default

. /usr/lib/ckan/default/bin/activate


pip install -e 'git+https://github.com/ckan/ckan.git@ckan-2.4.1#egg=ckan'

pip install -r /usr/lib/ckan/default/src/ckan/requirements.txt


pip install -r /usr/lib/ckan/default/src/ckan/dev-requirements.txt


deactivate

. /usr/lib/ckan/default/bin/activate


sudo -u postgres psql -l


sudo -u postgres createuser -S -D -R -P ckan_default

sudo -u postgres createdb -O ckan_default ckan_default -E utf-8


sudo mkdir -p /etc/ckan/default

sudo chown -R `whoami` /etc/ckan/


cd /usr/lib/ckan/default/src/ckan

paster make-config ckan /etc/ckan/default/development.ini



sudo nano /etc/ckan/default/development.ini

sqlalchemy.url = postgresql://ckan_default:ckan@localhost/ckan_default

ckan.site_id = default

ckan.site_url = http://100.100.0.201:5000



#sudo nano /etc/default/jetty

#NO_START=0 # (line 4)

#JETTY_HOST=0.0.0.0 # (line 15)

#JETTY_PORT=8983 # (line 18)


#sudo service jetty start


tomcat

sudo apt-get install tomcat6-admin solr-tomcat



sudo nano /etc/tomcat6/tomcat-users.xml

<user username="tomcat" password="tomcat" roles="tomcat,manager,admin"/>


sudo nano /etc/tomcat6/server.xml

<Connector port="8983



sudo mv /etc/solr/conf/schema.xml /etc/solr/conf/schema.xml.bak

sudo ln -s /usr/lib/ckan/default/src/ckan/ckan/config/solr/schema.xml
/etc/solr/conf/schema.xml


#sudo service jetty restart

sudo service tomcat6 restart



sudo -u postgres createuser -S -D -R -P -l datastore_default

sudo -u postgres createdb -O ckan_default datastore_default -E utf-8


sudo nano /etc/ckan/default/development.ini

solr_url=http://127.0.0.1:8983/solr

ckan.plugins = stats text_view image_view recline_view datastore

ckan.datastore.write_url = postgresql://ckan_default:ckan@localhost
/datastore_default

ckan.datastore.read_url = postgresql://datastore_default:ckan@localhost
/datastore_default


cd /usr/lib/ckan/default/src/ckan

paster db init -c /etc/ckan/default/development.ini



#PERMISSIONS

paster --plugin=ckan datastore set-permissions -c
/etc/ckan/default/development.ini | sudo -u postgres psql --set
ON_ERROR_STOP=1



ln -s /usr/lib/ckan/default/src/ckan/who.ini /etc/ckan/default/who.ini


cd /usr/lib/ckan/default/src/ckan


paster sysadmin add deimos -c /etc/ckan/default/development.ini
paster create-test-data -c /etc/ckan/default/development.ini



sudo nano /etc/ckan/default/development.ini

ckan.storage_path = /var/lib/ckan

ckan.max_resource_size = 10000

ckan.max_image_size = 200


sudo mkdir -p /var/lib/ckan/storage

sudo mkdir -p /var/lib/ckan/resources


paster serve /etc/ckan/default/development.ini


for debughttp://stackoverflow.com/questions/13480800/ckan-development-install-issue-attributeerror-module-object-has-no-attributecd
/home/bunny/ckan/lib/default/src/ckansudo apt-get install nodejs
npmnpm install less nodewatch./bin/less
ORhttp://docs.ckan.org/en/latest/contributing/frontend/index.htmlsudo
apt-add-repository ppa:chris-lea/node.jssudo apt-get updatesudo
apt-get install nodejs npmcd /home/bunny/ckan/lib/default/src/ckannpm
install less at 1.7.5 nodewatch
screen

. /usr/lib/ckan/default/bin/activate

./bin/less

 //datapusher

sudo apt-get install python-dev python-virtualenv build-essential
libxslt1-dev libxml2-dev git


. /usr/lib/ckan/default/bin/activate

cd ~

git clone https://github.com/ckan/datapusher

cd datapusher


add pdftables to requirements

pip install -r requirements.txt

pip install -r requirements-dev.txt

#pip install sqlalchemy-migrate==0.9.6

#pip install SQLAlchemy==0.9.6

#pip install -e .





sudo nano /etc/ckan/default/development.ini

[app:main]

ckan.datapusher.url = http://0.0.0.0:8800/

ckan.plugins = datapusher

ckan.storage_path = /var/lib/ckan

ckan.max_resource_size = 5000


sudo mkdir -p /var/lib/ckan/storage

sudo mkdir -p /var/lib/ckan/resources


sudo service nginx stop

sudo service apache2 restart



#sudo visudo -f /etc/sudoers#<user> <host> =#bunny bunny = (root)
NOPASSWD: /bin/mkdir
sudo chown -R `whoami` /var/lib/ckansudo chmod -R u+rwx /var/lib/ckan


. /usr/lib/ckan/default/bin/activate

JOB_CONFIG='/home/bunny/datapusher/deployment/datapusher_settings.py python
wsgi.py' (NOT WORKING, use nextline instead)

cd datapusher/

python datapusher/main.py deployment/datapusher_settings.py &




paster serve /etc/ckan/default/development.ini

On Tue, Dec 1, 2015 at 8:19 AM, Matthew Fullerton <matt.fullerton at gmail.com>
wrote:

> As a minor follow-up to this, is your ckan machine behind a proxy server?
> On 1 Dec 2015 9:09 a.m., "Ross Jones" <ross at servercode.co.uk> wrote:
>
>> Hi Bart,
>>
>> I think you have two problems here. The first is that, as far as I am
>> aware, datapusher doesn't support PDF files, and they should not be being
>> sent to the datapusher.  The error is unfortunate, and should be fixed, but
>> the PDF shouldn't get that far in the first place.
>>
>> > Now what causes the error is that when I try to reach the public
>> address mentioned before from the command line of my server, I get a
>> timeout error.
>>
>> The second seems to be a connectivity problem. I'm confused as to whether
>> you're having problems with:
>>
>> - datapusher connecting to CKAN
>> in which case can you confirm your ckan.ini has the correct value for
>> ckan.site_url ?
>>
>> - or, accessing publicly accessible internet urls
>> in which case there is something wrong with your machine/VM.  If you
>> can't curl the URL you want to fetch, there's little change that datapusher
>> will be able to either.  Can you post the actual URL?
>>
>> Cheers,
>>
>> Ross
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>


-- 


[image: DEIMOS Engenharia, SA] <http://www.deimos.pt>
*Pedro Gracio Silva*
Aerospace Systems / Production Center

*Av. D. Joao II, Lt 1.17.01, 10 • 1998-023 Lisboa, Portugal*
Ph: +351 21 893 3020 • Fax: +351 21 896 9099
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20151201/80e5c275/attachment-0003.html>


More information about the ckan-dev mailing list