Flash Media Sever?

Status
Not open for further replies.
2 comments
Post 666 Evil oooooo lol

Code:
Here is how we installed latest Red5 and JDK on a server with Linux CentOS . These hints can help you install on many linux VPS or Dedicated enviroments.  We mainly do software development and work from windows, so we use WinSCP and PuTTy (free software). We browsed a lot of tutorials and web pages to get instructions that installed latest versions.
 First, we made sure we have all prerequisites to install the rpm:
 [B]yum install rpm-build [/B][B]redhat-rpm-config[/B]
 Allow required ports (not necessary if already opened): 3690 (svn), 5080, 1935, 1936, 8088.  See more details at the end of this tutorial.
 
 [B]JAVA INSTALLATION[/B]
 We installed latest JDK from [URL]http://java.sun.com/javase/downloads/index.jsp[/URL] .
 Use [B]uname -a [/B]to see if you need to download a 64 bits version.
 Went to root/tmp folder for downloads: [B]
cd /root/tmp[/B]
 We got Java SE Development Kit, JDK 6 Update 13. We selected linux multilanguage, right clicked > properties on the jdk-6u13-linux-i586-rpm.bin and downloaded it with [B]wget [I]url[/I][/B]on the server. It downloaded with a big name with parameters ([B]ls[/B] to see after download). We use WinSCP so we right clicked, refreshed from there and then renamed the new file that showed up in the root home directory.
You can also rename it from shell. Make sure you use mv “old_long_name†new_name for the long name as it uses special characters.
 [I]Make sure you install JDK and not JRE.
[/I]
 Made it executable and executed it:
 [B]chmod a+x jdk-6u13-linux-i586-rpm.bin
./[/B][B]jdk-6u13-linux-i586-rpm.bin [/B]
 Press space or enter to scroll terms and when it asks you type yes and hit enter.
If needed confirm Java DB update, yes ENTER.
 [INDENT]We installed it on multiple [URL="http://www.videochat-scripts.com/category/servers/"]servers[/URL] and had to change some shortcuts on ones that already had an older java, so it runs the new one. Usually if preinstalled it’s located in a java or jdk folder in /usr or /usr/local .
 [I] Make sure  the shortcuts in /usr/local point to the new locations (/usr/local/jdk to /usr/java/jdk1.6.0_14 and /usr/local/jre to /usr/java/jdk1.6.0_14/jre) .[/I]
[B]ln -s [/B][B]/usr/java/latest [/B][B]/usr/local/jdk
ln -s [/B][B]/usr/java/latest/jre [/B][B]/usr/local/jre
[/B]
 Also /usr/bin/java shortcut should point to /usr/java/latest (not /etc/alternatives/java):
[B]rm /usr/bin/java[/B]
[B]ln -s [/B][B]/usr/java/latest/bin/java [/B][B]/usr/bin/java
[/B]
 [B]export JAVA_HOME=/usr/java/latest/[/B]
[/INDENT] Make sure this is the one used if you also have older versions installed:[B]
java –version[/B]
 
 [B]ANT INSTALLATION
[/B]
 Downloaded ant (can be done from any mirror – see [URL]http://ant.apache.org/bindownload.cgi[/URL]), unpacked it, moved it to a good location and added variable, shortcut.
 Get ANT
 [INDENT]ANT 1.7.1
wget [url]http://apache.mirror.transip.nl/ant/binaries/apache-ant-1.7.1-bin.tar.gz[/url]
tar zxvf apache-ant-1.7.1-bin.tar.gz
mv apache-ant-1.7.1 /usr/local/ant
[/INDENT] wget [url]http://www.apache.org/dist/ant/binaries/apache-ant-1.8.0-bin.tar.gz[/url]
tar zxvf apache-ant-1.8.0-bin.tar.gz
mv apache-ant-1.8.0 /usr/local/ant
 Configure
[B]export ANT_HOME=/usr/local/ant
ln -s /usr/local/ant/bin/ant /usr/local/bin/ant[/B]
 [INDENT]Replace old ant
[B]rm /usr/bin/ant
ln -s /usr/local/ant/bin/ant /usr/bin/ant[/B]
[/INDENT] Checked ant version:
[B]ant –version[/B]
 If this can’t find java, add a shortcut /usr/local/jdk/bin/java pointed to /usr/java/latest/bin/java .
 [INDENT]Error: JAVA_HOME is not defined correctly.
We cannot execute /usr/local/jdk/bin/java
[/INDENT] [B]SUBVERSION INSTALLATION
[/B]
 Downloading latest Red5 required subversion  and we had to install perl uri first for that to work:
[B]wget [url]ftp://rpmfind.net/linux/dag/redhat/el2.1/en/i386/dag/RPMS/perl-URI-1.17-1.el2.rf.noarch.rpm[/url]
[/B][B]rpm –i perl-URI-1.17-1.el2.rf.noarch.rpm
[/B][B]yum install subversion
[/B]
 [I]Update1: This time got  “Error: Cannot retrieve repository metadata (repomd.xml) for repository: atrpms. Please verify its path and try again†.
Solution: [B]yum –disablerepo=atrpms install subversion[/B] .
[/I]
 [B]RED5 BUILD AND INSTALLATION
[/B]
 Then we downloaded Red5:
[B]svn co [url]http://red5.googlecode.com/svn/java/server/trunk[/url] red5[/B]
 [I]Update1: This downloads latest Red5. On this installation (update1) Red5 0.9 was downloaded.[/I]
 [INDENT][I] If latest trunk has bugs or does not work fine with your required software you can download other versions from [/I][URL]http://red5.googlecode.com/svn/java/server/tags/[/URL][I] .[/I]
 [I]Example:
[B]svn co [/B][/I][B][url]http://red5.googlecode.com/svn/java/server/tags/0_8_0/[/url] red5
[/B]or
[I] [B]svn co [url]http://red5.googlecode.com/svn/java/server/tags/0_9rc1/[/url] red5[/B][/I]
[/INDENT] Built red5 :
[B]cd red5
ant prepare
ant dist
[/B]
 [INDENT]On upgrade, copy webapps to new build.
 cp -rf /opt/red5/dist/webapps/* /root/tmp/red5/dist/webapps/
 Then rename old red5 (backup).
 You could also remove sample applications if you don’t plan to use these:
rm -rf /opt/red5/dist/webapps/live
rm -rf /opt/red5/dist/webapps/vod
rm -rf /opt/red5/dist/webapps/installer
rm -rf /opt/red5/dist/webapps/root/demos
rm -rf /opt/red5/dist/webapps/root/WEB-INF
[/INDENT] Moved Red5 from home folder:
[B]cd ..
mv red5 /opt/red5
[/B]
 Started Red5:
[B]cd /opt/red5/dist
./red5.sh > start.log &
[/B]
 The > start.log is to have it output the logs in the file and & is to keep it running in the background.
 Verified that Red5 was running:
[B]ps aux | grep red5
[/B]This should report a long line with java and many options and this command. Check start.log if it failed to start.
 We added these lines to to /etc/rc.d/rc.local so it starts on each server start:
[B]cd /opt/red5/dist
/opt/red5/dist/red5.sh > restart.log &[/B]
Make sure your run it from the right folder. The one in /opt/red5 will not work – you must run it from /opt/red5/dist/ .
 When Red5 is running you should be able to access [COLOR=#333399][B][url]http://[I]your-server-domain-or-ip[/url][/I]:5080/[/B][/COLOR] .
 If it works first thing go to [COLOR=#333399]http://your-server:5080/installer/[/COLOR]and install admin. Then to [COLOR=#333399]http://your-server:5080/admin/register.html[/COLOR] and register an username and password. Then you can check application statistics anytime from [COLOR=#333399]http://your-server:5080/admin/[/COLOR] with server ip and the registered username, password.
 [B]RED 5 RESTART[/B]
 We do that everytime we add or update files in the /opt/red5/dist/webapps folder – where all applications should be installed.
 Usually these should work and should be used each time you add a new application.
 1. Check if red5 is running:[B]
ps aux | grep red5[/B]
 2. Go to its folder and shut red5 down:
[B]cd /opt/red5/dist
./red5-shutdown.sh
[/B]3. See if it’s still running or not:
[B]ps aux | grep red5[/B]
 4. Restart it, and also make it output the logs into a file of your choice:
[B]./red5.sh > start.log &[/B]
 5. Make sure it’s back online:
[B]ps aux | grep red5[/B] 
 We also noticed that red-shutdown.sh sometimes does not close it down to allow restart when webapps are added or updated. This usually occurs when red5 freezes becasue it encounters errors like running out of memory. So we run [B]ps aux | grep red5[/B] to see process id (first number: PID) and then run[B] kill [I]process id[/I][/B] if it’s still alive.
 [B]ALLOWING PORTS[/B]
 On some systems root cannot bind ports above the early 1000’s so red5 must be run from another account.
 Verify that Red5 is listening on port 5080 if you can’t get [url]http://yourserver:5080/:[/url]
[B]netstat -anp | grep 5080[/B]
 If using iptables enable these ports:
[I][B]iptables -A INPUT -p tcp -m tcp -—dport 3690 -j ACCEPT
[/B][/I][I][B]iptables -A INPUT -p tcp -m tcp —-dport 5080 -j ACCEPT
[/B][/I][I][B]iptables -A INPUT -p tcp -m tcp -—dport 1935 -j ACCEPT
[/B][/I][I][B]iptables -A INPUT -p tcp -m tcp —-dport 1936 -j ACCEPT
[/B][/I][I][B]iptables -A INPUT -p tcp -m tcp -—dport 8088 -j ACCEPT[/B][/I]
 Sometimes ports need to be configured in a hardware firewall. Contact server provider / administrator for more details about enabling ports.
 This info provided by a host could also be helpful.
 [INDENT]Please be advised that custom iptables rules should be placed in the directory listed below.
/etc/sysconfig/iptables-custom
 The software firewall rule is listed as follows:
# cat /etc/sysconfig/iptables-custom/99Red5 *filter
 -A INPUT -p tcp -m tcp –dport 1935 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 1936 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 5080 -j ACCEPT
-A INPUT -p tcp -m tcp –dport 8088 -j ACCEPT
 COMMIT
[/INDENT] [B]RED5 & VIDEOWHISPER[/B]
 This was done for the installation of VideoWhisper applications. To do that just [URL="http://www.videowhisper.com/?p=RTMP+Applications"]download the latest videowhisper rtmp application[/URL], unzip it on your computer and copy the videowhisper folder and all its contents to/opt/red5/dist/webapps .  As verification, check that you have a /opt/red5/dist/webapps/videowhisper/WEB-INF/ folder on your server. After copying/updating this, restart the Red5 server (as explained above) and you can install the [URL="http://www.videowhisper.com/"]videowhisper video conferencing / live streaming scrips[/URL] to use the new rtmp application.
 The Red5 VideoWhisper RTMP Application has some cool settings, like enabling access with external players / archiving of all video streams as flv files / limiting access to certain domains / setting absolute paths for live streams and recordings to be able to share videos with other applications (i.e. [URL="http://www.videochat-scripts.com/tag/video-sharing/"]video sharing[/URL]). Edit all these in WEB-INF/red5-web.properties and restart the Red5 server.
 If we forgot to mention something here, or you have any questions about this submit your inquiries on [URL="http://www.videowhisper.com/tickets_submit.php"]Video Whisper Contact Page[/URL] or comment below.
 An alternative to doing the red5 installation yourself would be to [URL="http://www.videowhisper.com/?p=Red5+Installation"]order red5 installation[/URL] .
 If you don’t have the time and experience to run your own server or vps, you should use [URL="http://www.videowhisper.com/?p=Red5+Hosting"]managed red5 hosting[/URL] .
 
Status
Not open for further replies.
Back
Top