Haiku Posted November 8, 2007 Share Posted November 8, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/76518-help-with-using-alias-to-read-data-outside-the-webroot/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.