Those RED5 defense and statistic systems scripts, libraries and RED5 bugs fixing were developed by our technical stuff for the next purposes:
- Limiting of none allowed access to the RED5 server,
- Collecting of stats by broadcasters connections to the RED5 server,
- Collecting of stats by members connections to the RED5 server,
- Collecting information about the traffic which goes through RED5 server.
On this base we will have a possibility to secure your RED5 server against unauthorized connections or start offering audio/video server hosting services and earn on the payments for traffic which goes through your servers.
All scripts are given for free and with open source code. If you have questions or suggestions about how to make those scripts work better, please contact our managers.
All manuals and scripts are adapted for FreeBSD server and work with "Webcam chat software"
If you have different server or you use another programs for broadcasting video stream then you would have to adapt the script.
Installation manuals
Step by step instructions of how to forbid/ban unauthorized connections to RED5 server and get information about whom, when and how used it.
1) All information about connections to the RED5 server is recorded into the database.
You should make MySQL DB - red5stat.
Dump DB file - red5stat.sql
Tables:
tb_broadcast_log - Table for connections recording in order to broadcast video stream.
tb_subscribe_log - Table for connections recording in order to watch video stream.
2) Install PHP scripts which are used for traffic calculations.
3) Copy the archive red5 into /usr/lib/red5
4) Change the connection.properties in configuration files of red5:
/usr/lib/red5/webapps/counter/WEB-INF/connection.properties
/usr/lib/red5/conf/connection.properties
action - address counter.php (http://www.site.dom/counter/counter.php)
(Site with the stats)
auth_script - way to red5auth.php (/red5auth.php)
addition - host for checking in case of failure (http://www.site.com)
In attempt of broadcasting a video stream red5 check the files authorization status (404 or 200) on the next address http://user_referrer/auth_script
In case of failure repeat request to http://addition/auth_script
5) in the folder /usr/lib/red5
cd /usr/lib/red5
make sh red5-shutdown.sh
7) Check your ant version
ant -version
If its less then 1.7 you should update it for 1.7 version
cd /usr/ports/devel/apache-ant/
make deinstall
cd /usr/ports/devel/apache-ant/ && make install clean
8) After that try to make a compilation with command
cd /usr/lib/red5
ant jar
If case it is finished with words BUILD SUCCESSFUL, it mean that everything was successful. If no, then you should
if not, seek normal compilation
9) start red5
sh red5.sh
10) Copy the file red5auth.php into root_res, root_model, root_www (for the hosts from which video stream is expected).
11) In / usr/lib/red5/webapps / there is a pile of folders, among them is counter. To restrict the connections - you should remove everything, retain only counter which verifies the connection. Because, if someone knows about this red5, he may try to connect with standard applications and as long as they are there - connection would be possible.
12) Try to broadcast video.
13) Check if new records appeared in the tb_broadcast_log table.
If no, then you can check error in red5logcounter.log
That is all.
In adaptation of your programs for working with the counter please:
In connecting with program from flash you should broadcast long - id of the client as first parameter. This is for letting RED5 know who watch or broadcast video.
F.A.Q.
After REBOOT of RED5 server it is up, but video is not working.
You should kill process RED5 and start it again:
ps -auwx | grep java
kill 847
You can also use killall -HUP red5 instead of looking for process ID and killing by ID.
cd /usr/lib/red5
sh red5.sh
Commands of RED5:
cd /usr/lib/red5
sh red5-shutdown.sh
sh red5.sh