Jump to content

Help with using Alias to read data outside the webroot


Haiku

Recommended Posts

Hello,

 

I am running Apache/PHP/MySQL on a Win2K3 web server edition box.  I have a particular problem where I need to use aliasing with apache to read data outside a webroot, but I’ve not been able to get this to work successfully.

 

In a nutshell, I have this one server which serves a variety of webpages so I’m doing virtual hosting.  I also use this box to host multiplayer car simulation races.  I have this PHP/MySQL blog that can read results files that are generated by the car sim games and show how a race is progressing live to someone over the web.  For me to do this, within the blog I have to specify a directory where these results text files are, and this directory has to be underneath where the blog itself is installed.

 

For example, this is where the blog is installed:

 

C:\Program Files\Apache Group\Apache2\htdocs\carracing\webroot\sls

 

And the directory where the blog expects to find results files is:

 

C:\...\sls\files\gtr2live

 

Within the blog’s control panel I specify the results directory this way:

 

files/race07live

 

However, the game doesn’t write results files there, the game writes them here:

 

C:/Documents and Settings/caradmin/My Documents/GTR2/UserData/LOG_Dedicated/Results

 

These are snippets from my virtual host setup:

 

<VirtualHost *:80>

ServerAdmin webmaster@carleague.org

DocumentRoot "C:\Program Files\Apache Group\Apache2\htdocs\carracing\webroot"

ServerName racing.carleague.org

Alias /sls/files/gtr2live/ "C:/Documents and Settings/caradmin/My Documents/GTR2/UserData/LOG_Dedicated/Results/"

<Directory "C:/Documents and Settings/caradmin/My Documents/GTR2/UserData/LOG_Dedicated/Results/">

Options Indexes

AllowOverride None

Order allow,deny

Allow from all

</Directory>

</VirtualHost>

 

But this isn’t working.  I don’t get an error from apache, but the blog’s real time viewer tells me no data is present (the files/race07live directory is empty right now), so this tells me it’s not redirecting to the other directory where there are hundreds of results files.  I’ve tried several variations on the “Alias” directive and have tried the “Location” directive but nadda.  At one point I think I got something working because I started to get 403 access forbidden errors where the results files are actually stored, but I could not resolve those errors after changing folder permissions a bunch of times.

 

Still I want to know if this is the right way to do this.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.