Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

different ip on same port

I have a DVR running my security system that needed port 80. It resolves to www.domain.com from the net and uses port 80 forwarded to the internal ip address. I want to run the Lion server and serve web pages but the port 80 is taken and I cannot edit the settings on the dvr server streaming the cams. Can I set up certain requests for www.domain.com to go to the dvr and www.someothername to resolve to the Lion server both using 80 as I don't want to have to add a port number for the Lion server. Any help is greatly apprecisted


Regards

Keith

Mac OS X (10.7.2), Lion Server Issue

Posted on Dec 5, 2011 1:37 PM

Reply
15 replies

Dec 6, 2011 3:33 AM in response to BeatTheCasino

If as seems the case your router is doing NAT and you have port 80 'port forwarded' to reach an internal server, this can only be done with a single server. So the router can only send all port 80 traffic to the DVR or the Mac server not both, no matter what domains you use.


However, one possible workaround would be as follows. Have two URLs like the following


http://www.domain.com/

http://www.domain.com/DVR/


Both would be on port 80, both would be port forwarded by your router to your Mac server. You would then configure the webserver on your Mac server to 'redirect' the second URL to a new internal destination which would be your DVR system.


Unfortunately, in Lion Server Apple have removed the ability in Server Admin to configured such redirects, so you will have to manually edit the Apache configuration files to do this.

Dec 6, 2011 1:27 PM in response to BeatTheCasino

When the DVR is accessed remotely, does it matter if you use port 80 externally?


i.e., you could use http://www.domain.com:81 and on your router, forward port 81 to the dvr on port 80.


Thus, the dvr still uses port 80, but, you use port 81 externally. Would that be possible, or no? If not, then why, i.e., is there just one service accessing your DVR or something, provide more details.

Dec 7, 2011 4:00 AM in response to John Lockwood

Hi Yes I looked on the DVR GUI interface and I can change the port. The DVR has the internal ip 192.168.1.100 but I cannot edit any config files no ssh to the server on the dvr. The ip of the Lion Server is 192.100.1.9 and I have dyndns point a domain name to it but it always resolves to the dvr I assume becasue it grabs the port 80 requests. So what I want to do is have a different domain name go to the dvr and one go to the Lion server but without a port number in the public url. Thnaks for your help

Dec 7, 2011 4:06 AM in response to BeatTheCasino

BeatTheCasino wrote:


Hi Yes I looked on the DVR GUI interface and I can change the port. The DVR has the internal ip 192.168.1.100 but I cannot edit any config files no ssh to the server on the dvr. The ip of the Lion Server is 192.100.1.9 and I have dyndns point a domain name to it but it always resolves to the dvr I assume becasue it grabs the port 80 requests. So what I want to do is have a different domain name go to the dvr and one go to the Lion server but without a port number in the public url. Thnaks for your help

If as you say above, you can change the port of the DVR in its settings, then change it to something other than 80, e.g. 8100. Then configure your router to port forward 80 to 192.168.1.9 and forward port 8100 to 192.168.1.100


The URL http://something.dyndns.org:80/ would go to your server and http://something.dyndns.org:8100/ would go to the DVR.

Dec 7, 2011 4:22 AM in response to BeatTheCasino

BeatTheCasino wrote:


Hi John,


Thnaks so much but is there a way to do it without the port number in the url?

Your router only has a single IP address and it can only process all port 80 traffic using a single rule no matter how many different URLs or domains you might use. The only way to have two URLs go to it and be processed differently is as per my first reply, use the Mac server to look at the URL and based on it redirect the DVR one to the DVR. The webserver on the Mac can do either of the following options, both the following options would allow you to use port 80 for both the server and the DVR


http://www.domain.com/

http://www.domain.com/DVR/


with this setup the second slightly different URL could be redirected to another internal destination.


http://www.domain1.com/

http://www.domain2.com/


again with this setup the Mac webserver can redirect the second URL to a different internal destination.


The only way to get the router to treat the two differently is by using different ports.

Dec 7, 2011 6:09 AM in response to BeatTheCasino

Snow Leopard Server has a GUI tool called Server Admin which allowed setting up such redirects. Unfortunately while there is still an (optional) Server Admin for Lion Server it no longer lets you configure these settings.


The webserver used by Apple is the standard Apache webserver. I get the impression that there is more than one method of telling Apache to do such a redirect.


If you have access to a Snow Leopard Server you could setup such a rule as a test, then look at the Apache config file, then make the same changes by hand to the Lion Server equivalent. If you don't your going to have to investigate how to configure Apache by following more Linux style instructions. The following link might be a small help http://httpd.apache.org/docs/2.0/mod/mod_alias.html I think ReDirect is what you should be looking at.

Dec 7, 2011 6:57 AM in response to BeatTheCasino

You can do that with mod_proxy (forward all requests for a domain to the dvr). i don't see what the issue is with www.yourdomain.com:8100, in which case the router forwards port 8100 to the dvr on 80. I had suggested 81, no matter, irrelevant, any unused port.


A third scenario is what I asked you. What USES the DVR externally? Is it perhaps one monitoring site? If the requests to it are from one place (or small number) only, a third scneario is to port forward all requests FROM those IPs to the dvr.


So, you have your choices. mod_proxy will take commandline editing to make it work.

Dec 7, 2011 6:58 AM in response to sfatula

sfatula wrote:


Correct he did say that, and so did I. I was changing the port used OUTSIDE of the building, not inside,the DVR would retain port 80.

Ah, if I understand you right, you are suggesting an external connection to say port 8100 would be linked to an internal port 80. I believe some routers can do this but most consumer routers cannot.

Dec 7, 2011 7:05 AM in response to John Lockwood

I've been lucky then! Every router I've owned allowed me to do this, and I did. I am quite positive not all allow this, you are right. But mine always have.


mod_proxy is a harder solution, the port on the dvr is the easiest, the port externally is the second easiest. I've done lots of mod_proxy configs, and it's definitely the hardest.


For mod_proxy. you would want:


www.yourdomain.com as you have now and

dvr.yourdomain.com for your dvr, both pointed to the same ip.


In the Apache config for dvr.yourdomain.com, you would put the proxy settings. What happens is all traffic coming in to that virtual server is forwarded to somewhere (in this case the DVR) and the requestor never knows it, it's just as if you were connecting directly. But it takes manual editing of the Apache config.


So, which way do you want to go?

Dec 7, 2011 7:55 AM in response to sfatula

Curently I have www.domain.com going to the webcams on the dvr and I want that domain .com to resolve to the dvr so I don't have to update anyones access.


I want/need

www.anotherdomainname.com to go to the MAc Lion server. I'll update dyndns for public access.


SO I will change the port to 81 on the dvr so all http requests will then go to the apache server initially on the mac Now what do I need to place in the mod_proxy file to get domain.com to redirect it to domain.com:81 on the dvr server?


Thanks!


KS

Dec 7, 2011 11:32 AM in response to BeatTheCasino

So, if you have another domain name that is fine, otherwise, just use server.domain.com, I'll assume you use what you said.


So, typical statements to proxy would look like:


<VirtualHost www.anotherdomainname.com:80>

ServerName www.anotherdomainname.com

ProxyRequests Off

ProxyPreserveHost On

ProxyPass / http:/192.168.3.4:81/

</VirtualHost>


So, 192.168.4.81 would be the local IP address of the DVR.


So, connections to apache to the domain www.anotherdomainname.com on standard port 80 on the server would be proxied to your DVR on port 81. Any other requests to port 80 would not go there, presuming, you have web access configured correctly in server admin.

different ip on same port

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.