-
Notifications
You must be signed in to change notification settings - Fork 2
SLES 12 Installation notes for NLCR
There was too much hassle with building Python 2.7 in SLES 11 even using virtualenv. SLES 12 use python 2.7 and is generally more up to date.
Installation is quite simple for anyone experienced with django development. For rest of us general course is to:
pip
zypper install pip // install pip
pip install virtualenv // install virtualenv thru pip
pip install -r Seeder/requirements.txt // install rest of required dependencies thru pip into activated virtualenv
npm
clone node.js from github.com, ./configure, make, make install // build node.js to get npm binary
npm install phantomjs Manet // install Seeder dependencies: phantomjs and Manet
Seeder configuration
prepare database server
configure Seeder setting
test app in django server
production deployment
configure uwsgi+nginx+supervisor for production deployment.
Install also python-devel, pcre-devel, zlib-devel, libopenssl-devel using zypper/yast
Install pcre-devel, zlib-devel, libopenssl-devel using zypper/yast.
Nginx is not part of SLES repository, build it from source: http://nginx.org/en/docs/configure.html with ./configure --prefix=/usr/local/nginx
curator00:~ # cat /usr/local/nginx/conf/nginx.conf
server {
listen 80;
server_name curator00.webarchiv.cz;
return 301 http://www.curator00.webarchiv.cz$request_uri;`
}
server {
listen 80;
server_name www.curator00.webarchiv.cz;
access_log /var/log/seeder/access.log;
error_log /var/log/sseeder/error.log;
#listen 443 ssl;
#ssl_certificate <ssl_path>.crt;
#ssl_certificate_key <ssl_path>.key;
location / {
uwsgi_pass unix:///opt/git/Seeder/uwsgi.sock;
include uwsgi_params;
}
location /media {
root /opt/git/Seeder/Seeder;
}
location /static {
alias /opt/git/Seeder/Seeder/static_root;
}
}
pip install uwsgi will fail without installed python-devel package.
curator00:~ # cat /usr/local/etc/uwsgi
[uwsgi]
virtualenv = /opt/seeder/
pythonpath = /opt/git/Seeder/Seeder
plugins = python
master = 1
pidfile = /opt/git/Seeer/seeder.pid
touch-reload = /opt/git/Seeder/reload.touch
socket = /opt/git/Seeder/seeder.sock
chmod-socket = 777
cheaper-algo = spare
cheaper = 2
cheaper-initial = 2
cheaper-step = 1
processes = 6
vacuum = 1
harakiri = 60
wsgi-file = /opt/git/Seeder/Seeder/wsgi.py
curator00:~ # cat /usr/local/etc/supervisor.conf
[program:seeder]
user = wwwrun
command=uwsgi --ini /usr/
autostart=true
autorestart=true
stdout_logfile=/var/log/seeder/uwsgi.log
stderr_logfile=/var/log/seeder/uwsgi.log
redirect_stderr=true
stopsignal=QUIT
[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)
[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
Easiest installation seems thru npm package manager which is part of Node.js. Cloning git https://github.com/joyent/node.git a building node.js as defined in README.md. Then just
curator00:/opt/git/node # npm install -g phantomjs
curator00:/opt/git/node # npm install -g manet