Apache Config File

Sharky Forums


Results 1 to 2 of 2

Thread: Apache Config File

  1. #1

    Apache Config File

    So I want to have a feature on my website where I will be able to access my personal files from the website. Currently I am using .htaccess to prevent just anyone from viewing the file browser, but I will probably change that to some different method in the future. (Since apparently .htaccess is supposed to be really taboo)

    There were two problem I needed to overcome. First, I basically wanted to share my entire second hard drive with limited access. So I added this line to the Apache configuration file :

    Alias /media/ F:/

    This allows me to route to the F drive by going to mywebsite.com/media/
    Now I just needed to set up the directory permissions. I had this in the config file:

    SetEnvIf PHP_AUTH_USER "USER" let_me_in
    <Directory "F:/">
    Options All
    AllowOverride All
    Order deny,allow
    Deny from All
    Allow from env=let_me_in
    </Directory>

    Even after I have logged in with .htaccess as the USER, it does not permit me to open the file. I thought that maybe the problem was outside of Apache, so I removed the deny and allow lines I have in there and I added, "Allow from All". I was then able to connect to the drive, but so was everyone else in the world. I also tried declaring my own enviornmental variable called "MEDIA_ACCESS" in the page that would call the files off of the drive and then I tried:

    SetEnvIf MEDIA_ACCESS 1 let_me_in
    <Directory "F:/">
    Options All
    AllowOverride All
    Order deny,allow
    Deny from All
    Allow from env=let_me_in
    </Directory>

    and,

    <Directory "F:/">
    Options All
    AllowOverride All
    Order deny,allow
    Deny from All
    Allow from env=MEDIA_ACCESS
    </Directory>

    Neither of these worked. Does anyone have any idea what I could be doing wrong?
    Desktop PC:
    | Core 2 Duo E6420 2.2Ghz | 2Gb Kingston DDR2 800 RAM | 120Gb HDD | Abit IP35-E Mobo | ATI Radeon X1600Pro 512Mb |

    HTPC:
    | Pentium D 3.2 GHz | 2 Gb of Kingston RAM | Soundblaster Audigy 2 zs | Sony DVD-Burner | 300Gb HDD, 500Gb HDD, 500Gb HDD |

  2. #2
    Nevermind, I got it working. In case anyone else runs into this issue here is what I added to the Apache config file:

    # ADD MEDIA DRIVE TO SHARED FOLDER
    # ONLY ALLOW ACCESS FROM LOCAL HOST LINKS
    Alias /media/ F:/
    SetEnvIf Referer "^http://www.mywebpage.com/" let_me_in
    <Directory "F:/">
    Options All
    AllowOverride None
    Order deny,allow
    Deny from All
    Allow from env=let_me_in
    </Directory>
    Desktop PC:
    | Core 2 Duo E6420 2.2Ghz | 2Gb Kingston DDR2 800 RAM | 120Gb HDD | Abit IP35-E Mobo | ATI Radeon X1600Pro 512Mb |

    HTPC:
    | Pentium D 3.2 GHz | 2 Gb of Kingston RAM | Soundblaster Audigy 2 zs | Sony DVD-Burner | 300Gb HDD, 500Gb HDD, 500Gb HDD |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •