Adding storage to an Apache server

MantridMantrid Lockpick Join Date: 2003-12-07 Member: 24109Members
I run a small web server from my house, and I'm thinking I may need to add more space. How do I do something like, host files on another hard drive? I'm under the impression that for anything to be web-accessible, it needs to be in the htdocs folder. How can this be accomplished when that new drive is obviously not in there?

Keep in mind I'm pretty noobish when it comes to this. The server is set up to host files, and for hosting a forum for my friends and I.

On another note, how do I prevent people from looking through all the different folders on there? Should I just make an index.html for every folder that says "Move along"? Is there another way.

If it helps, the OS is Windows 2000. I know, not the best choice, but I'm not comfortable enough with any *nix to use that, although I may try switching to Ubuntu Server Edition at some point.

Comments

  • CForresterCForrester P0rk(h0p Join Date: 2002-10-05 Member: 1439Members, Constellation
    To prevent directory listings, you can use htaccess files. Take a look at <a href="http://www.javascriptkit.com/howto/htaccess11.shtml" target="_blank">this</a>.
  • [WHO]Them[WHO]Them You can call me Dave Join Date: 2002-12-11 Member: 10593Members, Constellation
    edited November 2006
    I don't remember the specifics. But I know you can host web pages out of any directory, without regard for htdocs. If I remember correctly, htdocs just sets up an easy alias to start with.

    And there should be a directory level option to disallow directory listing. I think you have to remove "AllowINDEX" or something like that.
  • ZeroByteZeroByte Join Date: 2002-11-01 Member: 3057Members
    I just checked out my httpd.conf file and I think what you want for the extra storage space are aliased folders. First, <b>make a backup of your httpd.conf file</b>. Then open up your httpd.conf and search for "Alias". Then paste the following lines somewhere around that area:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Alias /virtualdirectoryname/ "E:/MyVirDir/"

    <Directory "E:/MyVirDir/">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory><!--c2--></div><!--ec2-->

    This will set up a directory that is accessible by <a href="http://yourhostname/virtualdirectoryname" target="_blank">http://yourhostname/virtualdirectoryname</a>

    With the default httpd.conf, the default setting for folders is to not list directory contents. However, this is overridden by the directory config of your DocumentRoot. Say your document root is "C:/htdocs", do a search for <b><Directory "C:/htdocs"></b>

    Inside those tags, look for the line:
    <b>Options Indexes FollowSymLinks</b>

    I think if you remove "Indexes" from that line it will remove directory listing from your root folder. Also remove it from your aliased directory config if you don't want that directory to list their contents.

    After saving your httpd.conf file, restart Apache.
  • MantridMantrid Lockpick Join Date: 2003-12-07 Member: 24109Members
    I'll try that, thanks.
Sign In or Register to comment.