Forum Moderators: phranque

Message Too Old, No Replies

How can I use data outside of Apache root directory?

         

Ency

6:39 pm on Jan 14, 2014 (gmt 0)

10+ Year Member



I have home a server Apache. I want to put all my party songs in one partition and can listen from anywhere without having to take CDs.
I have my site in C:\Site and the songs I put it in D:\Songs.
In php I see the D:\Songs directory, I can read subdirectories, I see the .mp3 and .Wav files, I created the playlist, but the audio player doesn't start.
If I move the songs files in C:\Site or C:\Site\Songs goes perfectly, I can listen my music, but I do not want songs to be there.
Why I see in D:\Songs all the songs, I can create in D:\Songs the playlist, I can modify the playlist, I can download songs to client, but does not want to go? In httpd.conf I have:

DocumentRoot "C:/Site/"
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

and

<Directory "C:/Site/">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>

I try to put also:

<Directory "D:/Songs/">
Options Indexes FollowSymLinks
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>

bud does not work. "What Can I Do"?

If I insert in httpd.conf
Alias /muzica "D:/Songs/"
I receive the error
<
Not Found

The requested URL /muzica/index.php was not found on this server.
>
after

http://www.example.com/muzica/index.php

I asked in several forums, but I have not received any answer that works. I'm not expert in Apache or PHP, but I think it's impossible not to be able to solve such a easy problem. Thank you.

[edited by: phranque at 8:45 am (utc) on Jan 20, 2014]
[edit reason] Please Use example.com [webmasterworld.com] [/edit]

phranque

8:33 am on Jan 20, 2014 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld, Ency!


in order for a resource to be web-accessible it must reside in the document root directory or a subdirectory thereof.
if you want those files outside of the root, you have to internally rewrite those requests to a script that serves the file with the appropriate HTTP Response headers.