httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] Execute perl Script
Date Mon, 23 May 2005 08:39:59 GMT


> -----Original Message-----
> From: Mark Feather [mailto:markfeather@customnet.co.uk]
> Sent: Freitag, 20. Mai 2005 23:32
> To: users@httpd.apache.org
> Subject: Re: [users@httpd] Execute perl Script
> 
> 
> In fear of making a fool of myself!
> 
> Does the presence or absence of trailing forward slashes make 
> a difference?
> 
> Is: Alias /cgi-bin /srv/www/cgi-bin/
> 
> the same as: Alias /cgi-bin/ /srv/www/cgi-bin/
> 
> with or without the last forward slash too!

The arguments to Alias et al. are used in string-substitution functions so they usually substitute
exactly what you type. For example:

	Alias /cgi-bin /srv/www/cgi-bin/

Means that a request http://server/cgi-bin/prog becomes a filepath /srv/www/cgi-bin//prog
(note the double-/). On a unix system this doesn't make any difference since repeated slashes
are collapsed away. On the other hand, why complicate things? Just do the same thing on both
sides...

> 
> Is http://www.yourdomain.com/cgi-bin/ the same as
> http://www.yourdomain.com/cgi-bin in the browsers address bar 
> depending on
> what is written in the conf file?

Could be...

In the example you gave, yes. The substitution occurs as described above.

In the general case (http://server/wibble), all apache hears is; go to the docroot and get
something called "wibble". At this point it doesn't know if wibble is a file or a directory.
If it's a file it serves it, if it's a dir, it sends a redirect back to the client telling
it to request http://server/wibble/ [note added slash] (NB - the value used for "server" depends
on UseCanonicalName and ServerName - see docs for details). The client makes a second request
and this time apache knows in advance that a directory is being requested. So it serves up
a listing (if alllowed) or makes another redirect to http://server/wibble/index.html or whatever
the DirectoryIndex is set to (or gives a 403 Forbidden if access isn't allowed).  Note that
it's the redirection that makes the browser update its address bar.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 
> 
> > -----Original Message-----
> > From: Oliver Kirchel [mailto:kirchel@gutenberg-rz.de]
> > Sent: Freitag, 20. Mai 2005 09:25
> > To: users@httpd.apache.org
> > Subject: AW: [users@httpd] Execute perl Script
> >
> >
> > Hi,
> > OK, sorry is my first post.
> 
> No problem...
> 
> >
> > I changed it, like Joshua said.
> >
> > I put in the default-server.conf instead of
> >
> > ScriptAlias /cgi-bin "/srv/www/cgi-bin/"
> >
> > <Directory "/srv/www/cgi-bin">
> >         AllowOverride None
> >         Options +ExecCGI
> >         Order allow,deny
> >         Allow from all
> > </Directory>
> >
> > this
> >
> > Alias /cgi-bin /srv/www/cgi-bin/
> >
> > <Directory /srv/www/cgi-bin>
> > Options ExecCGI
> > SetHandler cgi-script
> > DirectoryIndex index.pl
> > </Directory>
> 
> This is OK - although, unless you have an "Allow from" 
> directive higher up
> the hierarchy, you might still need the "Allow from all" directive in
> here...
> 
> 
> >
> > Here is the result what the browser said:
> >
> > --------------------------------------------------------------
> > ----------
> > -------------------------------------------------------
> >
> > Zugriff verweigert!
> >
> > Der Zugriff auf das angeforderte Verzeichnis ist nicht
> > möglich. Entweder
> > ist kein Index-Dokument vorhanden oder das Verzeichnis ist
> > zugriffsgeschützt.
> >
> > Sofern Sie dies für eine Fehlfunktion des Servers halten, 
> informieren
> > Sie bitte den Webmaster hierüber.
> >
> > Error 403
> >
> > --------------------------------------------------------------
> > ----------
> > -------------------------------------------------------
> >
> > Sorry it is german but the most important part, I think, is 
> the Error
> > 403.
> >
> > And here is the part of the error_log:
> >
> > [Fri May 20 09:11:54 2005] [error] [client 222.222.222.222] 
> attempt to
> > invoke directory as script: /srv/www/cgi-bin/
> 
> This doesn't make sense.
> 
> - Are you *sure* you got this message *after* you changed the 
> config and
> restarted apache (you know you must restart apache for config 
> changes to
> take effect?)
> - You are sure this message is not an old message from a previous try?
> 
> The reason I'm so sceptical is that you will only get this 
> message if the
> directory is covered by a ScriptAlias directive. You can't get this if
> you're using the new directive set described by Joshua...
> 
> Do you maybe have a ScriptAlias somewhere else in the config?
> 
> Rgds,
> Owen Boyle
> Disclaimer: Any disclaimer attached to this message may be ignored.
> 
> 
> >
> > Olli
> >
> >
> >
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Boyle Owen [mailto:Owen.Boyle@swx.com]
> > > Gesendet: Freitag, 20. Mai 2005 09:03
> > > An: users@httpd.apache.org
> > > Betreff: RE: [users@httpd] Execute perl Script
> > >
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Oliver Kirchel [mailto:kirchel@gutenberg-rz.de]
> > > > Sent: Freitag, 20. Mai 2005 08:57
> > > > To: users@httpd.apache.org
> > > > Subject: AW: [users@httpd] Execute perl Script
> > > >
> > > >
> > > > Hi,
> > > > I tried it without ScriptAlias but it doesen't work either.
> > > Any other
> > > > ideas ?
> > >
> > > Please don't ever say "it doesn't work"... what *exactly* happens:
> > >
> > > - what exactly did you put in the config?
> > > - what exactly did the browser say? (switch off 
> "friendly" messages)
> > > - what exactly does it say in the error_log?
> > >
> > > Rgds,
> > > Owen Boyle
> > > Disclaimer: Any disclaimer attached to this message may 
> be ignored.
> > >
> > >
> > > >
> > > > Olli
> > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: Boyle Owen [mailto:Owen.Boyle@swx.com]
> > > > > Gesendet: Freitag, 20. Mai 2005 08:39
> > > > > An: users@httpd.apache.org
> > > > > Betreff: RE: [users@httpd] Execute perl Script
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Joshua Slive [mailto:jslive@gmail.com]
> > > > > > Sent: Donnerstag, 19. Mai 2005 18:40
> > > > > > To: users@httpd.apache.org
> > > > > > Subject: Re: [users@httpd] Execute perl Script
> > > > > >
> > > > > >
> > > > > > On 5/19/05, Boyle Owen <Owen.Boyle@swx.com> wrote:
> > > > > > > Plain text please...
> > > > > > >
> > > > > > > You have to set DirectoryIndex for the cgi dir as 
> you would
> > > > > > for any index file in a normal directory, ie:
> > > > > > >
> > > > > > > DirectoryIndex index.pl
> > > > > >
> > > > > > If I remember correctly, that doesn't work in ScriptAliased
> > > > > > directories.
> > > > >
> > > > > Oops - quite right... I did this once ages ago and forgot
> > > > > that I wasn't using ScriptAlias...
> > > > >
> > > > > Rgds,
> > > > > Owen Boyle
> > > > > Disclaimer: Any disclaimer attached to this message may
> > > be ignored.
> > > > >
> > > > > > You need to convert
> > > > > >
> > > > > > ScriptAlias /cgi-bin/ /path/to/cgi-bin/
> > > > > > to
> > > > > > Alias /cgi-bin /path/to/cgi-bin
> > > > > > <Directory /path/to/cgi-bin>
> > > > > > Options ExecCGI
> > > > > > SetHandler cgi-script
> > > > > > DirectoryIndex index.pl
> > > > > > </Directory>
> > > > > >
> > > > > > 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
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > This message is for the named person's use only. It may
> > > > > contain confidential, proprietary or legally privileged
> > > > > information. No confidentiality or privilege is waived or
> > > > > lost by any mistransmission. If you receive this message in
> > > > > error, please notify the sender urgently and then immediately
> > > > > delete the message and any copies of it from your system.
> > > > > Please also immediately destroy any hardcopies of the
> > > > > message. You must not, directly or indirectly, use, disclose,
> > > > > distribute, print, or copy any part of this message if you
> > > > > are not the intended recipient. The sender's company reserves
> > > > > the right to monitor all e-mail communications through their
> > > > > networks. Any views expressed in this message are those of
> > > > > the individual sender, except where the message states
> > > > > otherwise and the sender is authorised to state them to be
> > > > > the views of the sender's company.
> > > > >
> > > > >
> > > >
> > >
> > 
> ---------------------------------------------------------------------
> > > > > 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
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> > 
> ---------------------------------------------------------------------
> > > > 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
> > > >
> > > >
> > >
> > >
> > 
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> >
> >
> > 
> ---------------------------------------------------------------------
> > 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
> >
> >
> 
> ---------------------------------------------------------------------
> 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
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 

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


Mime
View raw message