INSTALL
5.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
= Noosfero installation instructions
Noosfero is written in Ruby with the "Rails framework":http://www.rubyonrails.org,
so the process of setting it up is pretty similar to other Rails applications.
Below we have the instructions for installing Noosfero dependencies and setting
up a production environment. If you have problems with the setup, please feel
free to ask questions in the development mailing list.
== Requirements
You need to install some packages Noosfero depends on. On Debian GNU/Linux or
Debian-based systems, all of these packages are available through the Debian
archive. You can install them with the following command:
# aptitude install ruby rake libgettext-ruby1.8 libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby libwill-paginate-ruby iso-codes libfeedparser-ruby libferret-ruby libdaemons-ruby mongrel mongrel-cluster tango-icon-theme
On other systems, they may or may not be available through your regular package
management system. Below are the links to their homepages.
* Ruby: http://www.ruby-lang.org/
* Rake: http://rake.rubyforge.org/
* Ruby-GetText: http://www.yotabanana.com/hiki/ruby-gettext.html?ruby-gettext (at least version 1.9.0)
* Ruby-sqlite3: http://rubyforge.org/projects/sqlite-ruby
* rcov: http://eigenclass.org/hiki/rcov
* Ferret: http://ferret.davebalmain.com/trac
* RMagick: http://rmagick.rubyforge.org/
* RedCloth: http://redcloth.org/
* will_paginate: http://github.com/mislav/will_paginate/wikis
* iso-codes: http://pkg-isocodes.alioth.debian.org/
* feedparser: http://packages.debian.org/sid/libfeedparser-ruby
* Daemons - http://daemons.rubyforge.org/
* Mongrel: http://mongrel.rubyforge.org/
* tango-icon-theme: http://tango.freedesktop.org/Tango_Icon_Library
If you manage to install Noosfero successfully, please feel free to contact the
Noosfero development mailing with the instructions for doing so, and we'll
include it here.
=== Setting up a production environment
NOTE: these instructions are for seting up a *production* environment. If you
are going to do Noosfero development, you don't need to do these steps. See the
HACKING file instead.
* install memcached. Study whether you need to raise the ammount of memory it uses for caching, depending on the demand you expect for your site.
* enter the directory where you unpacked noosfero
* copy config/ferret_server.yml.dist to config/ferret_server.yml
* create the mongrel configuration file: `mongrel_rails cluster::configure`
** then edit config/mongrel_cluster.yml to suit your environment. Make sure your apache configuration matches the mongrel cluster configuration, specially in respect to the ports and numbers of mongrel instances.
* create needed temporary directories:
mkdir tmp
mkdir tmp/pids
mkdir log
* create database (example using PostgreSQL, YMMV)
root user
=========
# sudo apt-get install postgresql libpgsql-ruby
# su - postgres
postgres user
=============
postgres@HOST:~$ createuser noosfero
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n
noosfero_user
=============
createdb noosfero_production
createdb noosfero_development
createdb noosfero_test
* configure database access in config/database.yml
* test database access:
** first create the development database
rake db:schema:load
** if everything goes right, then create the production database:
RAILS_ENV=production rake db:schema:load
* create sample data:
RAILS_ENV=production rake db:populate
* Add the domain name you will be using for your noosfero site to the list of
environment domain, like this:
./script/runner "Environment.default.domains << Domain.new(:name => 'your.domain.com')"
(of course, replace your.domain.com with your real domain)
* compile the translations:
rake makemo
* start the server:
./script/production start
* to stop the server:
./script/production stop
* to restart the server:
./script/production restart
* Configure apache web server as a reverse proxy. You can use the template
below, replacing /path/to/noosfero with the directory in which your noosfero
installation is, your.domain.com with the domain name of your noosfero site.
We are assuming that you are running two mongrel instances on ports 4000 and
4001. If your setup is different you'll need to adjust <Proxy> section. Make
sure you have the follwing apache modules enabled: deflate, expires, proxy,
proxy_balancer, proxy_http, rewrite. If you don't understand something in the
configuration, please refer to the apache documentation.
<VirtualHost *:80>
ServerName your.domain.com
DocumentRoot "/path/to/noosfero/public"
<Directory "/path/to/noosfero/public">
Options FollowSymLinks
AllowOverride None
Order Allow,Deny
Allow from all
</Directory>
RewriteEngine On
# Rewrite index to check for static index.html
RewriteRule ^/$ /index.html [QSA]
# Rewrite to check for Rails cached page
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^.*$ balancer://noosfero-%{REQUEST_URI} [P,QSA,L]
ErrorDocument 503 /503.html
ErrorLog /var/log/apache2/noosfero.log
LogLevel warn
CustomLog /var/log/apache2/noosfero.access.log combined
Include /path/to/noosfero/etc/noosfero/apache/cache.conf
</VirtualHost>
<Proxy balancer://noosfero-test>
BalancerMember http://127.0.0.1:4000
BalancerMember http://127.0.0.1:4001
Order Allow,Deny
Allow from All
</Proxy>
The cache.conf file included in the end of the <VirtualHost> section is
important, since it will tell apache to pass expiration and cache headers to
clients so that the site feels faster for users. Do we need to say that using
that configuration is strongly recommended?