Skip to main content

Red5 Installation Procedure

For Fedora:

1. Install Java (JDK)

2. Install Ant

Extract apache-ant-[VERSION]-bin.tar.gz to /usr/ant/

3. Export variables

export ANT_HOME=/usr/ant/
export JAVA_HOME=/usr/java/latest/
export _JAVA_OPTIONS="-Xmx64m"

4. Install Red5

svn export http://red5.googlecode.com/svn/java/server/trunk/ /opt/red5/
cd /opt/red5/
ant

5. Setup iptables

# Red5 RTMP
-A INPUT -p tcp -m tcp --dport 1935 -j ACCEPT

# Red5 RTMPT
-A INPUT -p tcp -m tcp --dport 8088 -j ACCEPT

# Red5 HTTP servlet engine port
-A INPUT -p tcp -m tcp --dport 5080 -j ACCEPT

# Red5 Debug proxy port
-A INPUT -p tcp -m tcp --dport 1936 -j ACCEPT

6. Test Red5

cd /opt/red5/dist/
./red5.sh &
Be patient, Red5 needs a looooooong time to start.
Use "top" to check if "java" is running.
Visit http://[SERVER]:5080

7. Add init script
/etc/init.d/red5
QUOTE

#!/bin/sh
# For RedHat and cousins:
# chkconfig: 2345 85 85
# description: Red5 flash streaming server
# processname: red5

PROG=red5
RED5_HOME=/opt/red5/dist
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid

export ANT_HOME=/usr/ant/
export JAVA_HOME=/usr/java/latest/
export _JAVA_OPTIONS="-Xmx64m"

# Source function library
. /etc/rc.d/init.d/functions

[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5

RETVAL=0

case "$1" in
start)
echo -n $"Starting $PROG: "
cd $RED5_HOME
$DAEMON >/dev/null 2>/dev/null &
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
echo $! > $PIDFILE
touch /var/lock/subsys/$PROG

fi
[ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
echo
;;
stop)
echo -n $"Shutting down $PROG: "
killproc -p $PIDFILE
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
;;
restart)
$0 stop
$0 start
;;
status)
status $PROG -p $PIDFILE
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac

exit $RETVAL


For Debian:

Similar to above.

1 & 2. Install Java and Ant (non-free packages)
aptitude install sun-java6-jdk ant

3. Skip this step

7. Add init script
/etc/init.d/red5
QUOTE

#
#!/bin/sh -e
#
# Startup script for Red5

export RED5_HOME=/opt/red5/dist

start_red5="$RED5_HOME/red5.sh start"
stop_red5="$RED5_HOME/red5_shutdown.sh stop"

start() {
echo -n "Starting Red5: "
${start_red5}
echo "done."
}
stop() {
echo -n "Shutting down Red5: "
${stop_red5}
echo "done."
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
sleep 10
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac

exit 0

Comments

Popular posts from this blog

ISPConfig / Pure-FTP / SSL (TLS) setup

ISPConfig comes with LetsEncrypt integrated in its panel for web domains. However, it does not automatically use the SSL cert for FTP service (PureFTP). This post describes the steps to enable the support. 1. We need an FQDN so that Lets Encrypt (LE) will be able to generate SSL under ISPConfig panel. 2. PureFTP TLS support requires a cert in .pem format which can be generated by leveraging the LE cert generated: cat /etc/letsencrypt/live/mydomain.com/privkey.pem /etc/letsencrypt/live/mydomain.com/fullchain.pem > /etc/ssl/private/pure-ftpd.pem 3. Restart PureFTP so that it will not use the new certificate 4. LE certificates need to be renewed regularly so it is necessary to create a cron job to keep the .pem file updated. Setup a crontab 0 6 * * * /etc/letsencrypt/certbot-auto -n renew --quiet --no-self-upgrade && cat /etc/letsencrypt/live/mydomain.com/privkey.pem /etc/letsencrypt/live/mydomain.com/fullchain.pem > /etc/ssl/private/pure-ftpd.pem && se

ISPConfig 3 / Mail / Custom mail filter recipe

Recently trying to setup a mail re-direct (or a cc) to an external e-mail address. It is important to first determine if you are running courier or dovecot because the syntax is different. Under dovecot, it should be in sieve syntax. Therefore, under ISPConfig3 -> Email -> Email Mailbox -> Custom Rules, enter: redirect "mail@example.com"; Ensure it is double straight quotes and semi-colon at the end. Wait until the update is done (usually a few minutes) via the cron jobs of ISPConfig3 updating the /var/vmail/domain/username/.sieve

Ubuntu 16.04 and ISPConfig 3.1 - stopping ClamAV

ClamAV requires quite a bit of resources to run in the background and this usually slows down the mail delivery. In the ISPConfig 3 (Under Perfect Server setup), clamAV is run within Amavis. Therefore, typical removal of clamAV commands will not remove it. When RAM is really low, Linux kills amavis and this will cause mail not being delivered. Therefore, if we run amavis to manage anti-virus and spam, consider a minimum of 2G or 4G RAM VM/Cloud servers. The steps to disable clamav and amavisd are: (1) edit postfix conf - note amavis uses a special port 10024 and 10026. Therefore, if you are not using these ports, consider closing them in your firewall settings. nano /etc/postfix/main.cf # content_filter = amavis:[127.0.0.1]:10024 # receive_override_options = no_address_mappings (2) Under ISPConfig 3.1, comment additional 2 lines nano /etc/postfix/tag_as_foreign.re # /^/ FILTER amavis:[127.0.0.1]:10024 nano /etc/postfix/tag_as_originating.re # /^/ FILTER amavi