S
Sam Waller
I can get Apache2 on Ubuntu Edgy to execute ruby (.rb) files. But I'm having
trouble getting it to recognize .rhtml files. Here is the sites-available file.
/etc/apache2/sites-available/www.site.local:
<VirtualHost *>
ServerAdmin (e-mail address removed)
ServerName www.site.local
ServerAlias site.local
AddHandler cgi-script .rb
AddType application/x-httpd-eruby .rhtml
DirectoryIndex index.php
DocumentRoot /var/www/site
ScriptAlias /cgi-bin/ /var/www/site/
<Location />
Options +ExecCGI
</Location>
ErrorLog /var/www/site/logs/error.log
CustomLog /var/www/site/logs/access.log combined
</VirtualHost>
I installed eruby and have /usr/sbin/eruby in my path. I'm trying to get a
ruby hit counter embedded in html format files, so I think that I'd need
eruby to do that. If I try opening test.rhtml the browser wants to open it
as text or download it. Here is test.rhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>eruby test</title>
</head>
<body>
<center>
<h1>eruby test</h1>
<p>
<% print "hello world" %>
</p>
</center>
</body>
</html>
Can someone explain how to get .rhtml files working with Apache2?
thanks,
Sam
trouble getting it to recognize .rhtml files. Here is the sites-available file.
/etc/apache2/sites-available/www.site.local:
<VirtualHost *>
ServerAdmin (e-mail address removed)
ServerName www.site.local
ServerAlias site.local
AddHandler cgi-script .rb
AddType application/x-httpd-eruby .rhtml
DirectoryIndex index.php
DocumentRoot /var/www/site
ScriptAlias /cgi-bin/ /var/www/site/
<Location />
Options +ExecCGI
</Location>
ErrorLog /var/www/site/logs/error.log
CustomLog /var/www/site/logs/access.log combined
</VirtualHost>
I installed eruby and have /usr/sbin/eruby in my path. I'm trying to get a
ruby hit counter embedded in html format files, so I think that I'd need
eruby to do that. If I try opening test.rhtml the browser wants to open it
as text or download it. Here is test.rhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>eruby test</title>
</head>
<body>
<center>
<h1>eruby test</h1>
<p>
<% print "hello world" %>
</p>
</center>
</body>
</html>
Can someone explain how to get .rhtml files working with Apache2?
thanks,
Sam