0

I've just setup a fresh install of apache&ffserver on my dedicated server. Everything work fine and I can play my movie in a flashplayer (because I encode my stream in H264/AAC) served by my apache. But the flashplayer play the stream on the ffserver's port (8090 for me). Some peoples are behind firewall and can't play my live because the 8090 is blocked for us. How can I use only the port 80 ?

Thanks in advance, and excuse my poor english!

5 Answers5

2

Only one service can listen on a given IP and port combination at any one time.

You probably have two options:

  1. Bind ffmpeg on port 80 to a different IP and setup a separate hostname.
  2. Have Apache redirect the requests transparently using mod_proxy.
Dan Carley
  • 25,617
  • 5
  • 53
  • 70
  • I've already thought about the 1. solution, but I did'nt know the second one. I will try :) thx men! –  Jun 26 '09 at 13:21
  • 1
    Each have their merits really. #1 is technically cleaner, but you will need to present separate hostnames to clients and tell Apache what [not] to Listen on. #2 puts additional load and complexity onto Apache, but will look more aesthetically pleasing to clients. – Dan Carley Jun 26 '09 at 13:29
  • what about using named virtual hosting with setting up DNS for this? – XTZ Jun 26 '09 at 13:44
2

Consider using a reverse proxy like nginx. Move apache on 8080 port, let ffserver be on 8090 and setup nginx on 80.

Then configure nginx to proxy requests for location /video, for example, to 127.0.0.1:8090 and everything else to 127.0.0.1:8080. This will help you.

Now clients connect only on 80 port.

lexsys
  • 2,913
  • 6
  • 31
  • 34
2

As mentioned before, setting up mod_proxy is probably one of the easiest ways to go because all you have to do is add a configuration to apache, which you already have.

If you wanted to do it with mod_rewrite for a particular URL under the same hostname...Like if you have www.yourhost.com as apache and everything under /video coming from the ffserver you could do:

RewriteEngine on

RewriteRule ^/video/$1 http://127.0.0.1:8900/$1 [P,L]

ProxyPassReverse / http://127.0.0.1:8900

If you want to keep it on the same hardware, but don't care if they resolve to the same name, you could also setup a virtual network interface on a different IP address so that eth0 is apache running on 192.168.1.1 and ffserver running on eth0:1 with an ip address of 192.168.1.2. Then they can each have their own name in DNS, and since they are different interfaces you can have 2 services running on port 80 on the same box.

Alex
  • 6,603
  • 1
  • 24
  • 32
0

http://ffmpeg.org/sample.html

Sounds like you set the port in the configuration file and restart ff server?

I'm not familiar with this but it should be a simple fix.

XTZ
  • 183
  • 1
  • 1
  • 10
0

You can have only one application listening on a given port so is short - it is not possible to have both on port 80. There are however ways around it and perhaps http://httpd.apache.org/docs/2.2/mod/mod_proxy.html will give you some ideas. Basically find a way of the ffserver traffic to go through apache.

mfx
  • 158
  • 1
  • 7