Apache httpd.conf help: how to make localhost go to asfd.html instead of directory

Discussion in 'OT Technology' started by NEOxMorpheus, Mar 23, 2006.

  1. NEOxMorpheus

    NEOxMorpheus Real OG

    Joined:
    Oct 24, 2001
    Messages:
    1,001
    Likes Received:
    0
    Here's the portion of my httpd.conf code that I need to modify

    DocumentRoot "C:/Program Files/xampp/htdocs/qwer"

    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    </Directory>

    <Directory "C:/Program Files/xampp/htdocs/qwer">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>


    What I want to do is to have:
    DocumentRoot "C:/Program Files/xampp/htdocs/qwer/asfd.html"
    <Directory "C:/Program Files/xampp/htdocs/qwer/asdf.html">
    but I can't even start Apache when I do this.

    I read something about having a .htaccess file but not sure how to do this.
    Sorry for long explaination but I'm stuck
     
  2. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    your DocumentRoot must be a directory. In your case, C:/Program Files/xampp/htdocs/qwer/

    you then set the DirectoryIndex to include your "default" files to display when a directory is requested. Normally it's "index.html" but you would add "asfd.html" to that directive.
     
  3. NEOxMorpheus

    NEOxMorpheus Real OG

    Joined:
    Oct 24, 2001
    Messages:
    1,001
    Likes Received:
    0
    so would I need to do something like this?

    <Directory "C:/Program Files/xampp/htdocs/qwer/">
    DirectoryIndex asdf.html
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
     
  4. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    *sigh*

    First of all, you *should* just use standards like index.html... That is what you SHOULD be doing. Furthermore, you need to actually READ the standard config file and use that as your base. Lastly, why are you even using Apache on Windows? IIS is faster and more stable. Sure Apache is great on Linux, and I recommend it there, but this isn't Linux, now is it?

    Read the first few lines in your apache conf file... It says don't fuck with it if you don't know. Writing one from scratch isn't something you should be attempting your first time around. Use their default config, and do a Find on DirectoryIndex... You will see the proper usage, there. Yes it can go in .htaccess/virtualhost definitions, but there is also an all-important global definition.
     
  5. NEOxMorpheus

    NEOxMorpheus Real OG

    Joined:
    Oct 24, 2001
    Messages:
    1,001
    Likes Received:
    0
    alright I got it now. I didn't see the DirectoryIndex field in the conf file. Thanks for the help.

    I'm using Apache because my WinXP didn't come with IIS. Although I agree Apache is slow as hell on Windows, the website i'm building is just for a class project so doesn't really matter. Plus I needed to use Apache's mod_ssl.
     
  6. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    If it *has* to use mod_ssl, then that would force you with Apache. If you have XP Pro, then you can install IIS through the Control Panel. I don't think Home gets IIS. IIS does support SSL through it's own implementation.
     

Share This Page