You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Juarez Jr <ju...@gmail.com> on 2004/10/08 14:08:32 UTC

[users@httpd] Apache 2.0 don`t open files in DocumentRoot

Hi,

This is the first e-mail that I' m sending to the list, and I would like
that somebody help me with this.

I have some Web Server, and they runs the Apache 1.3.28, in some
virtualhosts the RootDocument opens a php file, for example:

<Virtualhost IPLOCAL>
ServerName demo.tester.com
DocumentRoot /web/sys/init.php
</Virtualhost>

In Apache 1.3, the server works fine.
The problem is, when I try to redirect files in DocummentRoot in Apache 2.0,
it says that the folder does not exist.



Best Regards


Juarez Junior

---------------------------------------------------------------------
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] Apache 2.0 don`t open files in DocumentRoot

Posted by Robert Andersson <ro...@profundis.nu>.
Juarez Jr wrote:
> When I access http://alfa.desenv2.com/ it accesses fine, but nothing
> appears in the $_SERVER["PATH_INFO"]. and when I access
> http://alfa.desenv2.com/fidelity/programs/
> It does not find !
> In order to access I would have to put :
> http://alfa.desenv2.com/init.php/fidelity/programs/

You didn't tell us how you wanted it to behave. Do you want *all* requests 
to be handled by the PHP script? Then, something like:

    <VirtualHost *>
        ServerName dome.tester.com
        DocumentRoot /web/sys
        RewriteEngine On
        RewriteCond %{REQUEST_URI} !init\.php
        RewriteRule .* /init.php [PT,L]
        ...
    </VirtualHost>

That will rewrite all requests to the script, unless it was for the script 
(avoid infitite loop).

Regards,
Robert Andersson 


---------------------------------------------------------------------
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] Apache 2.0 don`t open files in DocumentRoot

Posted by Juarez Jr <ju...@gmail.com>.
    Thanks for the help
The problem was almost solved ! What happens now is this.

I Configured as follows:

<Virtualhost *:80>
  DocumentRoot /newdesenv/sys
  ServerName alfa.desenv2.com
    <Directory /newdesenv//sys>
      DirectoryIndex init.php
    </Directory>
</Virtualhost>


When I access http://alfa.desenv2.com/ it accesses fine, but nothing
appears in the $_SERVER["PATH_INFO"]. and when I access 
http://alfa.desenv2.com/fidelity/programs/
It does not find !
In order to access I would have to put : 
http://alfa.desenv2.com/init.php/fidelity/programs/


[]`sss
Best regards.


Juarez Junior

On Fri, 8 Oct 2004 14:18:36 +0200, Robert Andersson <ro...@profundis.nu> wrote:
> Juarez Jr wrote:
> > <Virtualhost IPLOCAL>
> >     ServerName demo.tester.com
> >     DocumentRoot /web/sys/init.php
> > </Virtualhost>
> >
> > In Apache 1.3, the server works fine.
> > The problem is, when I try to redirect files in DocummentRoot in
> > Apache 2.0, it says that the folder does not exist.
> 
> And that is strange to you? Does a directory "/web/sys/init.php" exist?
> Probably not. As the docs says, DocumentRoot expects a directory path. If it
> worked in Apache 1.3, it is an undocumented side effect.
> 
> I suggest you do this properly:
> 
>     <VirtualHost *>
>         ServerName dome.tester.com
>         DocumentRoot /web/sys
>         <Directory /web/sys>
>             DirectoryIndex init.php
>             ...
>         </Directory>
>         ...
>     </VirtualHost>
> 
> Regards,
> Robert Andersson
> 
> ---------------------------------------------------------------------
> 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


Re: [users@httpd] Apache 2.0 don`t open files in DocumentRoot

Posted by Robert Andersson <ro...@profundis.nu>.
Juarez Jr wrote:
> <Virtualhost IPLOCAL>
>     ServerName demo.tester.com
>     DocumentRoot /web/sys/init.php
> </Virtualhost>
>
> In Apache 1.3, the server works fine.
> The problem is, when I try to redirect files in DocummentRoot in
> Apache 2.0, it says that the folder does not exist.

And that is strange to you? Does a directory "/web/sys/init.php" exist? 
Probably not. As the docs says, DocumentRoot expects a directory path. If it 
worked in Apache 1.3, it is an undocumented side effect.

I suggest you do this properly:

    <VirtualHost *>
        ServerName dome.tester.com
        DocumentRoot /web/sys
        <Directory /web/sys>
            DirectoryIndex init.php
            ...
        </Directory>
        ...
    </VirtualHost>

Regards,
Robert Andersson 


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