1

I currently have a web development staging environment set up on an IP based apache web server. There is no domain associated with it. So, it can only be accessed by typing in the IP for the URL (xxx.xxx.xxx.xxx). Is it possible to create another development area on a server with a single IP?

I'd normally create a subdomain and point to that for new development tracks. I've not had to contend with a IP based server with no domain. Currently it is set up to serve a single instance of itself through the default virtual host.

Are there any easy methods to add more development instances on this type of web server?

1
  • All IP addresses can be associated with a name. They just don't have to be public. There's nothing to prevent someone from running their own private DNS or making host entries on their local machines. In fact, there's nothing to prevent anyone from publicly listing any IP address in the DNS records for any domain they control.
    – platforms
    Jul 24, 2013 at 0:40

3 Answers 3

3

Yes you can, all you need is to change listening port

Listen 80
Listen 81

<VirtualHost xxx.xxx.xxx.xxx:80>
...
</VirtualHost>

<VirtualHost xxx.xxx.xxx.xxx:81>
...
</VirtualHost>
3
  • I added the above. However, the connection times out. I used port 8080. I verified through telnet the port is listening. I tried accessing the directory xxx.xxx.xxx.xxx:8080 and it times out. Any ideas?
    – MAZUMA
    Jul 23, 2013 at 23:03
  • Could you show output of the netstat -lanp | grep 8080 and lsof -i tcp:8080
    – ALex_hha
    Jul 24, 2013 at 19:38
  • No worries. It works as you posted above. My host requires that ports be turned on via a control portal. So, the port was blocked on their level. Only another day of my life wasted chasing a ghost issue. : (
    – MAZUMA
    Jul 24, 2013 at 20:57
3

Access it via some kind of domain name (you might need to put entries in a hosts file), then create virtual hosts attached to different domain names.

If you need to continue accessing it only through the IP address for some particular reason, your only option is to have Apache listen on more ports, and attach virtual hosts to different ports.

2
  • There are no domain names associated with the server. How does it distinguish which directory to server? I assume the inclusion of the port after the IP? So, xxx.xxx.xxx.xxx:80 in the browser URL?
    – MAZUMA
    Jul 23, 2013 at 21:15
  • 1
    @MAZUMA Then make something up, like imaginaryserver.company.com? If you want to go for the listening port method, you'll have something like <VirtualHost *:80> for port 80, and <VirtualHost *:8000> for port 8000.. and however many other listeners you want in between. And yes, you'd then add the port to the URL in the browser, after the IP. Jul 23, 2013 at 21:29
0

If you are strictly IP based, you need an IP address or port for each instance. For an intranet application IP address from the private ranges (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16) should be available. Using non-standard ports can be a problem to manage and code around.

You can fake it to some extent by using paths. (192.0.2.10/test1, 192.0.2.10/test2)

I would go with a name based solution. If you can't add the names to your DNS, there are lots of minimal DNS servers out there like dnsmasq that can provide services for an intranet. Users will need to point their resolver at the server.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .