ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Restart ChiliProject

Version 2 (Holger Just, 2011-02-23 10:31 am)

1 1
h1. Restart ChiliProject
2 1
3 1
4 1
5 1
Sometimes you need to restart or reload your ChiliProject application server. Most of the time this is required because
6 1
* you updated the ChiliProject code,
7 1
* you changed some basic configuration like database or email settings,
8 1
* you installed or updated a [[Plugins|plugin]],
9 1
* you installed a new [[Themes|theme]]
10 1
11 1
The procedure you need to follow depends mostly on the application server you use to actually run ChiliProject. Just find out which server you are actually using and then follow its procedure to restart the server.
12 1
13 1
These procedures work for common configurations of the mentioned application servers. The don't necessarily work for you when you have configured your system in unusual way. Please also consult the documentation of your application server to learn more about how to handle it.
14 1
15 1
h2. Which application server am I using?
16 1
17 1
Most of the time you know very well which application server software you are running, just because you have set it up originally. But sometimes it's not that clear anymore what is actually used, because this thing just ran for ages. This section helps you to identify which application server software you are running. Unfortunately, a running ChiliProject can not tell with 100% certainty what is used, so you might have to dig a bit yourself.
18 1
19 2 Holger Just
{{html_comment(TODO: This only applies once was merged)}}
20 2 Holger Just
21 1
The first step is to either go to *Administration* -> *Information* or to run the following command:
22 2 Holger Just
23 2 Holger Just
<pre>cd /path/to/chiliproject # Replace the path with your actual ChiliProject installation root
24 2 Holger Just
RAILS_ENV=production ruby script/about</pre>
25 2 Holger Just
26 1
Look for the "Application Server" column. If only one server is listed, just go to its section. If multiple app servers are listed, ChiliProject couldn't fully determine which software is used. You'll need to check further.
27 1
28 1
If you are on Linux, open a console and run the following command. Be sure to adapt the path to your installation.
29 2 Holger Just
30 1
<pre>ps axu | grep /path/to/chiliproject | grep -v grep</pre>
31 1
32 2 Holger Just
It will output a number of lines containing information about running processes on your server. This process list is filtered for processes containing your ChiliProject installation path in its parameters. Of interest in this output is the last column. Search for certain keywords here which identify the application server.
33 2 Holger Just
34 2 Holger Just
35 1
|_. Keyword |_. Application Server |
36 1
| Rails:    |/2. Passenger         |
37 1
| Passenger |
38 1
| mongrel   | Mongrel |
39 1
| thin      | Thin |
40 1
| unicorn   | Unicorn |
41 1
42 1
h2. Passenger
43 1
44 1
Passenger can be restarted in two ways:
45 1
46 2 Holger Just
* The easiest way to restart your application is to run the following commands: <pre>cd /path/to/chiliproject
47 2 Holger Just
touch tmp/restart.txt</pre> The next HTTP request to ChiliProject will restart it.
48 2 Holger Just
* Another possibility is to reload the web server that passenger is embedded into. That could be either nginx or Apache2. depending on what you use issue one of the following commands:<pre>/etc/init.d/apache2 reload</pre><pre>/etc/init.d/nginx reload</pre>
49 1
50 1
h2. Mongrel / Mongrel Cluster
51 1
52 1
A typical deployment of mongrels are in a cluster of multiple processes with a loadbalancer (like Apache) in front. The @mysql_cluster@ gem is used to manage the actual mongrel processes. To restart all of them issue the following commands:<pre>/etc/init.d/mongrel_cluster stop
53 1
/etc/init.d/mongrel_cluster start</pre>
54 1
55 1
p(smallnote). Although a @restart@ command is also available, it will sometimes fail because of a race condition. So you are better of with first completely stopping and then again starting your cluster.
56 1
57 1
p(smallwarning). @mongrel_cluster@ can be configured to handle multiple Rails applications. The @start@ / @stop@ / @restart@ commands affect all of these. See the "documentation": for more information.
58 1
59 1
h2. Thin
60 1
61 1
<pre>cd /path/to/chiliproject
62 1
thin restart</pre>
63 1
64 1
h2. Unicorn
65 1
66 1
Unicorn uses "UNIX Signals": for most of its actions. Most of the time, these are encapsulated by an init script. But as this script is custom, we are going to send the restart signal directly to the running Unicorn instances.
67 1
68 1
<pre>cd /path/to/chiliproject
69 1
kill -USR2 `cat tmp/pids/`</pre>
70 1
71 1
p(smallnote). This command handles only the most common configration. As setting up Unicorn involves some customizations, these setups tend to be rather special. You are strongly advised to read more about how "Unicorn": works and how it is setup at your server before continuing.
72 1
73 1
h2. Webrick (@script/server@)
74 1
75 1
If you don't have a real application server installed but use the included Webrick server which can be started using @script/server@ in chiliprojects root directory, you can just @kill@ the process and start a new one.
76 1
77 1
At first get the process id (PID) of the running Webrick <pre>ps axu | grep /path/to/chiliproject | grep -v grep</pre> Select the process and remember the process id. It is in the first column of the output.
78 1
79 1
Now kill the process and start a new one
80 1
<pre>cd /path/to/chiliproject
81 1
kill PID # remember to substitute the PID
82 1
83 1
84 1
p(smallnote). Webrick is not suitable for production use. It is not recommended to use Webrick for anything other than development or testing. Use one of the many other guides in this wiki to setup ChiliProject with a real application server like "Phusion Passenger (mod_rails) ": or "Thin": instead.