Apache 2.2.3 Session tracking with mod_session produces load error on module load
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Apache 2.2.3 Session tracking with mod_session produces load error on module load
We are using Apache server 2.2.3 at work as our web server. Currently I am tasked to track metrics for our website's content access. I am able to gather some information (client's ip, request type, uri, etc.) from the request_rec structure. I also need to correlate "clicks" on the web site with their specific users.
For this, I am trying to use the mod_session module to track sessions for each user. Since mod_session is built into Apache for versions 2.3 or later, in order for me to use it on our Apache 2.2.3 server, I tried to build it from source. I use a build machine where I compile the source and then deploy the resulting ".so" file into the Apache server and change the httpd.conf file (adding LoadModule directive) to load the module, and then restart the Apache server to deploy the new module.
I've made it work for my own custom modules, but when I try to do this process for loading the mod_session module, I'm getting the following error:
error: httpd: Syntax error on line 217 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib64/httpd/modules/mod_session.so into server: /usr/lib64/httpd/modules/mod_session.so: undefined symbol: session_module.
I see that mod_session.c uses the variable &session_module in the first line of the function ap_session_load. Here are the relevant lines of the function: static int ap_session_load(request_rec * r, session_rec ** z)
{
This was the first reference to session_module in the file mod_session.c. This variable is defined in the header file mod_session.h as follows: extern module AP_MODULE_DECLARE_DATA session_module;
It seems to me that session_module is defined in a library or header file that is included in mod_session.h. I have noted the pertinent lines of mod_session.h below:
#ifndef MOD_SESSION_H
#define MOD_SESSION_H
/* Create a set of SESSION_DECLARE(type), SESSION_DECLARE_NONSTD(type) and
* SESSION_DECLARE_DATA with appropriate export and import tags for the platform
*/
#if !defined(WIN32)
#define SESSION_DECLARE(type) type
#define SESSION_DECLARE_NONSTD(type) type
#define SESSION_DECLARE_DATA
#elif defined(SESSION_DECLARE_STATIC)
#define SESSION_DECLARE(type) type __stdcall
#define SESSION_DECLARE_NONSTD(type) type
#define SESSION_DECLARE_DATA
#elif defined(SESSION_DECLARE_EXPORT)
#define SESSION_DECLARE(type) __declspec(dllexport) type __stdcall
#define SESSION_DECLARE_NONSTD(type) __declspec(dllexport) type
#define SESSION_DECLARE_DATA __declspec(dllexport)
#else
#define SESSION_DECLARE(type) __declspec(dllimport) type __stdcall
#define SESSION_DECLARE_NONSTD(type) __declspec(dllimport) type
#define SESSION_DECLARE_DATA __declspec(dllimport)
#endif
I don't know if there is a library that I'm supposed to link to before I load this module or what's causing this error. If you know the cause of this error, or if there is a better way to gather session information on Apache 2.2.3 please let me know.
Last edited by programlight; 10-24-2011 at 11:36 AM.
I don't think it's possible to use a module compiled against apache 2.3 libraries with apache 2.2.x.
You can use the mod_usertrack to log user activity based on cookies. Take a look here for usage.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.