Is this possible to do with apache?

Red Squirrel

No Lifer
May 24, 2003
70,629
13,820
126
www.anyf.ca
I don't really know what this would be called so no idea how to even start searching for that but is it possible to create a virtual folder that shows the contents of multiple folders?

ex: Say I have a folder called A and B I want to make a sub domain that when I go to it, I see a file listing of the files in A and B. Is this possible? I can see it being an issue with duplicate file names though but I would imagine would would just take priority over the other.
 

Red Squirrel

No Lifer
May 24, 2003
70,629
13,820
126
www.anyf.ca
That sounds more involved than what I'm wanting to do but that does sound really cool! I will have to look at that anyway. Another thing I just thought of is I can probably use a php script to do what I want by creating a virtual folder (the folder is actually a php script) and then it just looks in the specified folders and presents the file to the browser. For my application I don't actually need a directory listing, so think this idea may work. But if there's an apache way to do it that would be even better.
 

KillerBee

Golden Member
Jul 2, 2010
1,750
82
91
Sometimes I think you just try to make up problems just to see if anyone is out there :D
 

Red Squirrel

No Lifer
May 24, 2003
70,629
13,820
126
www.anyf.ca
Haha no I actually do need this for a UT3 server. Would save me from copying the data multiple times. The download server requires the files to be in a single root folder, but the actual server requires the files to be in their own respective folders (maps, weapons etc) so if I can create a virtual folder that combines all those then it will save from keeping two sources up to date.
 

KillerBee

Golden Member
Jul 2, 2010
1,750
82
91
I went ahead and installed it for testing
surprised it was part of main Ubuntu and didn't have to add a seperate repo

It was as easy as "sudo apt-get install mhddfs"
but did have some weird perms where only root could do an actual listing
And also updating the dir is problem..no telling which directory a new file will end up in
Guess it may be useful for a read-only type of listing

the php script sounds interesting - how far have you gotten with it?
crontab an "rsync" of the 2 separate directories to update a third one which is served out by Apache?
 
Last edited:

Red Squirrel

No Lifer
May 24, 2003
70,629
13,820
126
www.anyf.ca
I went ahead and installed it for testing
surprised it was part of main Ubuntu and didn't have to add a seperate repo

It was as easy as "sudo apt-get install mhddfs"
but did have some weird perms where only root could do an actual listing
And also updating the dir is problem..no telling which directory a new file will end up in
Guess it may be useful for a read-only type of listing

the php script sounds interesting - how far have you gotten with it?
crontab an "rsync" of the 2 separate directories to update a third one which is served out by Apache?

Did not start on the script yet, but more I think about it, think I'll just go that route. Basically the way it works is I would make a mod_rewrite rule so that file acts as php (wont have an extension) so for fun let's name it "script". So if I go mysite/script/file.ut3 the script would actually execute and get the file.ut3 argument as a variable. From there the script can look into the real folders and if it finds it, it just serves it out in the header. I can probably do a location: or just serve the actual data. The 2nd option is more seamless to the browser or app downloading the file. If the file is not found, or if there's some kind of injection crap or other junk in the file, it returns a 404.

I never even thought of a crontab rsync... maybe I can just do that. Or even just run it manually. The folders don't get updated that often.
 

lxskllr

No Lifer
Nov 30, 2004
60,147
10,612
126
How would you know what you were looking at if the files are combined? You could have something on your game server, but not on the redirect. People would then have glacial download speeds. Maybe I don't understand what you're looking for...
 

Red Squirrel

No Lifer
May 24, 2003
70,629
13,820
126
www.anyf.ca
How would you know what you were looking at if the files are combined? You could have something on your game server, but not on the redirect. People would then have glacial download speeds. Maybe I don't understand what you're looking for...

The game client/server does not really care. Basically when you login to the game, it looks there for the map. Then it auto downloads it. Speed is a certain concern but should not be an issue as I have 100mbps up/down on that server.

I'll just end up going with the php script idea, I just thought maybe Apache had a way of doing this. I thought I remember seeing it done somewhere.
 

lxskllr

No Lifer
Nov 30, 2004
60,147
10,612
126
I used to run a 2k4 server, and with that, maps shouldn't be downloaded from the game server by clients. Regardless of how good the connection is, it's faaaar slower than using a redirect. You could easily tell when the redirect went down. Maybe UT3 is different, but with 2k4 you compressed the maps first, and used a different server for download.
 

Red Squirrel

No Lifer
May 24, 2003
70,629
13,820
126
www.anyf.ca
I used to run a 2k4 server, and with that, maps shouldn't be downloaded from the game server by clients. Regardless of how good the connection is, it's faaaar slower than using a redirect. You could easily tell when the redirect went down. Maybe UT3 is different, but with 2k4 you compressed the maps first, and used a different server for download.

Yeah redirect is what I'm using (uses http), but it just happens to be on the same physical box. I'm barely scratching the server resources, and it's only for before a map loads anyway. Through the game itself without redirect a map takes like 20 hours to load lol. With redirect it takes a minute or so. It's working good now, but I just have to copy the files manually right now.