You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Valerio Pachera <si...@gmail.com> on 2008/08/22 08:45:37 UTC

[users@httpd] Generic questions about apache configuration

http://httpd.apache.org/docs/2.2/sections.html
quote:
The <Location> directive need not have anything to do with the
filesystem. For example, the following example shows how to map a
particular URL to an internal Apache handler provided by mod_status.
No file called server-status needs to exist in the filesystem.

<Location /server-status>
SetHandler server-status
</Location>
-----------

Are we sure that in ALL filesystem this file has to not exist?
What happen if in my home directory I have a file called server-status
(it could be for example a file about another kind of server)?

---------------------------------------------------------------------
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] Re: Generic questions about apache configuration

Posted by Eric Covener <co...@gmail.com>.
On Fri, Aug 22, 2008 at 3:53 AM, Valerio Pachera <si...@gmail.com> wrote:
> In the apache.conf of debian lenny there's not the DocumentRoot
> directive but I know it to be /var/www.
> Is that an option given at compile time or is it stored somewhere else?
>
> Thanks.
>
> ---------------------------------------------------------------------
> 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
>
>

apache2ctl -V shows you compiled-in defaults, but just as likely that
DocumentRoot is somewhere in the myriad of files in /etc/apache2 --
try grep -R.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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


[users@httpd] Re: Generic questions about apache configuration

Posted by Valerio Pachera <si...@gmail.com>.
In the apache.conf of debian lenny there's not the DocumentRoot
directive but I know it to be /var/www.
Is that an option given at compile time or is it stored somewhere else?

Thanks.

---------------------------------------------------------------------
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] Generic questions about apache configuration

Posted by Eric Covener <co...@gmail.com>.
On Fri, Aug 22, 2008 at 2:45 AM, Valerio Pachera <si...@gmail.com> wrote:
> http://httpd.apache.org/docs/2.2/sections.html
> quote:
> The <Location> directive need not have anything to do with the
> filesystem. For example, the following example shows how to map a
> particular URL to an internal Apache handler provided by mod_status.
> No file called server-status needs to exist in the filesystem.
>
> <Location /server-status>
> SetHandler server-status
> </Location>
> -----------
>
> Are we sure that in ALL filesystem this file has to not exist?
> What happen if in my home directory I have a file called server-status
> (it could be for example a file about another kind of server)?

It doesn't matter if/where it exists, because you're explicitly
telling Apache to generate the response internally instead of reading
a file for this particular URL.



-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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] Re: Generic questions about apache configuration

Posted by Eric Covener <co...@gmail.com>.
On Fri, Aug 22, 2008 at 9:43 AM, Valerio Pachera <si...@gmail.com> wrote:
> 2008/8/22 Eric Covener <co...@gmail.com>:
>>> Why in the second case "SetHandleer" is used instead of "Addhandler" ?
>>
>> Because the second option already has a cgi-bin/ subdirectory on the
>> URL -- so everyhting should be treated as CGI not just certain files.
>
> Ok, by your answer and re-reading the documentation I cleared that
> Sethandler is used for
> directive <Directory> and <Lcation> and it DOESN'T LOOK at file extension.
>
> By the other hand, with Add handler you associate a handler to files
> with certains extension
> (Syntax:        AddHandler handler-name extension [extension] ...)
>
> In a forum I found this directive.
>
>   <Files "*.rhtml">
>      SetHandler ruby-object
>      RubyHandler Apache::ERubyRun.instance
>      Options +ExecCGI
>   </Files>
>
> As we can see SetHandler is used inside <file> directive! The
> documentation says it can be used only in <directory> and <location>
> section!
> But this seems the best way if I want to execute all .rhtml file in
> the DocumentRoot. Isn't it?
>
> Reference Documentation:
> http://httpd.apache.org/docs/2.2/mod/core.html#sethandler
> http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler
> http://httpd.apache.org/docs/2.2/mod/core.html#files


"directory" context usually means any of Files/Directory/Location containers.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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] Re: Generic questions about apache configuration

Posted by Valerio Pachera <si...@gmail.com>.
2008/8/22 Eric Covener <co...@gmail.com>:
>> Why in the second case "SetHandleer" is used instead of "Addhandler" ?
>
> Because the second option already has a cgi-bin/ subdirectory on the
> URL -- so everyhting should be treated as CGI not just certain files.

Ok, by your answer and re-reading the documentation I cleared that
Sethandler is used for
directive <Directory> and <Lcation> and it DOESN'T LOOK at file extension.

By the other hand, with Add handler you associate a handler to files
with certains extension
(Syntax:	AddHandler handler-name extension [extension] ...)

In a forum I found this directive.

   <Files "*.rhtml">
      SetHandler ruby-object
      RubyHandler Apache::ERubyRun.instance
      Options +ExecCGI
   </Files>

As we can see SetHandler is used inside <file> directive! The
documentation says it can be used only in <directory> and <location>
section!
But this seems the best way if I want to execute all .rhtml file in
the DocumentRoot. Isn't it?

Reference Documentation:
http://httpd.apache.org/docs/2.2/mod/core.html#sethandler
http://httpd.apache.org/docs/2.2/mod/mod_mime.html#addhandler
http://httpd.apache.org/docs/2.2/mod/core.html#files

---------------------------------------------------------------------
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] Re: Generic questions about apache configuration

Posted by Eric Covener <co...@gmail.com>.
On Fri, Aug 22, 2008 at 7:51 AM, Valerio Pachera <si...@gmail.com> wrote:
> http://httpd.apache.org/docs/2.2/howto/cgi.html

> To allow CGI program execution for any file ending in .cgi in users'
> directories, you can use the following configuration.
>
> <Directory /home/*/public_html>
> Options +ExecCGI
> AddHandler cgi-script .cgi
> </Directory>
>
> If you wish designate a cgi-bin subdirectory of a user's directory
> where everything will be treated as a CGI program, you can use the
> following.
>
> <Directory /home/*/public_html/cgi-bin>
> Options ExecCGI
> SetHandler cgi-script
> </Directory>
> -----------------
>
> Why in the second case "SetHandleer" is used instead of "Addhandler" ?

Because the second option already has a cgi-bin/ subdirectory on the
URL -- so everyhting should be treated as CGI not just certain files.

> And why "execCGI" does not have the "+" in front?

It's clearing all the other options.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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


[users@httpd] Re: Generic questions about apache configuration

Posted by Valerio Pachera <si...@gmail.com>.
http://httpd.apache.org/docs/2.2/howto/cgi.html

I do not understand the paragrph "User directories":

quote:
To allow CGI program execution for any file ending in .cgi in users'
directories, you can use the following configuration.

<Directory /home/*/public_html>
Options +ExecCGI
AddHandler cgi-script .cgi
</Directory>

If you wish designate a cgi-bin subdirectory of a user's directory
where everything will be treated as a CGI program, you can use the
following.

<Directory /home/*/public_html/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>
-----------------

Why in the second case "SetHandleer" is used instead of "Addhandler" ?
And why "execCGI" does not have the "+" in front?

---------------------------------------------------------------------
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] Re: Generic questions about apache configuration

Posted by Eric Covener <co...@gmail.com>.
On Fri, Aug 22, 2008 at 3:11 AM, Valerio Pachera <si...@gmail.com> wrote:
> Corret me if I'm wrong:
>
> <directory /a>
> rule1
> </directory>
>
> <directory /a/b>
> rule2
> </directory>
>
> rule1 is still valid for directory /a.

yes, and maybe for /a/b depending on how rule1 and rule2 relate to eachother.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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


[users@httpd] Re: Generic questions about apache configuration

Posted by Valerio Pachera <si...@gmail.com>.
Corret me if I'm wrong:

<directory /a>
rule1
</directory>

<directory /a/b>
rule2
</directory>

rule1 is still valid for directory /a.

---------------------------------------------------------------------
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