Commit ca0e01605edbde21e5f0449648a7a420d9fcb437
1 parent
b90cfca9
Exists in
master
and in
29 other branches
ActionItem1049: documenting production setup
starting some documentation on the procedure of putting a production server up
Showing
1 changed file
with
59 additions
and
2 deletions
Show diff stats
doc/README_FOR_APP.en
| @@ -23,15 +23,72 @@ You need to have git installed, as well as: | @@ -23,15 +23,72 @@ You need to have git installed, as well as: | ||
| 23 | * contacts: http://github.com/cardmagic/contacts/tree/master | 23 | * contacts: http://github.com/cardmagic/contacts/tree/master |
| 24 | * iso-codes: http://pkg-isocodes.alioth.debian.org/ | 24 | * iso-codes: http://pkg-isocodes.alioth.debian.org/ |
| 25 | * feedparser: http://packages.debian.org/sid/libfeedparser-ruby | 25 | * feedparser: http://packages.debian.org/sid/libfeedparser-ruby |
| 26 | +* Mongrel: http://mongrel.rubyforge.org/ | ||
| 26 | * tango-icon-theme: http://tango.freedesktop.org/Tango_Icon_Library | 27 | * tango-icon-theme: http://tango.freedesktop.org/Tango_Icon_Library |
| 27 | 28 | ||
| 28 | -There are Debian packages available for all of them but ferret. Try: | 29 | +There are Debian packages available for all of them but contacts. Try: |
| 29 | 30 | ||
| 30 | - # aptitude install subversion ruby rake libgettext-ruby1.8 libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby libwill-paginate-ruby iso-codes libfeedparser-ruby libferret-ruby tango-icon-theme | 31 | + # aptitude install subversion ruby rake libgettext-ruby1.8 libsqlite3-ruby rcov librmagick-ruby libredcloth-ruby libwill-paginate-ruby iso-codes libfeedparser-ruby libferret-ruby mongrel mongrel-cluster tango-icon-theme |
| 32 | + | ||
| 33 | +To install contacts, you need to either use gem (gem install contacts), or you can just download the tarball from github or rubyforge and copy the contents of lib/ under noosfero's lib/ directory. | ||
| 31 | 34 | ||
| 32 | If you have problems with the setup, use the development mailing list. In | 35 | If you have problems with the setup, use the development mailing list. In |
| 33 | special its possible that the requirements list above is not complete. | 36 | special its possible that the requirements list above is not complete. |
| 34 | 37 | ||
| 38 | +=== Setting up a production environment | ||
| 39 | + | ||
| 40 | +* copy config/ferret_server.yml.dist to config/ferret_server.yml.dist | ||
| 41 | +* configure the mongrel cluster: `mongrel_rails cluster::configure` | ||
| 42 | +** 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. | ||
| 43 | +* create needed temporary directories: | ||
| 44 | + mkdir tmp | ||
| 45 | + mkdir tmp/pids | ||
| 46 | + mkdir log | ||
| 47 | +* create database (example using PostgreSQL, YMMV) | ||
| 48 | + | ||
| 49 | + root user | ||
| 50 | + ========= | ||
| 51 | + # sudo apt-get install postgresql libpgsql-ruby | ||
| 52 | + # su - postgres | ||
| 53 | + | ||
| 54 | + postgres user | ||
| 55 | + ============= | ||
| 56 | + postgres@HOST:~$ createuser noosfero | ||
| 57 | + Shall the new role be a superuser? (y/n) n | ||
| 58 | + Shall the new role be allowed to create databases? (y/n) y | ||
| 59 | + Shall the new role be allowed to create more new roles? (y/n) n | ||
| 60 | + | ||
| 61 | + noosfero_user | ||
| 62 | + ============= | ||
| 63 | + createdb noosfero_production | ||
| 64 | + createdb noosfero_development | ||
| 65 | + createdb noosfero_test | ||
| 66 | + | ||
| 67 | +* configure database access in config/database.yml | ||
| 68 | + | ||
| 69 | +* test database access: | ||
| 70 | +** first create the development database | ||
| 71 | + rake db:schema:load | ||
| 72 | +** if everything goes right, then create the production database: | ||
| 73 | + RAILS_ENV=production rake db:schema:load | ||
| 74 | + | ||
| 75 | +* create sample data: | ||
| 76 | + RAILS_ENV=production rake db:populate | ||
| 77 | + | ||
| 78 | +* compile the translations: | ||
| 79 | + rake makemo | ||
| 80 | + | ||
| 81 | +* start the server: | ||
| 82 | + ./script/production start | ||
| 83 | + | ||
| 84 | +* to stop the server: | ||
| 85 | + | ||
| 86 | + ./script/production stop | ||
| 87 | + | ||
| 88 | +* to restart the server: | ||
| 89 | + | ||
| 90 | + ./script/production restart | ||
| 91 | + | ||
| 35 | === Boostraping a test environment | 92 | === Boostraping a test environment |
| 36 | 93 | ||
| 37 | You can copy and paste the commands below into a terminal (please review the | 94 | You can copy and paste the commands below into a terminal (please review the |