You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Salisbury <sa...@globe.gov> on 2006/09/30 01:30:28 UTC

[users@httpd] AddType & Action directives

There seems to be some magic that goes on behind the scenes, and perhaps
someone can shed some light.  We have a php script that works with the 
pertinent Apache configuration directives being:


ScriptAlias /php/ "/usr/local/bin/"
<Location ~ /php>
 Options -Indexes
</Location>
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php"


Though I don't believe the Location directive does anything other
than restrict auto-indexing.

With the above directives a .php file is read and processed by PHP, even 
though there is nothing in the url with php in the path, just
/some/dir/phpinfo.php works!  That to me is magic, as I would 
think the /php/ directory would be what tells apache to go to 
/usr/local/bin/php.

anyways, I'm trying to do the same thing with eruby ( actually erb )
and can't seem to get it to work


ScriptAlias /erb/ "/usr/local/bin/"
AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby /erb/erb
 

And I'm asked if I want to download the file.  and in looking, that file is the html for a 500
internal server error

I do have 
application/x-httpd-eruby       rhtml
in mime types, but I think that's only used if I don't add the AddType in the conf file.

Any help clarifying what's going on would be appreciated.

Thanx!

-ds



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] AddType & Action directives

Posted by Joshua Slive <jo...@slive.ca>.
On 9/29/06, David Salisbury <sa...@globe.gov> wrote:

> anyways, I'm trying to do the same thing with eruby ( actually erb )
> and can't seem to get it to work
>
>
> ScriptAlias /erb/ "/usr/local/bin/"

Oooo... Bad idea.  You just gave web access to your /usr/local/bin/
directory.  Very dangerous.

> AddType application/x-httpd-eruby .rhtml
> Action application/x-httpd-eruby /erb/erb
>
>
> And I'm asked if I want to download the file.  and in looking, that file is the html for a 500
> internal server error

And what does the apache error log say?

In general, this setup assumes that /usr/local/bin/erb knows what to
do when called as a CGI script in this manner.  From my very limitted
knowledge of eruby, it appears that it doesn't even know to emit the
HTTP content-type header, meaning that it can't be called directly as
a CGI script.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org