(一)openssl安装
版本不能太高,建议安装此版本。
wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1f.tar.gz
tar -xvf openssl-1.0.1f.tar.gz
./config --prefix=/usr/local/openssl
make
make install
如果有报错:
cms.pod around line 457: Expected text after =item, not a number
cms.pod around line 461: Expected text after =item, not a number
cms.pod around line 465: Expected text after =item, not a number
cms.pod around line 470: Expected text after =item, not a number
cms.pod around line 474: Expected text after =item, not a number
POD document had syntax errors at /usr/bin/pod2man line 69.
make: *** [install_docs] Error 1
执行
rm -f /usr/bin/pod2man
在/etc/ld.so.conf文件的最后面,添加如下内容:
/usr/local/openssl/lib
ldconfig
echo 'export OPENSSL=/usr/local/openssl/bin' >>/etc/profile
echo 'export PATH=$OPENSSL:$PATH:$HOME/bin' >>/etc/profile
echo 'C_INCLUDE_PATH=/usr/local/include/openssl ' >> /etc/profile
echo 'export C_INCLUDE_PATH ' >> /etc/profile
echo 'CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/include/openssl '>> /etc/profile
echo 'export CPLUS_INCLUDE_PATH ' >>/etc/profile
source /etc/profile
查看版本
[root@VM_0_13_centos lib]# openssl version
OpenSSL 1.0.1f 6 Jan 2014
[root@VM_0_13_centos lib]#
(二)zlib安装
yum install -y zlib zlib-devel
下面使用编译安装:
官网地址:http://www.zlib.net/ 我下载的是:zlib-1.2.11.tar.gz,然后上传到centos服务器上。
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11/
./configure --prefix=/usr/local/zlib
make
make check
make install
echo "/usr/local/zlib/lib" >> /etc/ld.so.conf
ldconfig -v
(三)libssl-dev 安装
yum install openssl-devel
以上步骤,可自行安装,本文主要讲librtmp的编译安装
(四)编译libRTMP
wget http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz
tar -xvf rtmpdump-2.3.tgz
cd rtmpdump-2.3
make
make install
make[1]: Entering directory `/home/srs/rtmpdump-2.3/librtmp'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/srs/rtmpdump-2.3/librtmp'
mkdir -p /usr/local/bin /usr/local/sbin /usr/local/man/man1 /usr/local/man/man8
cp rtmpdump /usr/local/bin
cp rtmpgw rtmpsrv rtmpsuck /usr/local/sbin
cp rtmpdump.1 /usr/local/man/man1
cp rtmpgw.8 /usr/local/man/man8
make[1]: Entering directory `/home/srs/rtmpdump-2.3/librtmp'
mkdir -p /usr/local/include/librtmp /usr/local/lib/pkgconfig /usr/local/man/man3
cp amf.h http.h log.h rtmp.h /usr/local/include/librtmp
cp librtmp.a /usr/local/lib
cp librtmp.pc /usr/local/lib/pkgconfig
cp librtmp.3 /usr/local/man/man3
cp librtmp.so.0 /usr/local/lib
cd /usr/local/lib; ln -sf librtmp.so.0 librtmp.so
make[1]: Leaving directory `/home/srs/rtmpdump-2.3/librtmp'
root@iZ94zegqx2lZ:/home/srs/rtmpdump-2.3#