Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 752
  • Last Modified:

Apache hppd.conf - Virtual Host Question

How do I set up a VirtualHost to work on an internal network? I want to be able to type 'imageshare' into a browser on the network and have the site come up. As it is now, I have to type the IP address at which point the imageshare site comes up. This is because the ServerName is not recongnized so the IP address automatically will default to the first VirtualHost that it finds.

Eventually, I will have several sites on this one box. Any ideas?

Thanks in advance...


<VirtualHost *>
    ServerAdmin me@mysite.com
    DocumentRoot "D:/www/imageshare"
    ServerName imageshare
    ErrorLog logs/imageshare.com-error_log
    CustomLog logs/imageshare.com-access_log common
1 Solution
The are two way to setup your virtual host
1. Use IP and port. Ex
Listen 8080
   DocumentRoot "D:/www/imageshare"
   ServerName imageshare
Your site can be accessed via

2. Use name resolution.
<VirtualHost yourpc>
   DocumentRoot "D:/www/imageshare"
   ServerName imageshare

But the name must be resolvable. You can set this name in DNS or just specify it in the host file /winnt/system32/driver/ect/

With Apache, you can authorize many sites (via VirtualHost)

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now