网上找的安装opendiameter的文章

 第一篇

Opendiameter安装全过程(with trouble shooting)
所需的软件包/必须配置

· automake 1.9.2

· autoconf 2.59

· libtool 1.5.6

· gcc (GCC) 3.4.3

· boost_1_33_0

· openssl-0.9.8

· ACE-5.5

· Opendiameter-1.0.7-i

· Xercesc-src-2.7.0

注意:此次安装是在Fedora5上,在F8上安装没有成功过,F7只能装ACE5.6

设置环境变量

#vi /etc/bashrc

加入下面几行:

export SSL_ROOT=/usr/local/ssl

export BOOST_ROOT= /usr/local/boost/boost_1_34_1

export ACE_ROOT=/usr/local/ACE_wrappers

export XERCESCROOT=/usr/local/xerces-c-src_2_7_0

LD_LIBRARY_PATH=/usr/local/lib:$ACE_ROOT/lib:/usr/local/ssl/lib:/usr/local/ACE_wrappers/websvcs/lib:/usr/local/ACE_wrappers/ace/SSL:/usr/local/ACE_wrappers/lib:/usr/local//xerces-c-src_2_7_0

并使这些环境变量生效(运行source 或者重新登陆)

Installation of Boost

用源码装包直接编译安装:

下载源码包,

$cd usr/local/boost/boost_1_34_1

$./configure –help 看一下configure 命令的选项

$./configure –prefix= usr/local/boost_1_34_1

$ make install

在$ BOOST_ROOT /lib中生成许多库,时间很久~ 40min+

成功!

Installation of openssl

解压缩,进入文件夹opensll-0.9.8e下:

./config shared

make

make test

make install

成功!

Installation of XERCES-C
库的安装:

解压src包:

Tar –zxvf xerces-c-src_2_7_0.tar.gz

cd src/xercesc

./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread

make

安装完成:可在/xerces/xerces-c-src_2_7_0/lib见到安装好的库

例子的安装:

在xerces-c-src_2_8_0/下,

cd samples

./runConfigure -h

To continue our build procedure from the previous section, we execute runConfigure with the following options:

./runConfigure -plinux -cgcc -xg++ -rpthread

After that we can run GNU make to build the samples:

make

在bin中成功生成可执行文件。

ACE的安装ACE-5.6.tar.gz/ACE-5.5.tar.gz—release vision

因为F7比较主流,GNU Autotool 支持ACE要求,所以没有测试该工具,直接编译安装ACE

法一、Traditional ACE/GNU Configuration

【F 8成功: ACE-5.6.tar.gz/ACE-5.5.tar.gz】

1. 下载源码包解压缩

tar zxvf ACE-5.6.tar.gz /ACE-5.5.tar.gz

2. 配置脚本文件

2.1

cd /usr/local/ACE_wrappers/ace/

cp ./config-linux.h ./config.h

加入如下内容:

include "ace/config-linux.h"

2.2

cd ../include/makeinclude/

ln -s ./platform_linux.GNU ./platform_macros.GNU

加入:include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU

不同platform有不同的配置头文件以供选择,具体选择参见$ACE_ROOT/ace/README

修改

Trouble Shooting:

Note 1: 修改文件

$ACE_ROOT/bin/MakeProjectCreator/config/default.features

加入如下一行:

ssl = 1

是为在F7中安装Opendiameter时,能够识别-lACE_SSL所设置,具体原因见相关学习文档:<Gcc 4&no hidden visibility 调研>

 

Note 2 :不管以何种方式配置平台文件:在platform_macros.GNU文件中必须加入如下内容

no_hidden_visibility ?= 1

ssl ?= 1

Problem 1: While running make for Open Diameter following error may be encountered:

/usr/bin/ld: cannot find -lACE_SSL

To overcome this error, copy all the files in $ACE_ROOT/lib to /usr/lib directory

Problem 2: In case of compilation error, header files com_err.h, krb5.h and profile.h may need to be copied from /usr/kerberos/include/ to /usr/include/

Problem 2: 找不到ACEXML。原因:没有make install

Problem 3: 找不到M_sig。5.6版本有这个问题,装5.5吧

3. [ACE-5.6.tar.gz成功]

3.1 编译ssl

直接完全编译ACE_wrappers会花较长时间,可以先进入$ACE_ROOT/ace编译

[如ACE-INSTALL.html所述]

cd ace

make ssl=1

$(ACE_ROOT)/SSL中生成两个库:libACE_SSL.so、libACE_SSL.so.5.5.2; lib中生成 10个库

cd ace

make ssl=1

lib中生成四个库: libACE_SSL.so.5.6.0、libACE_SSL.so、libACE.so、libACE.so.5.6.0

ace/SSL中生成两个库:

3.2 整体编译

进入$( ACE_ROOT),新建文件夹build

# mkdir build

# cd build

../configure

make

生成ACE的 library, tests, examples, 和 sample applications,等待20min,ACE_ROOT /lib中新增很多库(78-4个)

make install

ACE库安装成功

4. [ACE-5.5.tar.gz成功]

在ACE_wrappers文件夹中建立一个文件夹,例如build

# cd $ACE_ROOT
# mkdir build
# cd build

进入上级目录编译配置文件

# ../configure [options]

在各库的目录下建立makefile文件,

编译:make ssl=1 no_hidden_visibility=1 ;

编译成功,在$(ACE_ROOT)/lib中生成库

5. 测试

grep -i err /tmp/myacemaker.err ( if no error then u r through)

cd $ACE_ROOT

若找不到该.err文件,则安装成功

法二、Building ACE with GNU Autoconf [ACE-5.5.tar.gz@Fedora 7]

1. 解压缩得到文件夹ACE_wrappers

2. 将自动安装文件ACE-install.sh 移出,与源码压缩包ACE-5.5.tar.gz放至相同文件夹/tmp下

3. 删除原解压缩的包ACE_wrappers,脚本文件将会自动解压缩该压缩包,若不删除,则编译时会自动删除该文件夹并报错

$rm –r ACE_wrapper

4. 根据文件中注释line 53~62:编译变量的实际路径和配置文件编辑ACE-install.sh并去掉注释符号#:

MY_ACEDIR=/tmp /*将MY_ACEDIR变量定义为放压缩包的目录*/

MY_ACE_CONFIG=config-linux.h /*将变量改为适合编译平台的设置变量,并去掉注释符号*/

MY_ACE_GNU_MACROS=platform_linux.GNU /*具体参加README */

5. 已经设定过环境变量,此时就直接进入放压缩包的目录,安装ACE

cd /home/mabel/ACE

sh ./ACE-install.sh auto

ACE-5.5.tar.gz报错:

ACE-install.sh脚本文件,可能是将套件配置环境写死,如要求gcc 3.2,而F7自带gcc 为4.1.2版本,

[编译通过]5 minutes later: Configuration of TAO1.6 is now complete

# make ssl=1

[报错]:

../../../ace/SSL/SSL_Asynch_BIO.h:29:25: opensll/bio.h:No such file or directory

Make[3]: ***[libACE_SSL_la-SSL_Asynch_BIO.lo]错误1

Leaving directory ‘/usr/local/ACE_wrappers/build/ace/SSL’

Make[2]: ***[libACE_SSL_la-SSL_Asynch_BIO.lo]错误1

‘/usr/local/ACE_wrappers/build/ace’

Make[1]:***[all-recursive]错误1

安装open diameter成功

将Opendiameter-1.0.7-i 压缩包在根目录下释放、安装编译:

[root@localhot /]#cd opendiameter-1.0.7-i

依次键入命令行:

[root@localhot /]#./configure [–prefix=/usr/local]

[root@localhot /]# make

[root@localhot /]# make install

 

Notes

1. 若ACE安装时没有对platform_macros.h进行设置,

则make会出错:-lACE_SSL cannot find

或 cannot find “m_sigMessageFalg” 之类的错误

2. 在运行opendiameter的例子时发现,安装包的路径放置非常重要

笔者运行成功时,是将opendiameter-1.0.7-i.tar.gz放置在与root目录平行的路径下,

即[root@localhot /]#终端下释放编译,而不是root目录,即[root@localhot /]#下释放编译

错误情况:将opendiameter-1.0.7-i.tar.gz放置在/root下安装,在 /etc中未生成opendiameter, 此时将application拷贝至etc,改名为opendiameter,在/nas 运行./nasd, 即报错:

第二篇

 OpenDiameter 安装指南

<script type="text/javascript"> </script>

1. 说明

本文是我在linux下安装OpenDiameter的全过程, 安装的是opendiameter-1.0.7-a版。

2. 前期准备

2.1 需要的lib

Lib

Ver

GNU g++ versions

3.2.2

Xerces C++ XML Parser

2.5.0

ACE library

5.4

BOOST library

1.30

OpenSSL

0.9.7a-2

Autoconf

2.59

Automake

1.85

其中g++, openssl, Autoconf, Automakelinux中自带,如果没有请在安装包里找到他们的rpm进行安装,其余的可以在附件中获得。

3. 安装步骤

现在先假定所有的操作都在/home/vimp/下进行

3.1 解压

把上述所有资源解压到/home/vimp/

$tar -xzvf xxx.tar.gz

3.2 设置环境变量

$ vi .bash_profile


#set ACE directory

ACE_ROOT=/home/vimp/ACE_wrappers;export ACE_ROOT

#set xerces directory

XERCESCROOT=/home/vimp/xerces-c-src_2_5_0;export XERCESCROOT

#set Boost directory,Boost下载已编译好的就可以,只要设置环境变量。

BOOST_ROOT=/home/vimp/boost_1_33_1;export BOOST_ROOT

 

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ACE_ROOT/ace:$ACE_ROOT/lib:$ACE_ROOT/bin:$XERCESCROOT/lib:/home/vimp/opendiameter-1.0.7-a:/lib:/usr/lib:/usr/local/lib:$BOOST_ROOT/libs;export LD_LIBRARY_PATH

 

PATH=$PATH:$XERCESCROOT/bin:$ACE_ROOT/ace:$ACE_ROOT/lib:$ACE_ROOT/bin:/usr/vacpp/bin;export PATH


3.3 编译Xerces C++ XML Parser

说明:我下载已经编译好的Xerces C++ XML Parserlib库,但编译opendiameter时通不过,一直有错误,所以还是下载2.50版本的源代码,自己编译。最后用makegmake都可以。

$ cd $XERCESCROOT/src/xercesc/
$ ./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread
$ gmake

3.4 编译autoconf/automake

说明:这段是网上摘下来的,一般装的系统下都有这两个软件,如果遇到没有的系统,可以参考下面。

# cd /root/autoconf-2.59
# ./configure --prefix=/usr
# make
# make install

# cd /root/automake-1.8.5
# ./configure --prefix=/usr
# make
# make install

3.5 编译ACE

1.修改文件

进入$ACE_ROOT/ace/下,修改config.h

$vi config.h

#include "ace/config_linux.h"

保存退出

进入$ACE_ROOT/include/makeinclude/下,建立platform_macros.GNU

$vi platform_macros.GNU

include $ACE_ROOT/include/makeinclude/platform_linux.GNU

保存退出

2. 编译

进入$ACE_ROOT/acemake。等待一会,编译完后,进入lib下,看是不是有.so文件了,成功!

说明:opendiameter要用到libACESSL这个库,所以要到$ACE_ROOT/ace/SSL/make一下,产生libACE_SSL.so,libACE_SSL.so.5.4.0这两个库文件。另外我用5.5版的编译生成库文件后,编译opendiameter也后有错误,所以按要求用的5.4版本的。

3.6 编译OpenDiameter

确定系统是不是已经安装了opensslkerberos,一般这两个在装linux的时候都是自带的,如果没有请在linux的安装包里找到他们的rpm包进行安装。我装的时候系统都装了,这里没遇到什么问题。

# ln -s /usr/kerberos/include/com_err.h /usr/include/
# ln -s /usr/kerberos/include/profile.h /usr/include/
# ln -s /usr/kerberos/include/krb5.h /usr/include/
# cd /home/vimp/opendiameter-1.0.7-a
# ./configure
# make

第三篇

首先需要的文件有
ACE-5.5.tar
boost_1_35_0.tar
opendiameter-1.0.7-i.tar.gz

假设上面三个文件都在 /home/jim/opendiameter 目录下
tar -xvf ACE-5.5.tar
cd ACE_wrappers/
mkdir build
cd build
../configure --prefix=/home/jim/opendiameter/ace && make && make install

cd /home/jim/opendiameter
tar -xvf boost_1_35_0.tar
cd boost_1_35_0
./configure --prefix=/home/jim/opendiameter/boost && make && make install
 
cd /home/jim/opendiameter
编辑一个文件,命名为profile,内容如下,每次需要编译或运行diameter的时候首先运行
export ACE_ROOT=/home/jim/opendiameter/ace
export BOOST_ROOT=/home/jim/opendiameter/boost
export LD_LIBRARY_PATH=$ACE_ROOT/lib:$BOOST_ROOT/lib:/home/jim/opendiameter/od/lib/:$LD_LIBRARY_PATH

source profile
用env命令查看一下环境变量
env

准备编译 opendiameter-1.0.7-i.tar.gz
首先运行
cd /home/jim/opendiameter/ace
ln -s include/* ./
再运行
cd include/ace
cp -a /home/jim/opendiameter/ACE_wrappers/ace/Swap.cpp ./

如果出现了 undefined reference to `ACE_OS::fast_memcpy问题,执行下面操作可解决
cp  /home/jim/opendiameter/ACE_wrappers/ace/*.* /home/jim/opendiameter/ace/include/ace/


然后就可以开始编译了
tar -xvzf opendiameter-1.0.7-i.tar.gz
cd opendiameter-1.0.7-i
./configure --prefix=/home/jim/opendiameter/od && make && make install

到这里基本上就可以任意编译opendiameter了

如果需要编译opendiameter cc, 编译的时候基本上都需要如下设置
ACE_ROOT=/home/jim/opendiameter/ace
BOOST_ROOT=/home/jim/opendiameter/boost
OD_ROOT=/home/jim/opendiameter/od/include/opendiameter

 

第四篇

[zz]My OpenDiameter Experience, Part I, Build and Installation

Diameter is a AAA protocol that is supposed to be the successor to RADIUS, and OpenDiameter is an open source implementation of the Diameter Protocol. I recently started playing around with OpenDiameter and, to my surprise, the online resources and documentations on how to use it are very hard to find, if there is any. I figured out my way to get the basics running, and I am here to share my initial experiences, hoping to help other OpenDiameter beginners. I also hope that the OpenDiameter community could contribute more documentations to help new users and to make the project be more successful.

I will cover it in two posts:

  • Part I is for build and installation
  • Part II is for setting up a simple 3-party EAP-MD5 test

Part I, Build and Installation

You can download the OpenDiameter source package from this link.

The current release is of 1.0.7-i, and that is what I am going to use too. The best resource for this is the main README file that came with the source package, and it is more up to date than the how-to listed in the OpenDiameter website.

We should follow the instructions in the README file and they can be summarized as:

  • Step 1. Install external libraries and tools if not already there
  • Step 2. Set up environment variables ACE_ROOT and BOOST_ROOT to point to the right paths on your system
  • Step 3. Extract OpenDiameter source package and do the usual “./configure; make; make install” routine in the OpenDiameter top directory.

Sounds pretty straightforward. However, there might be some tricky places. The parts that most likely will give you problems are the external libraries. OpenDiameter 1.0.7-i requires: 1. GNU g++ 4.x.x and above 1. ACE library 5.5.x 1. boost library 1.33.x and above 1. OpenSSL 1. Autoconf, Automake, Libtool

Number 1. and 5. are very common build tools on Linux and the like, and you usually wouldn’t need to worry too much about them. OpenSSL is also very stable and easy to install if not pre-installed already. It is 2. and 3., i.e. ACE and boost libraries, that could be a little more i tricky.

Boost Library

For boost library, I found that the easiest way to install them is to use existing packaging tools like apt-get or yum. The version available seems just working fine. This is what I did on my ubuntu and FC (Fedora Core) 8 respectively.

ubuntu:

apt-get install libboost-dev

FC8:

yum install boost-devel

Note: you might need to be root or use sudo to install them.

After installing boost like the above, set the BOOST_ROOT environment to /usr/include/. The following is for bash:

export BOOST_ROOT=/usr/include/

ACE Library

ACE library installation could be the most troublesome in the whole process. OpenDiameter heavily relies on ACE library and it is also very picky about the version of it. The README file says 5.5.x, and trust me, not all 5.5.x would work. What I learned from hours of frustration is:

  • 5.5 and low 5.5.x versions fail to build themselves. (at least on both the ubuntu and FC8 I have)
  • 5.6 (the latest available) and high 5.5.x versions (like 5.5.10) will build themselves, but OpenDiameter 1.0.7-i won’t build if using them.

After trying both, I chose the lesser of the two evils by using ACE 5.5 base version.

( To get ACE 5.5 itself compile, I only needed to change one small place on either system of mine, even though figuring that one place out took me some time. To get 5.6 compile, I had many more places to fix due to interface changes in ACE lib, but only to find the binaries built don’t read the XML configuration files correctly. That was when I got scared and gave up. So my advice here is: stick to the ACE 5.5 base version itself)

Here is what needs to be done to install ACE 5.5:

  • Get the 5.5 source here.

  • Extract the tar file, and the main directory would be called ACE_wrappers. Get in there and create a sub-directory called “build”, and that is where the build will happen. (ACE doesn’t allow you to do build in the top directory)

tar xvf ACE-5.5.tar.gz
cd ACE_wrappers
mkdir build
cd build
../configure
  • If it passes, congratulations! However, on both my systems it failed at the configure script. Here is what I did to fix those:

On my ubuntu, the gcc option -fvisibility-inlines-hidden used by ACE lib is causing problem and it can be fixed by removing it in the configure script file this way:

$ diff -upN configure.orig configure
--- configure.orig      2008-03-05 11:11:19.000000000 -0800
+++ configure   2008-03-05 11:13:30.000000000 -0800
...
@@ -10329,7 +10329,7 @@ _ACEOF
        *)
         { echo "$as_me:$LINENO: enabling GNU G++ visibility attribute support" >&5
 echo "$as_me: enabling GNU G++ visibility attribute support" >&6;}
-        ACE_GXX_VISIBILITY_FLAGS="-fvisibility=hidden -fvisibility-inlines-hidden"
+        ACE_GXX_VISIBILITY_FLAGS="-fvisibility=hidden"
         ACE_CXXFLAGS="$ACE_CXXFLAGS $ACE_GXX_VISIBILITY_FLAGS"
         cat >>confdefs.h <</_ACEOF

On FC8, it failed because the header file for gettimeofday() on the system is <sys/time.h> not the expected <time.h> by configure script. So the following change in configure file fixed it:

# diff -upN ../configure.orig ../configure
--- ../configure.orig   2008-03-17 15:29:07.000000000 -0700
+++ ../configure        2008-03-17 16:31:00.000000000 -0700
@@ -87878,7 +87878,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */

-#include <time.h>
+#include <sys/time.h>

 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |

Assuming your system already have

With those changes, I could proceed to the next step

  • redo ../configure
  • make and make install

Unfortunately, there is no guarantee the ACE 5.5 build won’t have different symptoms on different systems, and I can only wish you good luck there. 

Suppose your ACE 5.5 does get installed, you need to set the environment variable ACE_ROOT for OpenDiameter build’s use. I installed ACE under /usr/local/src and here is what I did in my bash:

export ACE_ROOT=/usr/local/src/ACE_wrappers/

Build and Install OpenDiameter 1.0.7-i itself

Once I got both ACE 5.5 and boost installed, and both environment variables set, installing OpenDiameter itself became simple:

tar xvf opendiameter-1.0.7-i.tar.gz
cd opendiameter-1.0.7-i
./configure
make
make install

After that is done, verify by checkding if /usr/local/bin/aaad and /usr/local/bin/nasd are in place.

Those are two of the main binaries we will use for OpenDiameter. Now OpenDiameter should be ready for tests. In Part II, I will cover how to configure and use the binaries built for a simple EAP-MD5 test.

2008年4月29日 12:10

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值