嗨,我已经安装了Java,Maven并设置了Java和Maven所需的所有环境变量,
只需要有关如何从源代码构建red5的指导
请参阅此https://github.com/Red5/red5-server#build-from-source


我的规格:


  Apache Maven 3.2.2(45f7c06d68e745d05611f7fd14efb6594181933e;
  2014-06-17T09:51:42-04:00)Maven主页:
  /usr/local/apache-maven/apache-maven-3.2.2
  
  Java版本:1.7.0_79,供应商:Oracle Corporation
  
  Java主页:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.79.x86_64/jre
  
  默认语言环境:en_US,平台编码:UTF-8操作系统名称:“ linux”,
  版本:“ 2.6.32-431.23.3.el6.x86_64”,拱门:“ amd64”,家族:“ unix”

最佳答案

对于Java 1.7,我不知道Red5是否兼容,并且需要进行认真的更新。我正在CentOS 7、1GB Ram和Java 1.6上运行Red5服务器(0.8.0)。

预安装;

yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel
cd /usr/local/src
wget http://apache.cs.utah.edu//ant/binaries/apache-ant-1.8.2-bin.tar.gz
tar zxvf apache-ant-1.8.2-bin.tar.gz
mv apache-ant-1.8.2 /usr/local/ant
export ANT_HOME=/usr/local/ant
export JAVA_HOME=/usr/lib/jvm/java
export PATH=$PATH:/usr/local/ant/bin
export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
echo 'export ANT_HOME=/usr/local/ant' >> /etc/bashrc
echo 'export JAVA_HOME=/usr/lib/jvm/java' >> /etc/bashrc
echo 'export PATH=$PATH:/usr/local/ant/bin' >> /etc/bashrc
echo 'export CLASSPATH=.:$JAVA_HOME/lib/classes.zip' >>/etc/bashrc
yum install subversion


Red5安装;

cd /usr/local/
svn export http://red5.googlecode.com/svn/java/server/tags/0_8_0/
mv 0_8_0 /usr/local/red5
cd red5
ant prepare
ant dist


用于运行Red5;

cd /usr/local/red5/dist
sh red5.sh


如果您发现有关JAVA内存的错误;

export _JAVA_OPTIONS="-Xms32m -Xmx128m"


和用于自动运行的脚本;

#!/bin/sh
# Startup script for Red5 flash streaming server on RedHat/CentOS (cPanel)
# chkconfig: 2345 95 55
# description: Red5 Flash Streaming Server
# processname: red5

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

# 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: "
 export _JAVA_OPTIONS="-Xms32m -Xmx128m"
 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


享受您的RED5 Flash Media Server

资料来源:https://forum.ovh.com/showthread.php?83099-TUTO-Installer-serveur-RTMP-(Flash-Server)-avec-Red5

关于linux - 如何在我的Linux centos机器上使用Maven通过ssh安装Red5媒体服务器?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30682288/

10-15 14:18