Blame view

INSTALL.md 16.4 KB
af25d9e0   Aurélio A. Heckert   correct markdown ...
1
2
Noosfero installation instructions from source for production environments
==========================================================================
013f1576   Antonio Terceiro   Reorganizing docu...
3

af25d9e0   Aurélio A. Heckert   correct markdown ...
4
The instructions below can be used for setting up a Noosfero production environment from the Noosfero sources.
013f1576   Antonio Terceiro   Reorganizing docu...
5

af25d9e0   Aurélio A. Heckert   correct markdown ...
6
Before you start installing Noosfero manually, see the information about the Noosfero Debian package at http://noosfero.org/Development/DebianPackage. Using the Debian packages on a Debian stable system is the recommended method for installing production environments.
2fd03497   Antonio Terceiro + Paulo Meirelles   Review INSTALL
7

af25d9e0   Aurélio A. Heckert   correct markdown ...
8
If you want to setup a development environment instead of a production one, stop reading this file right now and read the file `HACKING.md` instead.
2fd03497   Antonio Terceiro + Paulo Meirelles   Review INSTALL
9

af25d9e0   Aurélio A. Heckert   correct markdown ...
10
For a complete installation guide, please see the following web page: http://noosfero.org/Development/HowToInstall
2fd03497   Antonio Terceiro + Paulo Meirelles   Review INSTALL
11

af25d9e0   Aurélio A. Heckert   correct markdown ...
12
If you have problems with the setup, please feel free to ask questions in the development mailing list.
013f1576   Antonio Terceiro   Reorganizing docu...
13

af25d9e0   Aurélio A. Heckert   correct markdown ...
14
15
Requirements
------------
013f1576   Antonio Terceiro   Reorganizing docu...
16

af25d9e0   Aurélio A. Heckert   correct markdown ...
17
**DISCLAIMER**: this installation procedure is tested with Debian stable, which is currently the only recommended operating system for production usage. It is possible that you can install it on other systems, and if you do so, please report it on one of the Noosfero mailing lists, and please send a patch updating these instructions.
2fd03497   Antonio Terceiro + Paulo Meirelles   Review INSTALL
18

af25d9e0   Aurélio A. Heckert   correct markdown ...
19
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.
2fd03497   Antonio Terceiro + Paulo Meirelles   Review INSTALL
20

af25d9e0   Aurélio A. Heckert   correct markdown ...
21
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:
9d29648d   Antonio Terceiro   Updating installa...
22

af25d9e0   Aurélio A. Heckert   correct markdown ...
23
    # apt-get install ruby rake po4a libgettext-ruby-util libgettext-ruby1.8 \
965be632   Braulio Bhavamitra   Drop and replace ...
24
      libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby \
af25d9e0   Aurélio A. Heckert   correct markdown ...
25
      libwill-paginate-ruby iso-codes libfeedparser-ruby libdaemons-ruby thin \
b096aa74   Rodrigo Souto   Revert "add the n...
26
      tango-icon-theme
9d29648d   Antonio Terceiro   Updating installa...
27

af25d9e0   Aurélio A. Heckert   correct markdown ...
28
On other systems, they may or may not be available through your regular package management system. Below are the links to their homepages.
9d29648d   Antonio Terceiro   Updating installa...
29

af25d9e0   Aurélio A. Heckert   correct markdown ...
30
31
32
* Ruby: http://www.ruby-lang.org
* Rake: http://rake.rubyforge.org
* po4a: http://po4a.alioth.debian.org
013f1576   Antonio Terceiro   Reorganizing docu...
33
34
* Ruby-sqlite3: http://rubyforge.org/projects/sqlite-ruby
* rcov: http://eigenclass.org/hiki/rcov
af25d9e0   Aurélio A. Heckert   correct markdown ...
35
36
* RMagick: http://rmagick.rubyforge.org
* RedCloth: http://redcloth.org
013f1576   Antonio Terceiro   Reorganizing docu...
37
* will_paginate: http://github.com/mislav/will_paginate/wikis
af25d9e0   Aurélio A. Heckert   correct markdown ...
38
* iso-codes: http://pkg-isocodes.alioth.debian.org
013f1576   Antonio Terceiro   Reorganizing docu...
39
* feedparser: http://packages.debian.org/sid/libfeedparser-ruby
af25d9e0   Aurélio A. Heckert   correct markdown ...
40
41
* Daemons - http://daemons.rubyforge.org
* Thin: http://code.macournoyer.com/thin
013f1576   Antonio Terceiro   Reorganizing docu...
42
* tango-icon-theme: http://tango.freedesktop.org/Tango_Icon_Library
013f1576   Antonio Terceiro   Reorganizing docu...
43

70e2e7b0   Antonio Terceiro   General review of...
44
45
46
If you manage to install Noosfero successfully on other systems than Debian,
please feel free to contact the Noosfero development mailing with the
instructions for doing so, and we'll include it here.
013f1576   Antonio Terceiro   Reorganizing docu...
47

70e2e7b0   Antonio Terceiro   General review of...
48
49
50
As root user
============

70e2e7b0   Antonio Terceiro   General review of...
51
52
Install memcached. On Debian:

af25d9e0   Aurélio A. Heckert   correct markdown ...
53
    # apt-get install memcached
70e2e7b0   Antonio Terceiro   General review of...
54

af25d9e0   Aurélio A. Heckert   correct markdown ...
55
Study whether you need to raise the ammount of memory it uses for caching, depending on the demand you expect for your site. If you are going to run a high-traffic site, you will want to raise the ammount of memory reserved for caching.
70e2e7b0   Antonio Terceiro   General review of...
56

af25d9e0   Aurélio A. Heckert   correct markdown ...
57
It is recommended that you run noosfero with its own user account. To create such an account, please do the following:
70e2e7b0   Antonio Terceiro   General review of...
58

af25d9e0   Aurélio A. Heckert   correct markdown ...
59
    # adduser --system --group noosfero --shell /bin/sh --home /var/lib/noosfero
70e2e7b0   Antonio Terceiro   General review of...
60

af25d9e0   Aurélio A. Heckert   correct markdown ...
61
(note that you can change the `$HOME` directory of the user if you wish, here we are using `/var/lib/noosfero`)
70e2e7b0   Antonio Terceiro   General review of...
62

af25d9e0   Aurélio A. Heckert   correct markdown ...
63
The `--system` option will tell adduser to create a system user, i.e. this user will not have a password and cannot login to the system directly. To become this user, you have to use sudo:
70e2e7b0   Antonio Terceiro   General review of...
64

af25d9e0   Aurélio A. Heckert   correct markdown ...
65
66
67
    # sudo -u noosfero -i
    or
    # su - noosfero
70e2e7b0   Antonio Terceiro   General review of...
68
69
70
71

As noosfero user
================

ce1d83e9   Joenio Costa   Updating INSTALL ...
72
73
74
downloading from git
--------------------

af25d9e0   Aurélio A. Heckert   correct markdown ...
75
Here we are cloning the noosfero repository from git. Note: you will need to install git before.
70e2e7b0   Antonio Terceiro   General review of...
76

256e490d   Evandro Junior   Fix git repository
77
    $ git clone https://gitlab.com/noosfero/noosfero.git current
af25d9e0   Aurélio A. Heckert   correct markdown ...
78
79
    $ cd current
    $ git checkout -b stable origin/stable
70e2e7b0   Antonio Terceiro   General review of...
80

ce1d83e9   Joenio Costa   Updating INSTALL ...
81
82
83
downloading tarball
-------------------

3183c63b   Paulo Meireles   Review INSTALL file
84
Note: replace 0.39.0 below from the latest stable version.
ce1d83e9   Joenio Costa   Updating INSTALL ...
85

af25d9e0   Aurélio A. Heckert   correct markdown ...
86
87
88
89
    $ wget http://noosfero.org/pub/Development/NoosferoVersion00x39x00/noosfero-0.39.0.tar.gz
    $ tar -zxvf noosfero-0.39.0.tar.gz
    $ ln -s noosfero-0.39.0 current
    $ cd current
ce1d83e9   Joenio Costa   Updating INSTALL ...
90

89ec5ec1   Antonio Terceiro   s/mongrel/thin/ i...
91
Create the thin configuration file:
70e2e7b0   Antonio Terceiro   General review of...
92

af25d9e0   Aurélio A. Heckert   correct markdown ...
93
    $ thin -C config/thin.yml -e production config
70e2e7b0   Antonio Terceiro   General review of...
94

af25d9e0   Aurélio A. Heckert   correct markdown ...
95
Edit config/thin.yml to suit your needs. Make sure your apache configuration matches the thin cluster configuration, specially in respect to the ports and numbers of thin instances.
70e2e7b0   Antonio Terceiro   General review of...
96

af25d9e0   Aurélio A. Heckert   correct markdown ...
97
*Note*: currently Noosfero only supports Rails 2.3.5, which is the version in Debian Squeeze. If you have a Rails version newer than that, Noosfero will probably not work. You can install Rails 2.3.5 into your Noosfero installation with the following procedure:
70e2e7b0   Antonio Terceiro   General review of...
98

af25d9e0   Aurélio A. Heckert   correct markdown ...
99
100
101
102
    $ cd /var/lib/noosfero/current/vendor
    $ wget http://ftp.de.debian.org/debian/pool/main/r/rails/rails_2.3.5.orig.tar.gz
    $ tar xzf rails_2.3.5.orig.tar.gz
    $ ln -s rails-2.3.5 rails
70e2e7b0   Antonio Terceiro   General review of...
103
104
105
106
107
108

As root user
============

Setup Noosfero log and tmp directories:

af25d9e0   Aurélio A. Heckert   correct markdown ...
109
110
    # cd /var/lib/noosfero/current
    # ./etc/init.d/noosfero setup
70e2e7b0   Antonio Terceiro   General review of...
111

51fd552d   Rodrigo Souto   database-collatio...
112
Now it's time to setup the database. In this example we are using PostgreSQL, so if you are planning to use a different database this steps won't apply. Pay special attention to the default collation defined on your setup by the environment variable LC_COLLATE because it might interfere in some sorting operations on your database. For more information checkout `man locale`.
70e2e7b0   Antonio Terceiro   General review of...
113

af25d9e0   Aurélio A. Heckert   correct markdown ...
114
115
    # apt-get install postgresql libpgsql-ruby
    # su postgres -c 'createuser noosfero -S -d -R'
ce1d83e9   Joenio Costa   Updating INSTALL ...
116

af25d9e0   Aurélio A. Heckert   correct markdown ...
117
By default Rails will try to connect on postgresql through 5432 port, you can check it on `/etc/postgresql/8.4/main/postgresql.conf` file.
ce1d83e9   Joenio Costa   Updating INSTALL ...
118
119

Restart postgresql:
af25d9e0   Aurélio A. Heckert   correct markdown ...
120
    # invoke-rc.d postgresql restart
ce1d83e9   Joenio Costa   Updating INSTALL ...
121

af25d9e0   Aurélio A. Heckert   correct markdown ...
122
Noosfero needs a functional e-mail setup to work: the local mail system should be able to deliver e-mail to the internet, either directly or through an external SMTP server. Please check the documentation at the INSTALL.email file.
c94fa54f   Antonio Terceiro   Document the need...
123

70e2e7b0   Antonio Terceiro   General review of...
124
125
126
127
As noosfero user
================

Now create the databases:
9d29648d   Antonio Terceiro   Updating installa...
128

af25d9e0   Aurélio A. Heckert   correct markdown ...
129
130
131
132
    $ cd /var/lib/noosfero/current
    $ createdb noosfero_production
    $ createdb noosfero_development
    $ createdb noosfero_test
013f1576   Antonio Terceiro   Reorganizing docu...
133

af25d9e0   Aurélio A. Heckert   correct markdown ...
134
The development and test databases are actually optional. If you are creating a stricly production server, you will probably not need them.
013f1576   Antonio Terceiro   Reorganizing docu...
135

af25d9e0   Aurélio A. Heckert   correct markdown ...
136
Now we want to configure Noosfero for accessing the database we just created. To do that, you can 1) copy `config/database.yml.pgsql` to `config/database.yml`, or create `config/database.yml` from scratch with the following content:
013f1576   Antonio Terceiro   Reorganizing docu...
137

af25d9e0   Aurélio A. Heckert   correct markdown ...
138
139
140
141
142
    production:
      adapter: postgresql
      encoding: unicode
      database: noosfero_production
      username: noosfero
013f1576   Antonio Terceiro   Reorganizing docu...
143

70e2e7b0   Antonio Terceiro   General review of...
144
Now, to test the database access, you can fire the Rails database console:
013f1576   Antonio Terceiro   Reorganizing docu...
145

af25d9e0   Aurélio A. Heckert   correct markdown ...
146
    $ ./script/dbconsole production
013f1576   Antonio Terceiro   Reorganizing docu...
147

af25d9e0   Aurélio A. Heckert   correct markdown ...
148
If it connects to your database, then everything is fine. If you got an error message, then you have to check your database configuration.
013f1576   Antonio Terceiro   Reorganizing docu...
149

70e2e7b0   Antonio Terceiro   General review of...
150
Create the database structure:
cc96e5cc   Antonio Terceiro   HTML optimizations
151

af25d9e0   Aurélio A. Heckert   correct markdown ...
152
    $ RAILS_ENV=production rake db:schema:load
cc96e5cc   Antonio Terceiro   HTML optimizations
153

3399b6a7   Paulo Meireles   fixing INSTALL fi...
154
155
Compile the translations:

af25d9e0   Aurélio A. Heckert   correct markdown ...
156
    $ RAILS_ENV=production rake noosfero:translations:compile
3399b6a7   Paulo Meireles   fixing INSTALL fi...
157

af25d9e0   Aurélio A. Heckert   correct markdown ...
158
Now we must create some initial data. To create your default environment (the first one), run the command below:
cc96e5cc   Antonio Terceiro   HTML optimizations
159

af25d9e0   Aurélio A. Heckert   correct markdown ...
160
    $ RAILS_ENV=production ./script/runner 'Environment.create!(:name => "My environment", :is_default => true)'
013f1576   Antonio Terceiro   Reorganizing docu...
161

70e2e7b0   Antonio Terceiro   General review of...
162
(of course, replace "My environment" with your environment's name!)
013f1576   Antonio Terceiro   Reorganizing docu...
163

af25d9e0   Aurélio A. Heckert   correct markdown ...
164
And now you have to add the domain name you will be using for your noosfero site to the list of domains of that default environment you just created:
013f1576   Antonio Terceiro   Reorganizing docu...
165

af25d9e0   Aurélio A. Heckert   correct markdown ...
166
    $ RAILS_ENV=production ./script/runner "Environment.default.domains << Domain.new(:name => 'your.domain.com')"
013f1576   Antonio Terceiro   Reorganizing docu...
167

70e2e7b0   Antonio Terceiro   General review of...
168
(replace "your.domain.com" with your actual domain name)
013f1576   Antonio Terceiro   Reorganizing docu...
169

46ab6d44   Daniela Feitosa   Added message on ...
170
Add at least one user as admin of environment:
5d4fdb3e   Joenio Costa   Documenting how t...
171

af25d9e0   Aurélio A. Heckert   correct markdown ...
172
    $ RAILS_ENV=production ./script/runner "User.create(:login => 'adminuser', :email => 'admin@example.com', :password => 'admin', :password_confirmation => 'admin', :environment => Environment.default, :activated_at => Time.new)"
5d4fdb3e   Joenio Costa   Documenting how t...
173

af25d9e0   Aurélio A. Heckert   correct markdown ...
174
(replace "adminuser", "admin@example.com", "admin" with the login, email and password of your environment administrator)
46ab6d44   Daniela Feitosa   Added message on ...
175

70e2e7b0   Antonio Terceiro   General review of...
176
177
To start the Noosfero application servers:

af25d9e0   Aurélio A. Heckert   correct markdown ...
178
    $ ./script/production start
70e2e7b0   Antonio Terceiro   General review of...
179

af25d9e0   Aurélio A. Heckert   correct markdown ...
180
At this point you have a functional Noosfero installation running, the only thing left is to configure your webserver as a reverse proxy to pass requests to them.
70e2e7b0   Antonio Terceiro   General review of...
181

444059a1   Joenio Costa   Notify exceptions...
182

ce1d83e9   Joenio Costa   Updating INSTALL ...
183
184
185
Apache instalation
==================

af25d9e0   Aurélio A. Heckert   correct markdown ...
186
    # apt-get install apache2
ce1d83e9   Joenio Costa   Updating INSTALL ...
187

30560212   Antonio Terceiro   Support running N...
188
189
Configuration - noosfero at /
-----------------------------
70e2e7b0   Antonio Terceiro   General review of...
190

444059a1   Joenio Costa   Notify exceptions...
191
First you have to enable the following some apache modules:
b48f16d4   Antonio Terceiro   Document better t...
192

af25d9e0   Aurélio A. Heckert   correct markdown ...
193
194
195
196
197
198
 * deflate
 * expires
 * proxy
 * proxy_balancer
 * proxy_http
 * rewrite
b48f16d4   Antonio Terceiro   Document better t...
199

af25d9e0   Aurélio A. Heckert   correct markdown ...
200
On Debian GNU/Linux system, these modules can be enabled with the following command line, as root:
70e2e7b0   Antonio Terceiro   General review of...
201

af25d9e0   Aurélio A. Heckert   correct markdown ...
202
    # a2enmod deflate expires proxy proxy_balancer proxy_http rewrite
b48f16d4   Antonio Terceiro   Document better t...
203

70e2e7b0   Antonio Terceiro   General review of...
204
In other systems the way by which you enable apache modules may be different.
b48f16d4   Antonio Terceiro   Document better t...
205

af25d9e0   Aurélio A. Heckert   correct markdown ...
206
207
208
Now with the Apache configuration. You can use the template below, replacing `/var/lib/noosfero/current` 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 thin instances on ports 3000 and 3001. If your setup is different you'll need to adjust `<Proxy>` section. If you don't understand something in the configuration, please refer to the apache documentation.

Add a file called "mysite" (or whatever name you want to give to your noosfero site) to `/etc/apache2/sites-available` with the following content, and customize as needed (as usual, make sure you replace "your.domain.com" with you actual domain name, and "`/var/lib/noosfero/current`" with the directory where Noosfero is installed):
cc96e5cc   Antonio Terceiro   HTML optimizations
209

af25d9e0   Aurélio A. Heckert   correct markdown ...
210
211
    <VirtualHost *:80>
      ServerName your.domain.com
cc96e5cc   Antonio Terceiro   HTML optimizations
212

af25d9e0   Aurélio A. Heckert   correct markdown ...
213
214
215
216
217
218
219
      DocumentRoot "/var/lib/noosfero/current/public"
      <Directory "/var/lib/noosfero/current/public">
        Options FollowSymLinks
        AllowOverride None
        Order Allow,Deny
        Allow from all
      </Directory>
cc96e5cc   Antonio Terceiro   HTML optimizations
220

af25d9e0   Aurélio A. Heckert   correct markdown ...
221
      RewriteEngine On
cc96e5cc   Antonio Terceiro   HTML optimizations
222

af25d9e0   Aurélio A. Heckert   correct markdown ...
223
224
      # Rewrite index to check for static index.html
      RewriteRule ^/$ /index.html [QSA]
cc96e5cc   Antonio Terceiro   HTML optimizations
225

af25d9e0   Aurélio A. Heckert   correct markdown ...
226
227
      # Rewrite to check for Rails cached page
      RewriteRule ^([^.]+)$ $1.html [QSA]
cc96e5cc   Antonio Terceiro   HTML optimizations
228

af25d9e0   Aurélio A. Heckert   correct markdown ...
229
230
      RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
      RewriteRule ^.*$ balancer://noosfero%{REQUEST_URI} [P,QSA,L]
cc96e5cc   Antonio Terceiro   HTML optimizations
231

af25d9e0   Aurélio A. Heckert   correct markdown ...
232
      ErrorDocument 503 /503.html
cc96e5cc   Antonio Terceiro   HTML optimizations
233

af25d9e0   Aurélio A. Heckert   correct markdown ...
234
235
236
      ErrorLog /var/log/apache2/noosfero.log
      LogLevel warn
      CustomLog /var/log/apache2/noosfero.access.log combined
cc96e5cc   Antonio Terceiro   HTML optimizations
237

af25d9e0   Aurélio A. Heckert   correct markdown ...
238
      Include /var/lib/noosfero/current/etc/noosfero/apache/cache.conf
cc96e5cc   Antonio Terceiro   HTML optimizations
239

af25d9e0   Aurélio A. Heckert   correct markdown ...
240
    </VirtualHost>
70e2e7b0   Antonio Terceiro   General review of...
241

af25d9e0   Aurélio A. Heckert   correct markdown ...
242
243
244
245
246
247
    <Proxy balancer://noosfero>
      BalancerMember http://127.0.0.1:3000
      BalancerMember http://127.0.0.1:3001
      Order Allow,Deny
      Allow from All
    </Proxy>
70e2e7b0   Antonio Terceiro   General review of...
248

af25d9e0   Aurélio A. Heckert   correct markdown ...
249
250
251
252
253
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?

Enable that site with (as root, replace "mysite" with the actual name you gave to your site configuration):

    # a2ensite mysite
70e2e7b0   Antonio Terceiro   General review of...
254
255
256

Now restart your apache server (as root):

af25d9e0   Aurélio A. Heckert   correct markdown ...
257
    # invoke-rc.d apache2 restart
70e2e7b0   Antonio Terceiro   General review of...
258

30560212   Antonio Terceiro   Support running N...
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
Configuration - noosfero at a /subdirectory
-------------------------------------------

This section describes how to configure noosfero at a subdirectory, what is
specially useful when you want Noosfero to share a domain name with other
applications. For example you can host noosfero at yourdomain.com/social, a
webmail application at yourdomain.com/webmail, and have a static HTML website
at yourdomain.com/.

**NOTE:** Some plugins might not work well with this setting. Before deploying
this setting, make sure you test that everything  you need works properly with
it.

The configuration is similar to the main configuration instructions, except for
the following points. In the description below, replace '/subdirectory' with
the actual subdirectory you want.

1) add a `prefix: /subdirectory` line to your thin configuration file (thin.yml).

1.1) remember to restart the noosfero application server whenever you make
changes to that configuration file.

    # service noosfero restart

2) add a line saying `export RAILS_RELATIVE_URL_ROOT=/subdirectory` to
/etc/default/noosfero (you can create it with just this line if it does not
exist already).

3) You should add the following apache configuration to an existing virtual
host (plus the `<Proxy balancer://noosfero>` section as displayed above):

```
Alias /subdirectory /path/to/noosfero/public
<Directory "/path/to/noosfero/public">
  Options FollowSymLinks
  AllowOverride None
  Order Allow,Deny
  Allow from all

  Include /path/to/noosfero/etc/noosfero/apache/cache.conf

  RewriteEngine On
  RewriteBase /subdirectory
  # Rewrite index to check for static index.html
  RewriteRule ^$ index.html [QSA]
  # Rewrite to check for Rails cached page
  RewriteRule ^([^.]+)$ $1.html [QSA]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ http://localhost:3000%{REQUEST_URI} [P,QSA,L]
</Directory>
```

3.1) remember to reload the apache server whenever any apache configuration
file changes.

    # sudo service apache2 reload
3183c63b   Paulo Meireles   Review INSTALL file
315
316
317
318

Enabling exception notifications
================================

af25d9e0   Aurélio A. Heckert   correct markdown ...
319
This is an optional step. You will need it only if you want to receive e-mail notifications when some exception occurs on Noosfero.
3183c63b   Paulo Meireles   Review INSTALL file
320

af25d9e0   Aurélio A. Heckert   correct markdown ...
321
First, install this version of the gem. Others versions may not be compatible with Noosfero:
3183c63b   Paulo Meireles   Review INSTALL file
322

af25d9e0   Aurélio A. Heckert   correct markdown ...
323
    # gem install exception_notification -v 1.0.20090728
3183c63b   Paulo Meireles   Review INSTALL file
324

af25d9e0   Aurélio A. Heckert   correct markdown ...
325
You can configure the e-mails that will receive the notifications. Change the file config/noosfero.yml as the following example, replacing the e-mails by real ones:
3183c63b   Paulo Meireles   Review INSTALL file
326

af25d9e0   Aurélio A. Heckert   correct markdown ...
327
328
    production:
      exception_recipients: [admin@example.com, you@example.com]
3183c63b   Paulo Meireles   Review INSTALL file
329
330


70e2e7b0   Antonio Terceiro   General review of...
331
332
333
Maintainance
============

af25d9e0   Aurélio A. Heckert   correct markdown ...
334
335
336
337
338
339
340
341
342
343
344
345
To ease the maintainance, install a symbolic link for the Noosfero startup script in your server and add it to the system initialization and shutdown sequences (as root):

    # ln -s /var/lib/noosfero/current/etc/init.d/noosfero /etc/init.d/noosfero
    # update-rc.d noosfero defaults
     Adding system startup for /etc/init.d/noosfero ...
       /etc/rc0.d/K20noosfero -> ../init.d/noosfero
       /etc/rc1.d/K20noosfero -> ../init.d/noosfero
       /etc/rc6.d/K20noosfero -> ../init.d/noosfero
       /etc/rc2.d/S20noosfero -> ../init.d/noosfero
       /etc/rc3.d/S20noosfero -> ../init.d/noosfero
       /etc/rc4.d/S20noosfero -> ../init.d/noosfero
       /etc/rc5.d/S20noosfero -> ../init.d/noosfero
70e2e7b0   Antonio Terceiro   General review of...
346
347
348

Now to start Noosfero, you do as root:

af25d9e0   Aurélio A. Heckert   correct markdown ...
349
    # invoke-rc.d noosfero start
70e2e7b0   Antonio Terceiro   General review of...
350
351
352

To stop Noosfero:

af25d9e0   Aurélio A. Heckert   correct markdown ...
353
    # invoke-rc.d noosfero start
70e2e7b0   Antonio Terceiro   General review of...
354
355
356

To restart Noosfero:

af25d9e0   Aurélio A. Heckert   correct markdown ...
357
    # invoke-rc.d noosfero restart
70e2e7b0   Antonio Terceiro   General review of...
358

af25d9e0   Aurélio A. Heckert   correct markdown ...
359
Noosfero will be automatically started during system boot, and automatically stopped if the system shuts down for some reason (or during the shutdown part of a reboot).
70e2e7b0   Antonio Terceiro   General review of...
360

dbf574bf   Antonio Terceiro   Documenting the p...
361
362
363
Rotating logs
=============

af25d9e0   Aurélio A. Heckert   correct markdown ...
364
Noosfero provides an example logrotate configuation to rotate its logs. To use it, create a symbolic link in `/etc/logrotate.d/`:
dbf574bf   Antonio Terceiro   Documenting the p...
365

af25d9e0   Aurélio A. Heckert   correct markdown ...
366
367
    # cd /etc/logrotate.d/
    # ln -s /var/lib/noosfero/current/etc/logrotate.d/noosfero
dbf574bf   Antonio Terceiro   Documenting the p...
368

af25d9e0   Aurélio A. Heckert   correct markdown ...
369
Note that the provided file assumes Noosfero logging is being done in `/var/log/noosfero` (which is the case if you followed the instructions above correctly). If the logs are stored elsewhere, it's recommended that you copy the file over to `/etc/logrotate.d/` and modify it to point to your local log directly.
dbf574bf   Antonio Terceiro   Documenting the p...
370

70e2e7b0   Antonio Terceiro   General review of...
371
372
373
Upgrading
=========

af25d9e0   Aurélio A. Heckert   correct markdown ...
374
If you followed the steps in this document and installed Noosfero from the git repository, then upgrading is easy. First, you need to allow the noosfero user to restart the memcached server with sudo, by adding the following line in `/etc/sudoers`:
14c18eaa   Antonio Terceiro   More info on upgr...
375

af25d9e0   Aurélio A. Heckert   correct markdown ...
376
    noosfero ALL=NOPASSWD: /etc/init.d/memcached
14c18eaa   Antonio Terceiro   More info on upgr...
377
378

Then, to perform an upgrade, do the following as the noosfero user:
70e2e7b0   Antonio Terceiro   General review of...
379

af25d9e0   Aurélio A. Heckert   correct markdown ...
380
381
    $ cd /var/lib/noosfero/current
    $ ./script/git-upgrade
70e2e7b0   Antonio Terceiro   General review of...
382

af25d9e0   Aurélio A. Heckert   correct markdown ...
383
The `git-upgrade` script will take care of everything for you. It will first stop the service, then fetch the current source code, upgrade database, compile translations, and then start the service again.
70e2e7b0   Antonio Terceiro   General review of...
384

af25d9e0   Aurélio A. Heckert   correct markdown ...
385
*Note 1*: make sure your local git repository is following the "stable" branch, just like the instructions above. The `master` branch is **not** recommended for use in production environments.
70e2e7b0   Antonio Terceiro   General review of...
386

af25d9e0   Aurélio A. Heckert   correct markdown ...
387
*Note 2*: always read the release notes before upgrading. Sometimes there will be steps that must be performed manually. If that is the case, you can invoke the `git-upgrade` script with the special parameter `--shell` that will give you a shell after the upgrade, which you can use to perform any manual steps required:
70e2e7b0   Antonio Terceiro   General review of...
388

af25d9e0   Aurélio A. Heckert   correct markdown ...
389
    $ ./script/git-upgrade --shell