Took me 3 days to figure this out. Full, mind draining days.
If I were paid to do this this info would cost at least 1200 EUR.
This is for versions:
FreeBSD 9.1
uwsgi 1.9.12
nginx 1.4.1
redmine 2.3.1
You’re pretty much left on your own in FreeBSD. Google results are terrible.
1. Problem: Rubygems fail on rdoc creation.
Solution:
modify /etc/make.conf
1 |
NOPORTDOCS=yes |
2. Problem: FreeBSD’s uwsgi port only uses the default buildconf and doesn’t build the rack plugin.
I have installed every dependant port and I don’t know how to turn off warnings as errors. Did I mention that I really hate this nontransparent Makefile system? I hate it.
The LUA plugin doesn’t compile at all, can’t find lua.h
The transformation_toupper, xslt, ssi and v8 plugins display warnings so they fail to compile.
After compiling mono and openjdk uwsgi complains that it can’t find the libjvm.so and uwsgi.dll.
So it comes down to stripping everything down to what works.
The buildconf file. I have saved it in /root/default.ini
1 2 3 |
[uwsgi] main_plugin = python,gevent,psgi,php,rack,coroae,cgi,webdav inherit = base |
Note:
You have to compile PHP with the embed sapi so it builds the libphp5.so
1 2 3 4 |
cd /usr/ports/www/uwsgi make patch cp /root/default.ini work/uwsgi-1.9.12/buildconf/default.ini make install clean |
3. Problem: uwsgi configuration
1 2 |
mkdir -p /usr/local/etc/uwsgi mkdir -p /var/log/uwsgi |
/etc/rc.conf
1 2 3 |
uwsgi_enable="YES" uwsgi_profiles="redmine" uwsgi_redmine_flags="--yaml /usr/local/etc/uwsgi/redmine.yaml" |
/usr/local/etc/uwsgi/redmine.yaml
1 2 3 4 5 6 7 |
uwsgi: master: 1 processes: 4 logto: /var/log/uwsgi/redmine.log rack: /usr/local/www/redmine/config.ru post-buffering: 4096 env: RAILS_ENV=production |
Yes the socket: is missing because the init script takes care of that (grr!)
The socket is autonamed /tmp/uwsgi-redmine.sock
For redmine installation check the official docs. They work.
4. Problem: nginx configuration
1 2 3 |
cd /usr/local/etc/nginx mkdir vhosts touch vhosts/redmine.conf |
/usr/local/etc/nginx/nginx.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
user www; worker_processes 2; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; include vhosts/*.conf; } |
/usr/local/etc/nginx/vhosts/redmine.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 |
server { listen 80; server_name redmine.server; # I have a local tld, add more server aliases if you need public access location / { root "/usr/local/www/redmine/public"; include uwsgi_params; uwsgi_modifier1 7; if (!-f $request_filename) { uwsgi_pass unix:/tmp/uwsgi-redmine.sock; } } } |
/etc/rc.conf
1 |
nginx_enable="YES" |
1 2 |
service uwsgi start service nginx start |
Mindfuck galore, HTH
Linux > FreeBSD except for ZFS root which is a major pain in the ass on Linux