Setting up Red5 on a box which also contains a web server can be a challenge if you are restricted to using specific ports because of a firewall. Here is how we set up Red5 on a Windows 2003 server which also contains a production IIS server.
Our firewall only allows traffic on ports 80 and 443. This is non-negotiable, so we needed to work around the requirement.
The folks - in particular Walter Tak - on the Red5 mailing list pointed me in the right direction: Make another IP (or two) for Red 5 to run under.
IIS was already using ports 80 and 443, so the system administrator made two additional IPs for Red5 to use, one for rtmp and one for http. He then changed the settings in the Default Website Properties in IIS Manager: In Web Site Identification: IP Address, instead of (All Unassigned), he selected the single IP which we wanted IIS to listen on. We did not want IIS to interfere with port 80 on the IPs used by Red5.
However, even after this change Red5 still would not start up. The error in the logs was "java.net.BindException: Address already in use: bind"
After a little more research we found this article:
Running Flashcom Server alongside IIS
by Stefan Richter
http://www.flashcomguru.com/tutorials/fcs_iis.cfm
The article explains that on IIS 6 you must use a tool called httpcfg.exe to disable socket pooling. Otherwise, IIS will continue to grab port 80 on all IPs available, no matter what you set in IIS Manager.
The link to Microsoft's explanation of this in the Stefan Richter article is no longer good. Here is the correct link:
Setting metabase property DisableSocketPooling has no effect
After this was done, Red5 did start up, but I started getting "no application scope found" errors in the logs, and then it would shut down after a few moments. After a little experimentation I realized that I must have made some fatal change to one of the configuration files while we were troubleshooting, so I simply reinstalled Red5. Then it started up immediately and stayed up.
The last step was to register the new IPs with our firewall, and now it works perfectly!
Comments
Post a comment