SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot Taranis's Avatar
    Join Date
    Aug 2002
    Location
    Franklin, TN
    Posts
    197
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    VHosts and Document Root

    When configuring VHosts, does the Document Root for the VHost start at the machine's root or at the Document Root that is set for webserver farther up in the .conf file?

    So, if my main Document Root were
    /www

    Would my VHost Root be:
    /www/vhostname
    or just:
    /vhostname

    Thanks!

  2. #2
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The DocumentRoot defined inside a Virtual Host block has nothing to do with the "default" DocumentRoot that is found outside the Virtual Blocks.

    In particular,
    httpd.conf
    Code:
    # etc etc
    DocumentRoot /www # "default" documentroot
    
    <VirtualHost *>
    #etc etc
    ServerName vhostname
    DcoumentRoot /vhostname
    </VirtualHost>
    As for this example the DocumentRoot of vhostname is /vhostname.

    Code:
    #etc etc
    
    <VirtualHost *>
    #etc etc
    ServerName vhostname
    DcoumentRoot /www/vhostname
    </VirtualHost>
    As for this example the DocumentRoot of vhostname is /www/vhostname.

    That said,
    >>Would my VHost Root be:
    >>/www/vhostname
    >>or just:
    >>/vhostname
    It's what you specified inside the VirtualHost block.
    If you did forget to specify the DocumentRoot inside the VH block you will receive a warning when running Apache and the "default" DocumentRoot will be used instead ( that happen under win2000/apache 1.3.27, but it should be the same under *nix too ).




    pippo
    Last edited by pippo; Nov 13, 2002 at 23:51.
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03


Bookmarks

Posting Permissions

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