Installing OpenVPN on your Asterisk Server (PBX in a Flash Distribution)

For all of you that are looking to secure communications for softphones OpenSSL looks to be a good option. Right now we are in the process of testing it and ran through the OpenSSL installation. We provided a set of instructions on getting it installed on your PBX in a Flash Server. (Cent O.S 5.2)
Download openvpn
wget http://openvpn.net/release/openvpn-2.0.9.tar.gz

Download LZO and install the rpm
wget http://dag.wieers.com/rpm/packages/lzo/lzo-1.08-4.2.el5.rf.i386.rpm
rpm -ivh lzo-1.08-4.2.el5.rf.i386.rpm

You can try to build the rpm package from the tarball (but it will probably fail).
rpmbuild -tb openvpn-2.0.9.tar.gz

It will probably tell you it requires certain dependencies and will not allow you to continue. The dependencies are listed below.
– openssl
– pam
– lzo – you’ll probably have to download it
– openssl-devel
– pam-devel
– lzo-devel – you’ll probably have to download it

If you dont have openssl, openssl-devel, pam and pam-devel installed you can use yum to install them.
yum install openssl pam openssl-devel pam-devel

You can download lzo-devel and install it.
wget ftp://ftp.pbone.net/mirror/download.fedora.redhat.com/pub/fedora/epel/5/i386/lzo-devel-2.02-2.el5.1.i386.rpm
rpm -ivh lzo-devel-2.02-2.el5.1.i386.rpm

If for some reason when you try to install the lzo-devel package it complains that the dependencies are not available you can download the following

lzo2-devel
wget ftp://ftp.pbone.net/mirror/dag.wieers.com/packages/lzo2/lzo2-2.02-3.el5.rf.i386.rpm
rpm -ivh lzo2-2.02-3.el5.rf.i386.rpm

liblzo2_2
wget ftp://ftp.pbone.net/mirror/atrpms.net/el5-i386/atrpms/stable/liblzo2_2-2.03-6.el5.i386.rpm
rpm -ivh liblzo2_2-2.03-6.el5.i386.rpm

libminilzo.so.2
wget http://dl.atrpms.net/all/libminilzo2-2.03-6.el5.i386.rpm
rpm -i libminilzo2-2.03-6.el5.i386.rpm.

You can now try to install lzo-devel. It should install now with no problems.
rpm -i lzo-devel-2.02-2.el5.1.i386.rpm

After you install all of the dependencies you can try to rebuild the openvpn rpm.
rpmbuild -tb openvpn-2.0.9.tar.gz

After building it you’ll find it in the following directory
/usr/src/redhat/RPMS/i386/openvpn-2.0.9-1.i386.rpm

Now try to install it. It should run successfully.
rpm -ivh /usr/src/redhat/RPMS/i386/openvpn-2.0.9-1.i386.rpm

Thats it.

This was installed on a 32bit system so if you do install it on a 64-bit machine please make sure to download all of the correct rpms and tarballs.