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

    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0

    Setting document root for just one domain?


    Hola,
    Sorry for this very basic question.
    I've created a virtualhost like this:

    Code:
    <VirtualHost *:80>
        ServerName domain.eu
        ServerAlias *.domain.eu
       
        DocumentRoot D:/Work/pbgit/project/web
        <Directory D:/Work/pbgit/project/web>
            Allow From All
            AllowOverride All
        </Directory>
       
          Alias /sf c:/users/zane/workspaces/aptana/pb//lib/vendor/symfony/data/web/sf
      <Directory "c:/users/zane/workspaces/aptana/pb//lib/vendor/symfony/data/web/sf">
        AllowOverride All
        Allow from All
      </Directory>
    
    </VirtualHost>
    This overwrites the default docroot, so I can't access anything on localhost, everything just redirects to the new VirtualHost's docroot. Obviously I want only one domain for that to happen. Is there a way to do this?
    When I try to create multiple VirtualHosts, everything just uses the docroot of the first one.
    I've searched the manual, but haven't really found a solution: http://httpd.apache.org/docs/1.3/vhosts/name-based.html
    Probably I have a wrong understanding of the concept of vhosts...
    Thanks
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Location
    Cluj-Napoca, Romania
    Posts
    3
    Rep Power
    0
    You can make a first VirtualHost without a ServerName. That will be given when you access the server with its IP.

    And then, create how many VirtualHost-s you want, each one with its ServerName.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    2
    Rep Power
    0
    Hmm, I'd have never thought of this Thanks.

IMN logo majestic logo threadwatch logo seochat tools logo