Commit 5ea0231e99689c8485877602ae01455551ecb94d
1 parent
af972f2b
Exists in
master
and in
29 other branches
Use thin instead of mongrel
Tried to not break upgrades from Lenny. Need to test yet.
Showing
11 changed files
with
47 additions
and
30 deletions
Show diff stats
debian/apache2/conf.d/noosfero-mongrel.conf
debian/bootstrap
1 | 1 | #!/bin/sh |
2 | 2 | |
3 | -runtime_dependencies=$(sed -e '/^Depends:.*rails/!d; s/Depends: //; s/([^)]*)//g; s/,\s*/\n/g' debian/control | grep -v 'memcached\|debconf\|mongrel-cluster\|dbconfig-common\|postgresql\|misc:Depends\|adduser') | |
3 | +runtime_dependencies=$(sed -e '/^Depends:.*rails/!d; s/Depends: //; s/([^)]*)//g; s/,\s*/\n/g' debian/control | grep -v 'memcached\|debconf\|dbconfig-common\|postgresql\|misc:Depends\|adduser') | |
4 | 4 | test_dependencies="libtidy-ruby libhpricot-ruby libmocha-ruby imagemagick po4a xvfb" |
5 | 5 | apt-get -y install $runtime_dependencies $test_dependencies | ... | ... |
debian/control
... | ... | @@ -11,7 +11,7 @@ Vcs-Browser: http://git.colivre.coop.br/?p=noosfero.git |
11 | 11 | |
12 | 12 | Package: noosfero |
13 | 13 | Architecture: all |
14 | -Depends: rails (>= 2.3.5-1~), rails-ruby1.8 (>= 2.3.5-1~), ruby1.8, ruby, rake, libgettext-rails-ruby1.8, libsqlite3-ruby, libpgsql-ruby, libmysql-ruby, librmagick-ruby, libredcloth-ruby, libwill-paginate-ruby (>= 2.3.12-1~), iso-codes, libfeedparser-ruby, libferret-ruby, libdaemons-ruby, rcov, mongrel, mongrel-cluster, tango-icon-theme, libhpricot-ruby, iso-codes, memcached, debconf, dbconfig-common, postgresql, adduser, ${misc:Depends} | |
14 | +Depends: rails (>= 2.3.5-1~), rails-ruby1.8 (>= 2.3.5-1~), ruby1.8, ruby, rake, libgettext-rails-ruby1.8, libsqlite3-ruby, libpgsql-ruby, libmysql-ruby, librmagick-ruby, libredcloth-ruby, libwill-paginate-ruby (>= 2.3.12-1~), iso-codes, libfeedparser-ruby, libferret-ruby, libdaemons-ruby, rcov, thin, tango-icon-theme, libhpricot-ruby, iso-codes, memcached, debconf, dbconfig-common, postgresql, adduser, ${misc:Depends} | |
15 | 15 | Recommends: postgresql-client |
16 | 16 | Description: free web-based platform for social networks |
17 | 17 | Noosfero is a web platform for social and solidarity economy networks with | ... | ... |
debian/mongrel_cluster.yml
debian/noosfero-apache.install
debian/noosfero.install
... | ... | @@ -27,7 +27,7 @@ public usr/share/noosfero |
27 | 27 | |
28 | 28 | debian/default/noosfero etc/default |
29 | 29 | etc/init.d/noosfero etc/init.d |
30 | -debian/mongrel_cluster.yml etc/noosfero | |
30 | +debian/thin.yml etc/noosfero | |
31 | 31 | debian/ferret_server.yml etc/noosfero |
32 | 32 | etc/logrotate.d/noosfero etc/logrotate.d |
33 | 33 | debian/noosfero.yml etc/noosfero | ... | ... |
debian/noosfero.links
... | ... | @@ -2,7 +2,7 @@ usr/share/rails usr/share/noosfero/vendor/ra |
2 | 2 | var/tmp/noosfero usr/share/noosfero/tmp |
3 | 3 | var/log/noosfero usr/share/noosfero/log |
4 | 4 | etc/noosfero/database.yml usr/share/noosfero/config/database.yml |
5 | -etc/noosfero/mongrel_cluster.yml usr/share/noosfero/config/mongrel_cluster.yml | |
5 | +etc/noosfero/thin.yml usr/share/noosfero/config/thin.yml | |
6 | 6 | etc/noosfero/ferret_server.yml usr/share/noosfero/config/ferret_server.yml |
7 | 7 | etc/noosfero/plugins usr/share/noosfero/config/plugins |
8 | 8 | etc/noosfero/noosfero.yml usr/share/noosfero/config/noosfero.yml | ... | ... |
debian/update-noosfero-apache
... | ... | @@ -6,10 +6,16 @@ set -e |
6 | 6 | if test -x /usr/share/noosfero/script/apacheconf; then |
7 | 7 | datadir="/etc/noosfero/apache" |
8 | 8 | mongrel_file="$datadir/mongrel.conf" |
9 | + cluster_file="$datadir/cluster.conf" | |
10 | + if test -e "$cluster_file"; then | |
11 | + echo "Overwriting $cluster_file ..." | |
12 | + fi | |
13 | + /usr/share/noosfero/script/apacheconf thin > "$cluster_file" | |
9 | 14 | if test -e "$mongrel_file"; then |
10 | - echo "Overwriting $mongrel_file ..." | |
15 | + echo "Moving existing $mongrel_file away ..." | |
16 | + mv "$mongrel_file" "$mongrel_file".dpkg-old | |
17 | + (cd $datadir && ln -sf cluster.conf mongrel.conf) | |
11 | 18 | fi |
12 | - /usr/share/noosfero/script/apacheconf mongrel > "$mongrel_file" | |
13 | 19 | |
14 | 20 | apache_site='/etc/apache2/sites-available/noosfero' |
15 | 21 | if ! test -e "$apache_site"; then | ... | ... |
script/apacheconf
1 | 1 | #!/usr/bin/env ruby |
2 | 2 | |
3 | -case ARGV.first | |
4 | -when 'mongrel' | |
3 | +def mongrel_thin(config_file) | |
5 | 4 | require 'yaml' |
6 | - mongrel_config = YAML.load_file(File.dirname(__FILE__) + "/../config/mongrel_cluster.yml") | |
7 | - ip = mongrel_config['address'] || '127.0.0.1' | |
8 | - ports = port_range = mongrel_config['port']..(mongrel_config['port']+mongrel_config['servers']-1) | |
5 | + config = YAML.load_file(config_file) | |
6 | + ip = config['address'] || '127.0.0.1' | |
7 | + servers = config['servers'] || 1 | |
8 | + ports = port_range = config['port']..(config['port'] + servers - 1) | |
9 | 9 | ports.each do |port| |
10 | 10 | puts "BalancerMember http://#{ip}:#{port}" |
11 | 11 | end |
12 | +end | |
13 | + | |
14 | +case ARGV.first | |
15 | +when 'mongrel' | |
16 | + mongrel_thin(File.dirname(__FILE__) + "/../config/mongrel_cluster.yml") | |
17 | +when 'thin' | |
18 | + mongrel_thin(File.dirname(__FILE__) + "/../config/thin.yml") | |
12 | 19 | when 'virtualhosts' |
13 | 20 | require File.dirname(__FILE__) + '/../config/environment' |
14 | 21 | Environment.all.each do |environment| |
... | ... | @@ -30,6 +37,6 @@ when 'virtualhosts' |
30 | 37 | end |
31 | 38 | puts "# vim: ft=apache" |
32 | 39 | else |
33 | - puts "usage: %s mongrel|virtualhosts" % $PROGRAM_NAME | |
40 | + puts "usage: %s mongrel|thin|virtualhosts" % $PROGRAM_NAME | |
34 | 41 | exit 1 |
35 | 42 | end | ... | ... |