Thursday, November 11, 2010

CoovaChilli on Centos 5.5

Im installing CoovaChilli on Centos 5.5

the setup is we have an existing coovachilli that has been setup on ubuntu and authentication is already feed to freeradius and mysql as db backend.

Process:

1. Setup Centos to be able to compile to rpm, need to install rpm-build ang other pre-requisites.
2. Download coovachilli source, the one that has spec file as of this writing is coova 1.2.2, copy the spec file -- attached below:

#spec file

%define _unpackaged_files_terminate_build 0
%define _missing_doc_files_terminate_build 0
Summary: Coova-Chilli is a Wireless LAN Access Point Controller
Name: coova-chilli
Version: 1.2.4
Release: 1
URL: http://www.coova.org/
Source0: %{name}-%{version}.tar.gz
License: GPL
Group: System Environment/Daemons
BuildRoot: %{_tmppath}/%{name}-root

%description

Coova-Chilli is a fork of the ChilliSpot project - an open source captive
portal or wireless LAN access point controller. It supports web based login
(Universal Access Method, or UAM), standard for public HotSpots, and it
supports Wireless Protected Access (WPA), the standard for secure roamable
networks. Authentication, Authorization and Accounting (AAA) is handled by
your favorite radius server. Read more at http://www.coova.org/.

%prep
%setup

%build

%configure --enable-miniportal --enable-chilliredir --enable-chilliproxy --with-openssl

make

%install
make install DESTDIR=$RPM_BUILD_ROOT

rm -rf $RPM_BUILD_ROOT/usr/include/*
rm -rf $RPM_BUILD_ROOT/usr/lib/*.la
rm -rf $RPM_BUILD_ROOT/usr/lib/*.a

%clean
rm -rf $RPM_BUILD_ROOT
make clean

%post
/sbin/chkconfig --add chilli

%preun
if [ $1 = 0 ]; then
/sbin/service chilli stop > /dev/null 2>&1
/sbin/chkconfig --del chilli
fi

%files
%defattr(-,root,root)
%{_sbindir}/*
%{_libdir}/*.so*
%{_libdir}/python/CoovaChilliLib.py
%{_sysconfdir}/init.d/chilli
%doc AUTHORS COPYING ChangeLog INSTALL README doc/dictionary.chillispot doc/hotspotlogin.cgi
%config %{_sysconfdir}/chilli.conf
%config %{_sysconfdir}/chilli/gui-config-default.ini
%config(noreplace) %{_sysconfdir}/chilli/defaults
%dir %{_sysconfdir}/chilli
%dir %{_sysconfdir}/chilli/www
%attr(755,root,root)%{_sysconfdir}/chilli/www/config.sh
%{_sysconfdir}/chilli/www/*
%{_sysconfdir}/chilli/wwwsh
%{_sysconfdir}/chilli/functions
%{_sysconfdir}/chilli/*.sh
%{_mandir}/man1/*.1*
%{_mandir}/man5/*.5*
%{_mandir}/man8/*.8*

%changelog
* Sat Jan 2 2010
- 1.2.0 release
* Thu Sep 30 2007
- 1.0.8 release
* Thu Aug 20 2007
- 1.0-coova.7 release
* Thu Jun 7 2007
- 1.0-coova.6 release
* Wed May 16 2007
- 1.0-coova.5 release
* Wed Feb 07 2007
- 1.0-coova.4 release
* Wed Nov 15 2006
- 1.0-coova.3 release
* Thu Mar 25 2004
- Initial release.


The first 2 line above has just been added, because there are error when compiling the ver 1.2.4.

Download 1.2.4 from this link:

wget http://ap.coova.org/chilli/coova-chilli-1.2.4.tar.gz


recompile using rpmbuild.

1. copy first the souce to /usr/src/redhat/SOURCES
2. rpmbuild -bb coova.spec

once finished, install the compiles rpm file

hereÅ› my default config
/etc/chilli.conf


#
# Chilli Configuration
#
# To configure chilli, see /etc/chilli/default
# and then create your own /etc/chilli/config
# start / stop chilli with /chilli
#
# For help with coova-chilli,
# visit http://coova.org/wiki/index.php/CoovaChilli
#
# This file can either contain all your chilli configurations, or include
# other files, as shown per default below. The idea here is that main.conf
# contains your main configurations, hs.conf is for your configurations
# delivered by RADIUS (using the Administrative-User login), and local.conf
# is for any other settings you might configure by hand for this particular
# installation.

include /etc/chilli/main.conf
include /etc/chilli/hs.conf
include /etc/chilli/local.conf

ipup=/etc/chilli/up.sh
ipdown=/etc/chilli/down.sh


and
/etc/chilli/defaults

HS_WANIF=eth0 # WAN Interface toward the Internet
HS_LANIF=eth1 # Subscriber Interface for client devices
HS_NETWORK=192.168.182.0 # HotSpot Network (must include HS_UAMLISTEN)
HS_NETWORK=192.168.182.1
HS_NETMASK=255.255.255.0 # HotSpot Network Netmask
HS_UAMLISTEN=192.168.182.1 # HotSpot IP Address (on subscriber network)
HS_UAMPORT=3990 # HotSpot UAM Port (on subscriber network)
HS_UAMUIPORT=4990 # HotSpot UAM "UI" Port (on subscriber network, for embedded portal)
HS_DNS1=10.10.1.100
HS_DNS2=10.10.1.160
HS_NASID=nas01
HS_RADIUS2=127.0.0.1
HS_RADIUS=10.101.1.231
HS_UAMALLOW=https://192.168.182.1/cgi-bin/hotspotlogin.cgi
HS_RADSECRET=easyhotspot # Set to be your RADIUS shared secret
HS_UAMSECRET=easyhotspot # Set to be your UAM secret
HS_UAMALIASNAME=chilli
HS_UAMSERVER=$HS_UAMLISTEN
HS_UAMFORMAT=http://\$HS_UAMLISTEN:\$HS_UAMUIPORT/www/login.chi
HS_UAMHOMEPAGE=http://\$HS_UAMLISTEN:\$HS_UAMPORT/www/coova.html
HS_UAMSERVICE=https://192.168.182.1/cgi-bin/hotspotlogin.cgi
HS_RADCONF_SERVER=10.101.1.231 # RADIUS Server
HS_RADCONF_SECRET=easyhotspot # RADIUS Shared Secret
#this should also be coincide on
#the remote radius server
HS_RADCONF_AUTHPORT=1812 # Auth port
HS_TCP_PORTS="80 443"
HS_MODE=hotspot
HS_TYPE=chillispot
HS_RADAUTH=1812
HS_RADACCT=1813
HS_WWWDIR=/etc/chilli/www
HS_WWWBIN=/etc/chilli/wwwsh
HS_PROVIDER=MYCOMPANY
HS_PROVIDER_LINK=http://www.mycompany.com
HS_LOC_NAME="CONCENTRIX HOTSPOT" # WISPr Location Name and used in portal


Edit up.sh - source: https://help.ubuntu.com/community/WifiDocs/CoovaChilli


# may not have been populated the first time; run again
[ -e "/var/run/chilli.iptables" ] && sh /var/run/chilli.iptables 2>/dev/null
# force-add the final rule necessary to fix routing tables
iptables -I POSTROUTING -t nat -o $HS_WANIF -j MASQUERADE



Install httpd server

Copy /usr/share/doc/coova-chilli-1.2.4/hotspotlogin.cgi to /var/www/cgi-bin

mv /usr/share/doc/coova-chilli-1.2.4/hotspotlogin.cgi /var/www/cgi-bin


edit


/var/www/cgi-bin/hotspotlogin.cgi


look for $uamsecret and set it to coincide with HS_UAMSECRET=easyhotspot set at /etc/chilli/defaults

$uamsecret = "easyhotspot";


-
starting chilli

/etc/init.d.chilli start

to be cont...