~ubuntu.cat/ubuntaires/ajuda

« back to all changes in this revision

Viewing changes to jaunty/build/html/serverguide/ruby-on-rails.html

  • Committer: Arnau Alcázar Lleopart
  • Date: 2009-07-15 17:38:44 UTC
  • Revision ID: arnau@alcalleop.net-20090715173844-67maxucr1l9enivg
Afegida la traducció de la Jaunty

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
 
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
<html xmlns="http://www.w3.org/1999/xhtml">
 
4
  <head xmlns="http://www.w3.org/1999/xhtml">
 
5
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 
6
    <title xmlns="">Ruby on Rails</title>
 
7
    <link rel="stylesheet" href="../libs/ubuntu-book.css" type="text/css" />
 
8
    <link rel="start" href="index.html" title="Guia del servidor de l'Ubuntu" />
 
9
    <link rel="up" href="web-servers.html" title="Capítol 9. Web Servers" />
 
10
    <link rel="prev" href="squid.html" title="Squid - Proxy Server" />
 
11
    <link rel="next" href="tomcat.html" title="Apache Tomcat" />
 
12
    <link rel="copyright" href="legal.html" title="Credits and License" />
 
13
  </head>
 
14
  <body>
 
15
    <div id="round">
 
16
      <img id="topcap" alt="" src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-top.png" />
 
17
      <div id="layout" class="container clear-block">
 
18
        <script xmlns="" src="https://ssl.google-analytics.com/urchin.js" type="text/javascript"></script>
 
19
        <script xmlns="" type="text/javascript">
 
20
_uacct = "UA-1018242-8";
 
21
urchinTracker();
 
22
</script>
 
23
        <div id="header">
 
24
          <div id="logo-floater">
 
25
            <h1>
 
26
              <a href="https://help.ubuntu.com" title="Documentació d'Ubuntu">
 
27
                <img alt="Ubuntu" id="logo" src="https://help.ubuntu.com/htdocs/ubuntunew/img/logo.png" />
 
28
              </a>
 
29
            </h1>
 
30
          </div>
 
31
          <noscript>
 
32
            <form action="http://www.google.com/cse" id="cse-search-box">
 
33
              <div>
 
34
                <input type="hidden" name="cx" value="003883529982892832976:e2vwumte3fq" />
 
35
                <input type="hidden" name="ie" value="UTF-8" />
 
36
                <input type="text" name="q" size="27" />
 
37
                <input type="submit" name="sa" value="Search" />
 
38
              </div>
 
39
            </form>
 
40
          </noscript>
 
41
          <script>
 
42
 document.write('<form action="https://help.ubuntu.com/search.html" id="cse-search-box">');
 
43
 document.write('  <div>');
 
44
 document.write('    <input type="hidden" name="cof" value="FORID:9" />');
 
45
 document.write('    <input type="hidden" name="cx" value="003883529982892832976:e2vwumte3fq" />');
 
46
 document.write('    <input type="hidden" name="ie" value="UTF-8" />');
 
47
 document.write('    <input type="text" name="q" size="27" />');
 
48
 document.write('    <input type="submit" name="sa" value="Search" />');
 
49
 document.write('  </div>');
 
50
 document.write('</form>');
 
51
</script>
 
52
          <div id="sitename">
 
53
            <a href="https://help.ubuntu.com/">
 
54
              <img alt="Documentació oficial" src="https://help.ubuntu.com/htdocs/ubuntunew/img/help-about.png" />
 
55
              <span>Documentació oficial</span>
 
56
            </a>
 
57
          </div>
 
58
        </div>
 
59
        <div id="page">
 
60
          <div id="content">
 
61
            <div class="breadcrumbs"><a href="https://ajuda.ubuntu.cat">Documentació de l'Ubuntu</a> &gt; <a href="https://ajuda.ubuntu.cat/9.04">Ubuntu 9.04</a> &gt; <span class="breadcrumb-link"><a href="index.html">Guia del servidor de l'Ubuntu</a></span> &gt; <span class="breadcrumb-link"><a href="web-servers.html">Web Servers</a></span> &gt; <span class="breadcrumb-node">Ruby on Rails</span></div>
 
62
            <div xmlns="http://www.w3.org/1999/xhtml" class="sect1" lang="ca" xml:lang="ca">
 
63
              <div class="titlepage">
 
64
                <div>
 
65
                  <div>
 
66
                    <h2 class="title" style="clear: both"><a id="ruby-on-rails"></a>Ruby on Rails</h2>
 
67
                  </div>
 
68
                </div>
 
69
              </div>
 
70
              <p>Ruby on Rails is an open source web framework for developing
 
71
    database backed web applications. It is optimized for sustainable
 
72
    productivity of the programmer since it lets the programmer to write
 
73
    code by favouring convention over configuration.</p>
 
74
              <div class="sect2" lang="ca" xml:lang="ca">
 
75
                <div class="titlepage">
 
76
                  <div>
 
77
                    <div>
 
78
                      <h3 class="title"><a id="ruby-on-rails-installation"></a>Instal·lació</h3>
 
79
                    </div>
 
80
                  </div>
 
81
                </div>
 
82
                <p>
 
83
            Before installing <span class="application"><strong>Rails</strong></span> you should install <span class="application"><strong>Apache</strong></span>
 
84
            and <span class="application"><strong>MySQL</strong></span>.
 
85
            To install the <span class="application"><strong>Apache</strong></span> package, please refer to
 
86
            <a class="xref" href="httpd.html" title="HTTPD - Apache2 Web Server">“HTTPD - Apache2 Web Server”</a>.  For instructions on installing 
 
87
            <span class="application"><strong>MySQL</strong></span> refer to
 
88
            <a class="xref" href="mysql.html" title="MySQL">“MySQL”</a>.
 
89
        </p>
 
90
                <p>
 
91
        Once you have <span class="application"><strong>Apache</strong></span> and
 
92
        <span class="application"><strong>MySQL</strong></span> packages installed,
 
93
        you are ready to install <span class="application"><strong>Ruby on
 
94
        Rails</strong></span> package.
 
95
      </p>
 
96
                <p> 
 
97
      To install the <span class="application"><strong>Ruby</strong></span> base packages and
 
98
      <span class="application"><strong>Ruby on Rails</strong></span>,
 
99
      you can enter the following command in the terminal prompt:
 
100
      </p>
 
101
                <pre class="screen">
 
102
<span class="command"><strong>sudo apt-get install rails</strong></span>
 
103
</pre>
 
104
              </div>
 
105
              <div class="sect2" lang="ca" xml:lang="ca">
 
106
                <div class="titlepage">
 
107
                  <div>
 
108
                    <div>
 
109
                      <h3 class="title"><a id="ruby-on-rails-configuration"></a>Configuration</h3>
 
110
                    </div>
 
111
                  </div>
 
112
                </div>
 
113
                <p>
 
114
        Modify the <code class="filename">/etc/apache2/sites-available/default</code>
 
115
        configuration file to setup your domains.
 
116
    </p>
 
117
                <p>
 
118
        The first thing to change is the <span class="emphasis"><em>DocumentRoot</em></span>
 
119
      directive:
 
120
    </p>
 
121
                <pre class="programlisting">
 
122
DocumentRoot /path/to/rails/application/public
 
123
</pre>
 
124
                <p>
 
125
        Next, change the &lt;Directory
 
126
      "/path/to/rails/application/public"&gt; directive:
 
127
    </p>
 
128
                <pre class="programlisting">
 
129
&lt;Directory "/path/to/rails/application/public"&gt;
 
130
        Options Indexes FollowSymLinks MultiViews ExecCGI
 
131
        AllowOverride All
 
132
        Order allow,deny
 
133
        allow from all
 
134
        AddHandler cgi-script .cgi
 
135
&lt;/Directory&gt;
 
136
</pre>
 
137
                <p>
 
138
    You should also enable the <span class="application"><strong>mod_rewrite</strong></span>
 
139
    module for Apache.  To enable <span class="application"><strong>mod_rewrite</strong></span>
 
140
    module, please enter the following command in a terminal prompt: 
 
141
    </p>
 
142
                <pre class="screen">
 
143
<span class="command"><strong>sudo a2enmod rewrite</strong></span>
 
144
</pre>
 
145
                <p>
 
146
    Finally you will need to change the ownership of the <code class="filename">/path/to/rails/application/public</code>
 
147
    and <code class="filename">/path/to/rails/application/tmp</code> directories to the user used to run the 
 
148
    <span class="application"><strong>Apache</strong></span> process:
 
149
    </p>
 
150
                <pre class="screen">
 
151
<span class="command"><strong>sudo chown -R www-data:www-data /path/to/rails/application/public</strong></span>
 
152
<span class="command"><strong>sudo chown -R www-data:www-data /path/to/rails/application/tmp</strong></span>
 
153
</pre>
 
154
                <p>That's it! Now you have your Server ready for your
 
155
    <span class="application"><strong>Ruby on Rails</strong></span> applications.
 
156
    </p>
 
157
              </div>
 
158
              <div class="sect2" lang="ca" xml:lang="ca">
 
159
                <div class="titlepage">
 
160
                  <div>
 
161
                    <div>
 
162
                      <h3 class="title"><a id="ruby-on-rails-references"></a>References</h3>
 
163
                    </div>
 
164
                  </div>
 
165
                </div>
 
166
                <div class="itemizedlist">
 
167
                  <ul type="disc">
 
168
                    <li>
 
169
                      <p>
 
170
            See the <a class="ulink" href="http://rubyonrails.org/" target="_top">Ruby on Rails</a> website for more information.
 
171
            </p>
 
172
                    </li>
 
173
                    <li>
 
174
                      <p>
 
175
            Also <a class="ulink" href="http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition" target="_top">Agile Development with Rails</a>
 
176
            is a great resource.
 
177
            </p>
 
178
                    </li>
 
179
                  </ul>
 
180
                </div>
 
181
              </div>
 
182
            </div>
 
183
          </div>
 
184
          <div xmlns="http://www.w3.org/1999/xhtml" class="navfooter">
 
185
            <hr />
 
186
            <table width="100%" summary="Navigation footer">
 
187
              <tr>
 
188
                <td width="40%" align="left"><a accesskey="p" href="squid.html"><img src="../libs/navig/prev.png" alt="Anterior" /></a> </td>
 
189
                <td width="20%" align="center">
 
190
                  <a accesskey="u" href="web-servers.html">
 
191
                    <img src="../libs/navig/up.png" alt="Pujar" />
 
192
                  </a>
 
193
                </td>
 
194
                <td width="40%" align="right"> <a accesskey="n" href="tomcat.html"><img src="../libs/navig/next.png" alt="Següent" /></a></td>
 
195
              </tr>
 
196
              <tr>
 
197
                <td width="40%" align="left" valign="top">Squid - Proxy Server </td>
 
198
                <td width="20%" align="center">
 
199
                  <a accesskey="h" href="index.html">
 
200
                    <img src="../libs/navig/home.png" alt="Inici" />
 
201
                  </a>
 
202
                </td>
 
203
                <td width="40%" align="right" valign="top"> Apache Tomcat</td>
 
204
              </tr>
 
205
            </table>
 
206
          </div>
 
207
          <hr />
 
208
          <div id="footer">
 
209
            <div id="ubuntulinks">
 
210
              <p>Aquest material es troba sota una llicència lliure, vegeu<a href="/legal.html">això</a> per a més detalls<br /></p>
 
211
            </div>
 
212
          </div>
 
213
          <div id="bottomcap">
 
214
            <img src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-bottom.png" alt="" />
 
215
          </div>
 
216
        </div>
 
217
      </div>
 
218
    </div>
 
219
  </body>
 
220
</html>