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

I would like to have others inside my local network access resources on my computer at outsideprojects.192.168.0.10. I am running Apache and have a virtual host configured so I can access it at outsideprojects.localhost but can't seem to be able to access it from the outside.

I have all firewalls disabled so I don't believe that this is the issue. I would expect that I should be able to access this at outsideprojects.127.0.0.1 but I cannot do that either.

What are the Apache configuration options to be able to accomplish this?

share|improve this question

2 Answers 2

This isnt an Apache thing, Its DNS

add the following to C:\Windows\System 32\drivers\etc\hosts (for windows) or /etc/hosts (*nix systems)

192.168.0.10 outsideprojects

You will have to do this on every PC you want to allow to use the URL

you will then be able to use : http://outsideprojects in your browsers

share|improve this answer
    
I know am aware of the solution that you suggest and I don't want to do that for the very reason you suggest. My thought was that there isn't any reason that the folks in my local network couldn't use my ip address with a subdomain. That way there is no reason for needing to set up the dns like you suggested. –  Icode4food Oct 9 '10 at 1:08
    
there is a very simple reason they cannont, IP addresses have no concept of a subdomain. a subdomain is a part of DNS (Domain Name System) 192.168.0.10 < thats an IP address and the local reolver on your PC doesnt even try to use DNS for it. outsideprojects.localhost < thats a hostname and the local resolver resolves it to 127.0.0.1 - you cannot mix the two together. –  Geraint Jones Oct 9 '10 at 1:12
    
BUT - if they are going to enter : http://outsideprojects.192.168.0.10 why not just make outsideprojects the default VHost on that IP and have them enter http://192.168.0.10 –  Geraint Jones Oct 9 '10 at 1:14

As c10k Consulting pointed out, IP addresses have no concept of subdomains. You have a few options:

  1. You can setup a host file on all the machines that need to be able to access your local machine
  2. If you only have one vhost that you want people to be able to access, you can configure it to be the default vhost and have others just browse to the IP.
  3. You can create a single default vhost and add aliases to it. For example, you could add an alias for "/foo" that points at "/path/to/foo" and a separate alias for "/bar" that points at "/path/to/foo". This method requires mod_alias, which I believe is enabled by default on most systems.
  4. You can setup an internal IP address on your DNS server. For example, if you control example.com, you could add an A record for foo.example.com that points to 192.168.0.10. This would, of course, only be available from within the network.
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.