<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hogyan? &#187; Ruby</title>
	<atom:link href="http://hogyan.org/cimkek/ruby/feed" rel="self" type="application/rss+xml" />
	<link>http://hogyan.org</link>
	<description>Linux és Windows hogyanok, leírások</description>
	<lastBuildDate>Tue, 16 Mar 2010 12:00:17 +0000</lastBuildDate>
	
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ubuntu + Ruby + Apache</title>
		<link>http://hogyan.org/ubuntu-ruby-apache</link>
		<comments>http://hogyan.org/ubuntu-ruby-apache#comments</comments>
		<pubDate>Mon, 29 Jun 2009 05:46:30 +0000</pubDate>
		<dc:creator>Ikon</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[szerver]]></category>
		<category><![CDATA[telepítés]]></category>

		<guid isPermaLink="false">http://hogyan.org/?p=2476</guid>
		<description><![CDATA[Ez az én megoldásom az Apache-Ruby kombóra Ubuntu 8 és 9 alá.

Telepítsük az apache, eruby és ruby mod-okat:

sudo apt-get install apache2 eruby libapache2-mod-ruby

Aktiváljuk az actions mod-ot:

sudo a2enmod actions

Ez pedig a mozgatórugója az egésznek, ne felejtsük el a symlinket!:

sudo ln -s `which eruby` /usr/lib/cgi-bin/eruby

/ect/apache2/mods-available/ruby.conf nevű fájlt pedig a következő tartalommal hozzuk létre:

AddType text/html .rhtml
&#160;
RubyRequire apache/ruby-run
RubyRequire apache/eruby-run


# [...]]]></description>
			<content:encoded><![CDATA[<p>Ez az én megoldásom az Apache-Ruby kombóra Ubuntu 8 és 9 alá.<br />
<span id="more-2476"></span><br />
Telepítsük az <em>apache, eruby</em> és <em>ruby</em> mod-okat:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2 eruby libapache2-mod-ruby</pre></div></div>

<p>Aktiváljuk az <em>actions</em> mod-ot:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod actions</pre></div></div>

<p>Ez pedig a mozgatórugója az egésznek, ne felejtsük el a symlinket!:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">which</span> eruby<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>cgi-bin<span style="color: #000000; font-weight: bold;">/</span>eruby</pre></div></div>

<p><em>/ect/apache2/mods-available/ruby.conf</em> nevű fájlt pedig a következő tartalommal hozzuk létre:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">AddType</span> text/html .rhtml
&nbsp;
RubyRequire apache/ruby-run
RubyRequire apache/eruby-run</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># Execute *.rbx files as Ruby scripts</span>
<span style="color: #00007f;">Options</span> +ExecCGI
<span style="color: #00007f;">SetHandler</span> ruby-object
RubyHandler Apache::RubyRun.instance
<span style="color: #adadad; font-style: italic;"># Handle *.rhtml files as eRuby files</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">SetHandler</span> ruby-object
RubyHandler Apache::ERubyRun.instance</pre></div></div>

<p><em>/ect/apache2/mods-available/actions.conf</em> nevű fájlba ezt szúrjuk be:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">Action</span> application/x-httpd-eruby /cgi-bin/eruby</pre></div></div>

<p><em>/etc/mime.types</em> filehoz ezt adjuk még hozzá:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">application/x-httpd-eruby            rhtml</pre></div></div>

<p>Majd újralőjjük az apache-ot:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 reload</pre></div></div>

<p>Aztán egy teszt <em>x.rhtml</em> file és láthatjuk, hogy jól dolgoztunk-e:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;% puts 'Hello World!' %&gt;</pre></div></div>


	Címkék: <a href="http://hogyan.org/cimkek/apache" title="apache" rel="tag">apache</a>, <a href="http://hogyan.org/cimkek/ruby" title="Ruby" rel="tag">Ruby</a>, <a href="http://hogyan.org/cimkek/szerver" title="szerver" rel="tag">szerver</a>, <a href="http://hogyan.org/cimkek/telepites" title="telepítés" rel="tag">telepítés</a>, <a href="http://hogyan.org/cimkek/ubuntu" title="Ubuntu" rel="tag">Ubuntu</a>
]]></content:encoded>
			<wfw:commentRss>http://hogyan.org/ubuntu-ruby-apache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
