index files in subdirectories

View: New views
13 Messages — Rating Filter:   Alert me  

index files in subdirectories

by Karl@cometa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a server set up with Apache/2.0.55 (Win32),  PHP/5.1.2, and Perl (ActivePerl 5.8.8 Build 817).

My main index page (index.php) resides in my DocumentRoot directory and is served by entering the url without the need to add index.php to the end.

This page has links to my company's bugzilla page and wiki page.

When setting up the links, if I add index.cgi (for Bugzilla) and index.php (for wiki) to the end of the urls the browser navigates to those pages and it all works ok but it I put a link in like http://blah.com/blah/ I get a forbidden message.
Apache wont serve the default pages for subdirectories of my DocumentRoot folder.

Does anyone know why this might be and how I may resolve this?

Karl

Re: index files in subdirectories

by musetracks :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Look for your DocumentRoot directive in your httpd.conf.  It will (or
should) contain a space-delimited list of file names (e.g. index.html
index.cgi).  Add "index.php" and you'll be all set.

On 7/12/06, Karl@cometa <karl@...> wrote:

>
> I have a server set up with Apache/2.0.55 (Win32),  PHP/5.1.2, and Perl
> (ActivePerl 5.8.8 Build 817).
>
> My main index page (index.php) resides in my DocumentRoot directory and is
> served by entering the url without the need to add index.php to the end.
>
> This page has links to my company's bugzilla page and wiki page.
>
> When setting up the links, if I add index.cgi (for Bugzilla) and index.php
> (for wiki) to the end of the urls the browser navigates to those pages and
> it all works ok but it I put a link in like http://blah.com/blah/ I get a
> forbidden message.
> Apache wont serve the default pages for subdirectories of my DocumentRoot
> folder.
>
> Does anyone know why this might be and how I may resolve this?
>
> Karl
> --
> View this message in context: http://www.nabble.com/index-files-in-subdirectories-tf1930381.html#a5287072
> Sent from the Apache HTTP Server - Users forum at Nabble.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@...
>    "   from the digest: users-digest-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>


--

Rob Wilkerson

---------------------------------------------------------------------
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@...
   "   from the digest: users-digest-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: index files in subdirectories

by musetracks :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry, I meant your DirectoryIndex directive, not your DocumentRoot
directive.  :-)

On 7/12/06, Rob Wilkerson <r.d.wilkerson@...> wrote:

> Look for your DocumentRoot directive in your httpd.conf.  It will (or
> should) contain a space-delimited list of file names (e.g. index.html
> index.cgi).  Add "index.php" and you'll be all set.
>
> On 7/12/06, Karl@cometa <karl@...> wrote:
> >
> > I have a server set up with Apache/2.0.55 (Win32),  PHP/5.1.2, and Perl
> > (ActivePerl 5.8.8 Build 817).
> >
> > My main index page (index.php) resides in my DocumentRoot directory and is
> > served by entering the url without the need to add index.php to the end.
> >
> > This page has links to my company's bugzilla page and wiki page.
> >
> > When setting up the links, if I add index.cgi (for Bugzilla) and index.php
> > (for wiki) to the end of the urls the browser navigates to those pages and
> > it all works ok but it I put a link in like http://blah.com/blah/ I get a
> > forbidden message.
> > Apache wont serve the default pages for subdirectories of my DocumentRoot
> > folder.
> >
> > Does anyone know why this might be and how I may resolve this?
> >
> > Karl
> > --
> > View this message in context: http://www.nabble.com/index-files-in-subdirectories-tf1930381.html#a5287072
> > Sent from the Apache HTTP Server - Users forum at Nabble.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@...
> >    "   from the digest: users-digest-unsubscribe@...
> > For additional commands, e-mail: users-help@...
> >
> >
>
>
> --
>
> Rob Wilkerson
>


--

Rob Wilkerson

---------------------------------------------------------------------
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@...
   "   from the digest: users-digest-unsubscribe@...
For additional commands, e-mail: users-help@...


Parent Message unknown RE: index files in subdirectories

by Boyle Owen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> -----Original Message-----
> From: Karl@cometa [mailto:karl@...]
> Sent: Wednesday, July 12, 2006 1:43 PM
> To: users@...
> Subject: [users@httpd] index files in subdirectories
>
>
> I have a server set up with Apache/2.0.55 (Win32),  
> PHP/5.1.2, and Perl
> (ActivePerl 5.8.8 Build 817).
>
> My main index page (index.php) resides in my DocumentRoot
> directory and is
> served by entering the url without the need to add index.php
> to the end.
>
> This page has links to my company's bugzilla page and wiki page.
>
> When setting up the links, if I add index.cgi (for Bugzilla)
> and index.php
> (for wiki) to the end of the urls the browser navigates to
> those pages and
> it all works ok but it I put a link in like
> http://blah.com/blah/ I get a
> forbidden message.
> Apache wont serve the default pages for subdirectories of my
> DocumentRoot
> folder.

"forbidden message" is too imprecise - what is the exact error message,
response code and what is in the error logs?

Wild guess: Are the default pages called "index.php"? I presume you have
"DirectoryIndex index.php" in the Docroot so this should apply to the
subdirs too...

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.

>
> Does anyone know why this might be and how I may resolve this?
>
> Karl
> --
> View this message in context:
> http://www.nabble.com/index-files-in-subdirectories-tf1930381.
html#a5287072

> Sent from the Apache HTTP Server - Users forum at Nabble.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@...
>    "   from the digest: users-digest-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
 
 
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@...
   "   from the digest: users-digest-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: index files in subdirectories

by Ashutosh Mohanty :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

its not "DocumentRoot directive"  its "DirectoryIndex directive"  :-)

ashutosh
----- Original Message -----
From: "Rob Wilkerson" <r.d.wilkerson@...>
To: <users@...>
Sent: Wednesday, July 12, 2006 5:54 PM
Subject: Re: [users@httpd] index files in subdirectories


> Look for your DocumentRoot directive in your httpd.conf.  It will (or
> should) contain a space-delimited list of file names (e.g. index.html
> index.cgi).  Add "index.php" and you'll be all set.
>
> On 7/12/06, Karl@cometa <karl@...> wrote:
> >
> > I have a server set up with Apache/2.0.55 (Win32),  PHP/5.1.2, and Perl
> > (ActivePerl 5.8.8 Build 817).
> >
> > My main index page (index.php) resides in my DocumentRoot directory and
is
> > served by entering the url without the need to add index.php to the end.
> >
> > This page has links to my company's bugzilla page and wiki page.
> >
> > When setting up the links, if I add index.cgi (for Bugzilla) and
index.php
> > (for wiki) to the end of the urls the browser navigates to those pages
and
> > it all works ok but it I put a link in like http://blah.com/blah/ I get
a
> > forbidden message.
> > Apache wont serve the default pages for subdirectories of my
DocumentRoot
> > folder.
> >
> > Does anyone know why this might be and how I may resolve this?
> >
> > Karl
> > --
> > View this message in context:
http://www.nabble.com/index-files-in-subdirectories-tf1930381.html#a5287072
> > Sent from the Apache HTTP Server - Users forum at Nabble.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@...
> >    "   from the digest: users-digest-unsubscribe@...
> > For additional commands, e-mail: users-help@...
> >
> >
>
>
> --
>
> Rob Wilkerson
>
> ---------------------------------------------------------------------
> 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@...
>    "   from the digest: users-digest-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>
>


---------------------------------------------------------------------
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@...
   "   from the digest: users-digest-unsubscribe@...
For additional commands, e-mail: users-help@...


RE: index files in subdirectories

by Karl@cometa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

My directory index is already set to:

DirectoryIndex index.cgi index.php index.html index.html.var

but I'm still getting this problem.


The messages I get are:

Forbidden
You don't have permission to access /cometawiki/ on this server.

Forbidden
You don't have permission to access /cometazilla/ on this server.


My Document root directory has index.php in it and this does automatically load when I navigate to the directory.
cometawiki and cometazilla are subdirectories of the DocumentRoot directory and have index.php and index.cgi in them respectively.

If I put the links in the main index file as ./cometawiki/index.php and ./cometawiki/index.cgi they load if I put them as ./cometawiki/ and ./cometazilla/ it doesn't load them, it gives the forbidden message above.


The error log says:

[Wed Jul 12 13:48:49 2006] [error] [client <snip>] attempt to invoke directory as script: D:/Websites/gateway/cometawiki/, referer: http://<snip>/

I've snipped out the ip and url so I don't get loads of trash from webcrawlers :P

gateway is my DocumentRoot directory where initial index.php is stored

Re: RE: index files in subdirectories

by Ashutosh Mohanty :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Okay, this is due to the permission problem

look at your user /group setting in apache httpd.conf, and then go to the
respective directory and change those ownership according to that

like

# chown user.group <directory name> (do it as a sudo user)
----- Original Message -----
From: "Karl@cometa" <karl@...>
To: <users@...>
Sent: Wednesday, July 12, 2006 6:23 PM
Subject: [users@httpd] RE: index files in subdirectories


>
> My directory index is already set to:
>
> DirectoryIndex index.cgi index.php index.html index.html.var
>
> but I'm still getting this problem.
>
>
> The messages I get are:
>
> Forbidden
> You don't have permission to access /cometawiki/ on this server.
>
> Forbidden
> You don't have permission to access /cometazilla/ on this server.
>
>
> My Document root directory has index.php in it and this does automatically
> load when I navigate to the directory.
> cometawiki and cometazilla are subdirectories of the DocumentRoot
directory

> and have index.php and index.cgi in them respectively.
>
> If I put the links in the main index file as ./cometawiki/index.php and
> ./cometawiki/index.cgi they load if I put them as ./cometawiki/ and
> ./cometazilla/ it doesn't load them, it gives the forbidden message above.
>
>
> The error log says:
>
> [Wed Jul 12 13:48:49 2006] [error] [client <snip>] attempt to invoke
> directory as script: D:/Websites/gateway/cometawiki/, referer:
> http://<snip>/
>
> I've snipped out the ip and url so I don't get loads of trash from
> webcrawlers :P
>
> gateway is my DocumentRoot directory where initial index.php is stored
> --
> View this message in context:
http://www.nabble.com/index-files-in-subdirectories-tf1930381.html#a5288054

> Sent from the Apache HTTP Server - Users forum at Nabble.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@...
>    "   from the digest: users-digest-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>
>


---------------------------------------------------------------------
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@...
   "   from the digest: users-digest-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: RE: index files in subdirectories

by Karl@cometa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm running apache on a Windows 2003 Server machine (not my choice of operating system :P) so I can't run chown :(

My directory settings are:

<Directory "D:/Websites/gateway">
   Options Indexes FollowSymLinks ExecCGI
   AllowOverride All
   Order allow,deny
   Allow from all
   ScriptInterpreterSource Registry-Strict
</Directory>

<Directory "D:/Websites/gateway/cometawiki">
    Options All
#Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>


<Directory "D:/Websites/gateway/cometazilla">
    Options All
#Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Do I need to do something here or do I need to go to change the folder permissions on the security tab in Windows?

Parent Message unknown RE: RE: index files in subdirectories

by Boyle Owen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> -----Original Message-----
> From: Karl@cometa [mailto:karl@...]
> Sent: Wednesday, July 12, 2006 2:53 PM
> To: users@...
> Subject: [users@httpd] RE: index files in subdirectories
>
>
> My directory index is already set to:
>
> DirectoryIndex index.cgi index.php index.html index.html.var
>
> but I'm still getting this problem.
>
>
> The messages I get are:
>
> Forbidden
> You don't have permission to access /cometawiki/ on this server.
>
> Forbidden
> You don't have permission to access /cometazilla/ on this server.

This is not necessarily a permissions problem - a mod_access "Deny" also
gives this message. That's why it's important to check the error logs.

read on....

>
>
> My Document root directory has index.php in it and this does
> automatically
> load when I navigate to the directory.
> cometawiki and cometazilla are subdirectories of the
> DocumentRoot directory
> and have index.php and index.cgi in them respectively.
>
> If I put the links in the main index file as
> ./cometawiki/index.php and
> ./cometawiki/index.cgi they load if I put them as ./cometawiki/ and
> ./cometazilla/ it doesn't load them, it gives the forbidden
> message above.
>
>
> The error log says:
>
> [Wed Jul 12 13:48:49 2006] [error] [client <snip>] attempt to invoke
> directory as script: D:/Websites/gateway/cometawiki/, referer:
> http://<snip>/

OK - here's the problem. You are attempting to invoke a directory as if
it were a script. That is, you're trying to "execute" the directory
(obviously, that can't be done). I guess you have a misconfiguration
(ScriptAlias pointing to that dir, or AddHandler)? I actually can't
think how you can get that to happen... congratulations.

NB - that's yet another way to get a "forbidden" message; hence the
importance of error logs.

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.

>
> I've snipped out the ip and url so I don't get loads of trash from
> webcrawlers :P
>
> gateway is my DocumentRoot directory where initial index.php is stored
> --
> View this message in context:
> http://www.nabble.com/index-files-in-subdirectories-tf1930381.
html#a5288054

> Sent from the Apache HTTP Server - Users forum at Nabble.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@...
>    "   from the digest: users-digest-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
 
 
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@...
   "   from the digest: users-digest-unsubscribe@...
For additional commands, e-mail: users-help@...


RE: RE: index files in subdirectories

by Karl@cometa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ah...well I do have the lines:

ScriptAlias /cometawiki/ "D:/Websites/gateway/cometawiki/"
ScriptAlias /cometazilla/ "D:/Websites/gateway/cometazilla/"

in my httpd.conf but if I remove them I still get the forbidden message but now I also get them when I use the full url i.e. even using ./cometawiki/index.php brings up the forbidden message when formerly this processed the page.

RE: RE: index files in subdirectories

by Karl@cometa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The error I get with the scriptaliases removed is:

[Wed Jul 12 14:58:25 2006] [error] [client <snip>] Options ExecCGI is off in this directory: D:/Websites/gateway/cometazilla/index.cgi, referer: http://<snip>/

Parent Message unknown RE: RE: RE: index files in subdirectories

by Boyle Owen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> -----Original Message-----
> From: Karl@cometa [mailto:karl@...]
> Sent: Wednesday, July 12, 2006 3:53 PM
> To: users@...
> Subject: [users@httpd] RE: RE: index files in subdirectories
>
>
> Ah...well I do have the lines:
>
> ScriptAlias /cometawiki/ "D:/Websites/gateway/cometawiki/"
> ScriptAlias /cometazilla/ "D:/Websites/gateway/cometazilla/"

I think I get it - you're executing PHP scripts as CGIs... But since
you're defining a whole directory as CGI (with ScriptAlias) you can no
longer browse it.

Re-read the PHO docs - I think the correct way to set this up is to use:
 "AddType application/x-httpd-php .php"

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored.

>
> in my httpd.conf but if I remove them I still get the
> forbidden message but
> now I also get them when I use the full url i.e. even using
> ./cometawiki/index.php brings up the forbidden message when
> formerly this
> processed the page.
> --
> View this message in context:
> http://www.nabble.com/index-files-in-subdirectories-tf1930381.
html#a5289031

> Sent from the Apache HTTP Server - Users forum at Nabble.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@...
>    "   from the digest: users-digest-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
 
 
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@...
   "   from the digest: users-digest-unsubscribe@...
For additional commands, e-mail: users-help@...


RE: RE: index files in subdirectories

by Karl@cometa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

SOLVED IT!

I realised I'd tried setting the directories settings to the same as the DocumentRoot and I'd tried taking out the script aliases but I'd not tried doing both at once. When I did that it worked.

Thanks for all you help folks.

Karl