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 9 of 9

Thread: Virtual Hosts

  1. #1
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    I want to be able to create virtual hosts on my internal test server but cant get it to work. Im using Apache 2.2.4 and PHP 5.2.1 On windows XP

    so i can visit jsmith.computername

    instead of having something like computername/jsmith so It makes things tidier because its awkward trying to build websites where others reside.
    Regards Phil,


  2.  

  3. #2
    Member
    Join Date
    Apr 2007
    Posts
    96
    Member #
    15165
    Make sure you have this in your httpd.conf

    NameVirtualHost *:80

  4. #3
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    just that line?
    Regards Phil,


  5. #4
    Member
    Join Date
    Apr 2007
    Posts
    96
    Member #
    15165
    Well, once you have that line, you can start adding virtual hosts.
    Code:
    <VirtualHost *:80>
    DocumentRoot /var/www/somedirectory
    ServerName www.somedomain.com
    </VirtualHost>
    
    <VirtualHost *:80>
    DocumentRoot /var/www/someotherdirectory
    ServerName www.someotherdomain.com
    </VirtualHost>

  6. #5
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    right got that but i dont want to use a domain, i need to use something.192.168.1.106 for example if you get what i mean
    Regards Phil,


  7. #6
    Member
    Join Date
    Apr 2007
    Posts
    96
    Member #
    15165
    Quote Originally Posted by leprechaun13
    right got that but i dont want to use a domain, i need to use something.192.168.1.106 for example if you get what i mean
    Eh...
    I think you are better off doing what I described above and then editing the host file on your personal machine.
    in windows/system32/drivers/etc
    edit your host file

    127.0.0.1 localhost
    127.0.0.1 www.somedomain.com

  8. #7
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    hurmm i dont like the idea of editing system files, what damage can I do and does it need a restart to take effect?
    Regards Phil,


  9. #8
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Hosts files are generally editable and usually don't need a restart. Consider it a local override for DNS resolution. Simple ad-blocking is done by pointing known ad domains to an invalid address in the hosts file.

  10. #9
    Senior Member leprechaun13's Avatar
    Join Date
    May 2005
    Location
    Northampton
    Posts
    487
    Member #
    10058
    right so i can now visit sandbox.localhost but how do I have the doc root of sandbox.localhost to be C:\Program Files\xampp\sandbox
    Regards Phil,



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 09:41 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com