Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

With apache 2 the vhosts works fine if I update the hosts file. Is there a url that others can use to get to the vhost without having to update their hosts file?

share|improve this question

migrated from stackoverflow.com Aug 9 '11 at 7:57

This question came from our site for professional and enthusiast programmers.

3 Answers 3

up vote 1 down vote accepted

If you don't want to setup a dns server as Gerry suggests you could simply use different ports instead of referring to them by name

share|improve this answer
    
Both yours and Pikkarainen are great methods. I should have figured out the ports thingy myself. Your idea works best for me because I do not have to do any tweaks to other computers. Thanks much! –  Jim Aug 9 '11 at 16:47
    
Yeah or upgrade your network to IPv6 and use IPs =D –  Gerry Aug 10 '11 at 12:50

You can register a domain that points to the IP of your server. Then in the vhost config you set that domain as an alias for the vhost.

Or if you already own a domain you can point one of it's subdomains at that server and again add it as an alias in the vhost config.

Oh and another option would be to set up your own DNS server and get them to use it, but that might be a little more work than you are wanting. In the long run it's a lot more flexible and easy to manage. But it can be quite a challenge the first time.

share|improve this answer
    
This is just an inhouse dev server in a small office. We want marketing to see it without having to fiddle with their hosts file. Since we have many vhosts running we can't just make it off the apache root. –  Jim Aug 9 '11 at 0:28
    
Yeah I've managed a setup just like that in the past. Your best option in the long term is to set up a DNS server and then set that as main dns server in the office router that everybody uses (either that or set the dns manually on each of their systems). –  Gerry Aug 9 '11 at 8:53

I use Modify Headers Firefox extension and just modify the Host header with it as necessary.

For example, if your development server is dev.www.yoursite.com and you need to request mycoolgizmo.com from it, just set Modify Headers to send mycoolgizmo.com Host header when browsing to dev.www.yoursite.com.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.