1. 下载最新版erlang otp_17.0
2. 解压缩 tar -zxvf otp_src_17.0
4. ./configure --prefix=/opt/erlang --without-javac
5. 需要安装ncurses : yum install ncurses-devel
6.安装好 ncurses后继续 ./config --prefix=/opt/erlang --without-javac
8. make install
9.安装成功,可以做一个链接: ln -s /opt/erlang/bin/erl /usr/local/bin/erl
在安装过程中可能会遇到如下情况:
*********************************************************************
********************** APPLICATIONS DISABLED **********************
*********************************************************************
crypto : No usable OpenSSL found
odbc : ODBC library - link check failed
orber : No C++ compiler found
ssh : No usable OpenSSL found
ssl : No usable OpenSSL found
*********************************************************************
*********************************************************************
********************** APPLICATIONS INFORMATION *******************
*********************************************************************
wx : wxWidgets not found, wx will NOT be usable
*********************************************************************
*********************************************************************
********************** DOCUMENTATION INFORMATION ******************
*********************************************************************
documentation :
fop is missing.
Using fakefop to generate placeholder PDF files.
解决上述问题:
1. ODBC library - link check failed 需要安装 unixODBC
> yum list|grep unixODBC
> yum install unixODBC-devel
2. No usable OpenSSL found :需要安装 openssl
> yum list|grep ssl
> yum install openssl-devel
3. No C++ compiler found:需要安装gc c++ 编译器
> yum list|grep gcc
> yum install gcc-c++
4. wxWidgets not found, wx will NOT be usable : wxWidgets 这个库需要单独下
(http://www.wxwidgets.org/downloads/),yum 下没有:
> 下载wxWidgets 源码包 后解压缩并编译安装
> bzip2 -d wxWidgets-3.0.0.tar.bz2 tar -jxvf
> tar -xvf wxWidgets-3.0.0.tar
> 安装依赖库: yum list *gtk+* yum install gtk+extra
>进入解压缩目录, ./configure --with-opengl --enable-debug --enable-unicode
> 出现问题 OpenGL libraries not available,则需要安装OpenGL库
>> yum list mesa* yum install mesa *
>> yum list|grep freeglut yum install freeglut*
>解决 OpenGL 问题后直接运行 make & make install
5. fop is missing. 可忽略
FOR OTP 18+:
1 解压,比如解压到 /home /...../erlang_otp18
2 cd /home /...../erlang_otp18
3 export ERL_TOP=/home /...../erlang_otp18
4 ./otp_build autoconf
5./configure
6 make
7 make install
可以在/etc/profile 当中添加
PATH=$PATH:/opt/erlang/bin
export PATH
保存退出,再用命令source /etc/profile 生效
checking for yaml.h... no
configure: error: libyaml library was not found
cd tmp/ sudo wget http://pyyaml.org/download/libyaml/yaml-0.1.6.tar.gz sudo tar xzvf yaml-0.1.6.tar.gz cd yaml-0.1.6/ sudo ./configure sudo make sudo make install
ejabberdctl live
#报错,发现找不到 libyaml-0.so.2
#[info] Application p1_yaml exited with reason: {{load_failed,"Failed to load NIF library /lib/ejabberd/priv/lib/p1_yaml: 'libyaml-0.so.2: cannot open shared object file: No such file or directory'"},{p1_yaml_app,start,[normal,[]]}}
#8,排查问题
#参考 http://www.ejabberd.im/node/15418
#查找 libyaml-0.so.2
find / -name libyaml-0.so.2 -exec ls -l '{}' \;
#发现已经安装了 libyaml-0.so.2
#结果尝试在 /lib/libyaml-0.so.2 创建软连接,在尝试,发现成功
ln -s /usr/local/lib/libyaml-0.so.2.0.2 /lib/libyaml-0.so.2
#在进行启动
ejabberdctl live
#成功