Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    Can some tell me how to configure a virtual host, so when I point my browser in the direction of testweb it will go to the site with a docroot of C:/testserver/testweb

    Ive tried to following restarted apache but to no success

    Code:
    <VirtualHost 10.1.2.3>
    ServerAdmin webmaster@testweb
    DocumentRoot C:/testserver/testweb
    ServerName testweb
    ErrorLog logs/testweb-error_log
    TransferLog logs/testweb-access_log
    </VirtualHost>
    Regards Phil,


  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Doesn't look particularly wrong, although when I set up vhosts, I use the fully qualified domain (for example, foo.bar.com, not just foo). If you don't have a domain, then you won't have any DNS entry available for testweb, and therefore your computer won't know its IP.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    so i cant set up multiple localhosts? on diffent names
    Regards Phil,


  5. #4
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    You can have as many domains as you want on one IP, which is the point of virtual hosts.

    Here's a tantalizing snippet of my actual home server's vhosts.conf:
    Code:
    <VirtualHost 192.168.1.2:80>
    	DocumentRoot /srv/www/htdocs
    	ServerName www.superliminal.org
    	ServerAlias superliminal.org
    </VirtualHost>
    A bit further down:
    Code:
    <VirtualHost 192.168.1.2:80>
    	DocumentRoot /srv/www/htdocs/intertubes
    	ServerName www.intertubes.org
    	ServerAlias intertubes.org
    
    	ErrorDocument 401 /errors/401.php
    	ErrorDocument 403 /errors/403.php
    	ErrorDocument 404 /errors/404.php
    </VirtualHost>
    Two sites, one IP. However, I have properly configured DNS for both domains so that they point to the proper IP. Without the DNS configuration, your computer doesn't know how to find the server.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  6. #5
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    How my domain is configured:
    Code:
    ; <<>> DiG 9.3.2 <<>> superliminal.org
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59084
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
    
    ;; QUESTION SECTION:
    ;superliminal.org.              IN      A
    
    ;; ANSWER SECTION:
    superliminal.org.       2695    IN      A       my IP address
    
    ;; Query time: 8 msec
    ;; SERVER: 192.168.1.1#53(192.168.1.1)
    ;; WHEN: Fri Feb 16 11:15:01 2007
    ;; MSG SIZE  rcvd: 50
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  7. #6
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    So theres no way of running my server as testweb rather than localhost/r2d2(my computers name), unless I rename my computer.
    Regards Phil,


  8. #7
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    It's worth trying to setup your hosts file to point testweb to 127.0.0.1


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:26 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com