Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache 2.049 <document root> & other locations

Status
Not open for further replies.

datadan

IS-IT--Management
Jul 22, 2002
283
US
In my config file:

DocumentRoot "/usr/share/squirrelmail/"
Alias /mail /usr/share/squirrelmail/

Works Great. No problems. I added a file in that location:

/usr/share/squirrelmail/temptemp/usage/index.hmtl

When I type the following at a browswer:


No problems (hurray)!

Now I want to store the usage directory elsewhere on my server. I put them into /var/ I edited

/usr/share/squirrelmail/temptemp/usage/index.php

to be:

<?php
header('Location: /var/ ?>
<html></html>

When I type the following on my browser:


I get a 404 error:

The requested URL /var/ was not found on this server.



Any help appreciated.
 
I'm not familiar with SquirrelMail, so maybe someone else can provide better info there, but you haven't make /var/ available as a url to be browsed by Apache so that is where the 404 is coming from. PHP is more than happy to read files that aren't in a browsable directory though, but setting the header is attempting to send the client browser to that location, not performing any server side reading or writing.

I suggest you check the SquirrelMail documentation and see if the usages directory needs to be moved into a public place. If so, be sure to set the header to reference the public path, not server path, to the directory. For more information on the php header() function, see the official documentation:
 
<snip>
but you haven't make /var/ available as a url to be browsed by Apache so that is where the 404 is coming from
</snip?

oopcos, which config setting do I toggle to make my /var/ file browseable by apache?

Thanks,
 
<Directory "/var/ Options Indexes # MultiViews # dunno what the latter is for
</Directory>

. Mac for productivity
.. Linux for developement
... Windows for solitaire
 
Check out the Alias directive too, to define what the public url will be (see previous link).
 
Progress!!

I put in my directory stuff:
<Directory "/var/ Options Indexes FollowSymLinks
AllowOverride all
Order deny,allow
Deny from all
Allow from 10.
</Directory>

I also added under DocumentRoot
Alias /intranet /var/
Now I have access to the files from my local 10.x.x.x network. But instead of the index page launching automatically when I type 10.x.x.x/intranet I see an Index List of files instead of my index page displaying automatically. I'm missing something. Any ideas?
 
Bump...Still need help with the last part.

I put in my directory stuff:
<Directory "/var/ Options Indexes FollowSymLinks
AllowOverride all
Order deny,allow
Deny from all
Allow from 10.
</Directory>

I also added under DocumentRoot
Alias /intranet /var/
Now I have access to the files from my local 10.x.x.x network. But instead of the index page launching automatically when I type 10.x.x.x/intranet I see an Index List of files instead of my index page displaying automatically. I'm missing something. Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top