Apache mit FreeRADIUS Modul ausstatten

Alles, was den Apache betrifft, kann hier besprochen werden.

Apache mit FreeRADIUS Modul ausstatten

Postby mnees » 17. August 2008 10:30

Hallo,

Ich möchte unter OpenSuse 10.3 den Apache2 mit dem freeradius Modul ausstatten. Damit ich meine Web-Seiten mit einer RADIUS Authentifizierung absichern kann.

Ich nutze unter SUSE natürlich das vorgefertigte Paket (aus der Software-Verwaltung), und habe deshalb nicht die Möglichkeit das freeradius Paket wie bei freeradius.org beschrieben nach zu kompilieren.

Auch die dynamische Einbindung per apxs hat ausser einer Fehlermeldung leider nicht funktioniert.

Wie kann ich das Modul einbinden? Für einen Hinweis bin ich sehr dankbar.
mnees
 
Posts: 10
Joined: 05. May 2008 11:31

Postby glitzi85 » 17. August 2008 21:29

Hallo,

wenn du eine fertige Apache-Installation nachrüsten willst, bleibt keine andere Möglichkeit als APXS. Welche Fehlermeldung kam also, als du
Code: Select all
apxs -i -a -c mod_auth_radius.c
ausgeführt hast?

mfg glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby mnees » 18. August 2008 07:40

linux0815:~ # /usr/sbin/apxs2 -i -a -c /root/freeradius/mod_auth_radius-2.0.c
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -g -fPIC -Wall -fno-strict-aliasing -DLDAP_DEPRECATED -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DAP_DEBUG -pthread -I/usr/include/apache2 -I/usr/include/apr-1 -I/usr/include/apr-1 -c -o /root/freeradius/mod_auth_radius-2.0.lo /root/freeradius/mod_auth_radius-2.0.c && touch /root/freeradius/mod_auth_radius-2.0.slo
/root/freeradius/mod_auth_radius-2.0.c:291:25: error: openssl/md5.h: No such file or directory
/root/freeradius/mod_auth_radius-2.0.c: In function 'get_random_vector':
/root/freeradius/mod_auth_radius-2.0.c:426: warning: implicit declaration of function 'getpid'
/root/freeradius/mod_auth_radius-2.0.c: In function 'add_auth_radius':
/root/freeradius/mod_auth_radius-2.0.c:475: warning: passing argument 1 of 'ap_strchr' discards qualifiers from pointer target type
/root/freeradius/mod_auth_radius-2.0.c:488: warning: pointer targets in assignment differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:489: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:491: warning: passing argument 1 of 'ap_strchr' discards qualifiers from pointer target type
/root/freeradius/mod_auth_radius-2.0.c: At top level:
/root/freeradius/mod_auth_radius-2.0.c:560: warning: initialization from incompatible pointer type
/root/freeradius/mod_auth_radius-2.0.c: In function 'make_cookie':
/root/freeradius/mod_auth_radius-2.0.c:680: warning: format '%08x' expects type 'unsigned int', but argument 9 has type 'time_t'
/root/freeradius/mod_auth_radius-2.0.c:694: warning: pointer targets in passing argument 2 of 'ap_md5' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:697: warning: pointer targets in passing argument 2 of 'ap_md5' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:697: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'time_t'
/root/freeradius/mod_auth_radius-2.0.c:700: warning: pointer targets in passing argument 2 of 'ap_md5' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:700: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'time_t'
/root/freeradius/mod_auth_radius-2.0.c: In function 'add_cookie':
/root/freeradius/mod_auth_radius-2.0.c:737: warning: passing argument 4 of 'strftime' makes pointer from integer without a cast
/root/freeradius/mod_auth_radius-2.0.c:738: warning: implicit declaration of function 'ap_snprintf'
/root/freeradius/mod_auth_radius-2.0.c: In function 'spot_cookie':
/root/freeradius/mod_auth_radius-2.0.c:756: warning: passing argument 1 of 'ap_strstr' discards qualifiers from pointer target type
/root/freeradius/mod_auth_radius-2.0.c: In function 'radius_authenticate':
/root/freeradius/mod_auth_radius-2.0.c:832: warning: pointer targets in passing argument 3 of 'add_attribute' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:862: warning: pointer targets in passing argument 3 of 'add_attribute' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:884: warning: pointer targets in passing argument 3 of 'add_attribute' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:898: warning: implicit declaration of function 'inet_ntoa'
/root/freeradius/mod_auth_radius-2.0.c:898: warning: format '%s' expects type 'char *', but argument 7 has type 'int'
/root/freeradius/mod_auth_radius-2.0.c:941: warning: format '%s' expects type 'char *', but argument 7 has type 'int'
/root/freeradius/mod_auth_radius-2.0.c:947: warning: pointer targets in passing argument 6 of 'recvfrom' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c: In function 'check_pw':
/root/freeradius/mod_auth_radius-2.0.c:1030: warning: implicit declaration of function 'close'
/root/freeradius/mod_auth_radius-2.0.c:1035: warning: pointer targets in passing argument 5 of 'radius_authenticate' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c: In function 'authenticate_basic_user':
/root/freeradius/mod_auth_radius-2.0.c:1150: warning: unused variable 'c'
/root/freeradius/mod_auth_radius-2.0.c: In function 'register_hooks':
/root/freeradius/mod_auth_radius-2.0.c:1249: warning: implicit declaration of function 'ap_hook_check_user_id'
apxs:Error: Command failed with rc=65536
.
linux0815:~ #
mnees
 
Posts: 10
Joined: 05. May 2008 11:31

Postby glitzi85 » 18. August 2008 12:37

Ist denn OpenSSL installiert? Und welche configure-Optionen hast du freeRadius mitgegeben?

mfg glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby deepsurfer » 18. August 2008 13:01

chirio Deep
Wie sagte einst der MCP aus Tron auf dem Bildschirm zu schreiben Pflegte
" ... end of communication ... "
User avatar
deepsurfer
AF Moderator
 
Posts: 6440
Joined: 23. November 2004 10:44
Location: Cologne
Operating System: Win-XP / Win7 / Linux -Debian

Postby mnees » 18. August 2008 13:43

openssl ist installiert (ltd. OpenSUSE Software Management) - es seid denn es werden auch die Development Tools benötigt - ich installiere diese mal nach.

ich habe freeradius keine configure optionen mitgegeben. das Suse freeradius (server) - Paket habe ich nicht installiert. was ist mit der 2ten Frage gemeint ?
mnees
 
Posts: 10
Joined: 05. May 2008 11:31

Postby glitzi85 » 18. August 2008 13:51

Ja, die dev-Pakete sollten auch installiert sein.

Die zweite Frage kannst vergessen, hab grad gemerkt dass das Modul ja aus den Sourcen geapxst wird.

mfg glitzi
User avatar
glitzi85
 
Posts: 1920
Joined: 05. March 2004 23:26
Location: Dahoim

Postby mnees » 19. August 2008 08:23

Nach der Installation der Openssl-Development und TLS sieht es besser aus.
dynamisches Einbindung des neuen RADIUS Moduls scheint gelungen zu sein. Aber apache kann beim Starten das RADIUS Modul nicht laden.

Fehlermeldung siehe unten. Hat jemand noch ne Idee ??

linux0815:~ # /usr/sbin/apxs2 -i -a -c /root/freeradius/mod_auth_radius-2.0.c
/usr/lib/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -march=i586 -mtune=i686 -fmessage-length=0 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -g -fPIC -Wall -fno-strict-aliasing -DLDAP_DEPRECATED -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -DAP_DEBUG -pthread -I/usr/include/apache2 -I/usr/include/apr-1 -I/usr/include/apr-1 -c -o /root/freeradius/mod_auth_radius-2.0.lo /root/freeradius/mod_auth_radius-2.0.c && touch /root/freeradius/mod_auth_radius-2.0.slo
/root/freeradius/mod_auth_radius-2.0.c: In function 'get_random_vector':
/root/freeradius/mod_auth_radius-2.0.c:426: warning: implicit declaration of function 'getpid'
/root/freeradius/mod_auth_radius-2.0.c: In function 'add_auth_radius':
/root/freeradius/mod_auth_radius-2.0.c:475: warning: passing argument 1 of 'ap_strchr' discards qualifiers from pointer target type
/root/freeradius/mod_auth_radius-2.0.c:488: warning: pointer targets in assignment differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:489: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:491: warning: passing argument 1 of 'ap_strchr' discards qualifiers from pointer target type
/root/freeradius/mod_auth_radius-2.0.c: At top level:
/root/freeradius/mod_auth_radius-2.0.c:560: warning: initialization from incompatible pointer type
/root/freeradius/mod_auth_radius-2.0.c: In function 'make_cookie':
/root/freeradius/mod_auth_radius-2.0.c:680: warning: format '%08x' expects type 'unsigned int', but argument 9 has type 'time_t'
/root/freeradius/mod_auth_radius-2.0.c:694: warning: pointer targets in passing argument 2 of 'ap_md5' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:697: warning: pointer targets in passing argument 2 of 'ap_md5' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:697: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'time_t'
/root/freeradius/mod_auth_radius-2.0.c:700: warning: pointer targets in passing argument 2 of 'ap_md5' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:700: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'time_t'
/root/freeradius/mod_auth_radius-2.0.c: In function 'add_cookie':
/root/freeradius/mod_auth_radius-2.0.c:737: warning: passing argument 4 of 'strftime' makes pointer from integer without a cast
/root/freeradius/mod_auth_radius-2.0.c:738: warning: implicit declaration of function 'ap_snprintf'
/root/freeradius/mod_auth_radius-2.0.c: In function 'spot_cookie':
/root/freeradius/mod_auth_radius-2.0.c:756: warning: passing argument 1 of 'ap_strstr' discards qualifiers from pointer target type
/root/freeradius/mod_auth_radius-2.0.c: In function 'radius_authenticate':
/root/freeradius/mod_auth_radius-2.0.c:832: warning: pointer targets in passing argument 3 of 'add_attribute' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:862: warning: pointer targets in passing argument 3 of 'add_attribute' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:884: warning: pointer targets in passing argument 3 of 'add_attribute' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c:898: warning: implicit declaration of function 'inet_ntoa'
/root/freeradius/mod_auth_radius-2.0.c:898: warning: format '%s' expects type 'char *', but argument 7 has type 'int'
/root/freeradius/mod_auth_radius-2.0.c:941: warning: format '%s' expects type 'char *', but argument 7 has type 'int'
/root/freeradius/mod_auth_radius-2.0.c:947: warning: pointer targets in passing argument 6 of 'recvfrom' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c: In function 'check_pw':
/root/freeradius/mod_auth_radius-2.0.c:1030: warning: implicit declaration of function 'close'
/root/freeradius/mod_auth_radius-2.0.c:1035: warning: pointer targets in passing argument 5 of 'radius_authenticate' differ in signedness
/root/freeradius/mod_auth_radius-2.0.c: In function 'authenticate_basic_user':
/root/freeradius/mod_auth_radius-2.0.c:1150: warning: unused variable 'c'
/root/freeradius/mod_auth_radius-2.0.c: In function 'register_hooks':
/root/freeradius/mod_auth_radius-2.0.c:1249: warning: implicit declaration of function 'ap_hook_check_user_id'
/root/freeradius/mod_auth_radius-2.0.c: In function 'check_pw':
/root/freeradius/mod_auth_radius-2.0.c:931: warning: 'rcode' is used uninitialized in this function
/root/freeradius/mod_auth_radius-2.0.c:794: note: 'rcode' was declared here
/usr/lib/apr-1/build/libtool --silent --mode=link gcc -o /root/freeradius/mod_auth_radius-2.0.la -rpath /usr/lib/apache2 -module -avoid-version /root/freeradius/mod_auth_radius-2.0.lo
/usr/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/lib/apr-1/build/libtool' /root/freeradius/mod_auth_radius-2.0.la /usr/lib/apache2
/usr/lib/apr-1/build/libtool --mode=install cp /root/freeradius/mod_auth_radius-2.0.la /usr/lib/apache2/
cp /root/freeradius/.libs/mod_auth_radius-2.0.so /usr/lib/apache2/mod_auth_radius-2.0.so
cp /root/freeradius/.libs/mod_auth_radius-2.0.lai /usr/lib/apache2/mod_auth_radius-2.0.la
cp /root/freeradius/.libs/mod_auth_radius-2.0.a /usr/lib/apache2/mod_auth_radius-2.0.a
ranlib /usr/lib/apache2/mod_auth_radius-2.0.a
chmod 644 /usr/lib/apache2/mod_auth_radius-2.0.a
PATH="$PATH:/sbin" ldconfig -n /usr/lib/apache2
----------------------------------------------------------------------
Libraries have been installed in:
/usr/lib/apache2

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/lib/apache2/mod_auth_radius-2.0.so
activating radius_auth
linux0815:~ # /etc/init.d/apache2 start
Module "radius_auth" is not installed, ignoring.
Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
Starting httpd2 (prefork) httpd2-prefork: Syntax error on line 219 of /etc/apache2/httpd.conf: Cannot load /usr/lib/apache2/mod_auth_radius-2.0.so into server: /usr/lib/apache2/mod_auth_radius-2.0.so: undefined symbol: ap_snprintf

The command line was:
/usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
failed

--> Zeile 219 ist der Zeile:
LoadModule radius_auth /usr/lib/apache2/mod_auth_radius-2.0.so

linux0815:~ # /usr/sbin/httpd2-prefork -l
Compiled in modules:
core.c
prefork.c
http_core.c
mod_so.c
linux0815:~ #
mnees
 
Posts: 10
Joined: 05. May 2008 11:31

Postby DJ DHG » 19. August 2008 09:09

Moin Moin!

Der Parameter "-l" ist falsch. Der listet nur die fest einkompilierten Module.
Versuche es mit "-t -D DUMP_MODULES"

mfg D DHG
User avatar
DJ DHG
AF Moderator
 
Posts: 2455
Joined: 27. December 2002 13:50
Location: Kiel

Postby mnees » 19. August 2008 15:19

Das dynamische Linken endet immer mit dem bekannten fehler
/usr/lib/apache2/mod_auth_radius-2.0.so: undefined symbol: ap_snprintf

Hatte die faxen dicke und hab Apache 2.2 und Apache 2.0 selbst kompiliert und wollte nach Anleitung von FreeRadius das paket einbinden. Geht auch nicht !!!!

Hab das ganze jetzt mit mod_auth_xradius zum Laufen bekommen. http://www.outoforder.cc/projects/apach ... h_xradius/

Falls es jemand interessiert - kompilieren ist gar nicht so schwer:

Pakete zusätzlich zu OpenSuSE 10.3:
gcc
make
openssl
openssl-development (Name kann abweichen)
tls
libtool
autoconf
vim
Download von www.apache.org httpd-2.0.63.tar.gz

gzip -d httpd-2.0.63.tar.gz
tar -xvf httpd-2.0.63.tar

cd httpd-2.0.63/

./configure --prefix=/usr/local/apache2 \
--enable-proxy \
--enable-rewrite \
--enable-ssl \
--enable-so

make
make install
mnees
 
Posts: 10
Joined: 05. May 2008 11:31


Return to Apache

Who is online

Users browsing this forum: No registered users and 2 guests