#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    166
    Rep Power
    15
    On my Win2K laptop, Apache 1.3.x, I keep local copies of a number of website for these offline, or when a client does not have a connection.

    These sites are currently all in folders under /htdocs/

    /htdocs/oink/
    /htdocs/foo/

    etc.,

    I want to have each directory ("foo" "oink", etc.,) act as it's own docroot so URL's of "/" take me to the correct root.

    I've looked at Apache's docs. re. virtual name-based hosting but am confused as (in this case) my machine is not on a newtork, it is all "localhost 127.0.0.1" -stuff

    What changes do I need make within httpd.conf (and Windows "hosts" file?) to enable this?

    Thank you
    David
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    5
    Rep Power
    0
    I do the following to allow access to /htdocs/generator :

    In the Win2k hosts file i include a entry :

    127.0.0.1 generator.domain.com

    In the httpd.conf in include :

    NameVirtualHost 127.0.0.1

    and just below :

    <VirtualHost 127.0.0.1>
    ServerName generator.domain.com
    DocumentRoot "d:/Apache/htdocs/generator"
    ErrorLog logs/generator-error_log
    CustomLog logs/generator-access_log common
    </VirtualHost>

    I restart Apache and can now access what previously was localhost/generator as

    generator.domain.com


    Hope it helps,


    morten sorensen

IMN logo majestic logo threadwatch logo seochat tools logo