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" />
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";
24
<div id="logo-floater">
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" />
32
<form action="http://www.google.com/cse" id="cse-search-box">
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" />
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>');
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>
61
<div class="breadcrumbs"><a href="https://ajuda.ubuntu.cat">Documentació de l'Ubuntu</a> > <a href="https://ajuda.ubuntu.cat/9.04">Ubuntu 9.04</a> > <span class="breadcrumb-link"><a href="index.html">Guia del servidor de l'Ubuntu</a></span> > <span class="breadcrumb-link"><a href="web-servers.html">Web Servers</a></span> > <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">
66
<h2 class="title" style="clear: both"><a id="ruby-on-rails"></a>Ruby on Rails</h2>
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">
78
<h3 class="title"><a id="ruby-on-rails-installation"></a>Instal·lació</h3>
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>.
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.
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:
102
<span class="command"><strong>sudo apt-get install rails</strong></span>
105
<div class="sect2" lang="ca" xml:lang="ca">
106
<div class="titlepage">
109
<h3 class="title"><a id="ruby-on-rails-configuration"></a>Configuration</h3>
114
Modify the <code class="filename">/etc/apache2/sites-available/default</code>
115
configuration file to setup your domains.
118
The first thing to change is the <span class="emphasis"><em>DocumentRoot</em></span>
121
<pre class="programlisting">
122
DocumentRoot /path/to/rails/application/public
125
Next, change the <Directory
126
"/path/to/rails/application/public"> directive:
128
<pre class="programlisting">
129
<Directory "/path/to/rails/application/public">
130
Options Indexes FollowSymLinks MultiViews ExecCGI
134
AddHandler cgi-script .cgi
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:
143
<span class="command"><strong>sudo a2enmod rewrite</strong></span>
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:
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>
154
<p>That's it! Now you have your Server ready for your
155
<span class="application"><strong>Ruby on Rails</strong></span> applications.
158
<div class="sect2" lang="ca" xml:lang="ca">
159
<div class="titlepage">
162
<h3 class="title"><a id="ruby-on-rails-references"></a>References</h3>
166
<div class="itemizedlist">
170
See the <a class="ulink" href="http://rubyonrails.org/" target="_top">Ruby on Rails</a> website for more information.
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>
184
<div xmlns="http://www.w3.org/1999/xhtml" class="navfooter">
186
<table width="100%" summary="Navigation footer">
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" />
194
<td width="40%" align="right"> <a accesskey="n" href="tomcat.html"><img src="../libs/navig/next.png" alt="Següent" /></a></td>
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" />
203
<td width="40%" align="right" valign="top"> Apache Tomcat</td>
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>
214
<img src="https://help.ubuntu.com/htdocs/ubuntunew/img/cap-bottom.png" alt="" />