Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 10-24-2011, 08:37 AM   #1
LQ Newbie
Registered: Mar 2011
Posts: 13

Rep: Reputation: 0
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/ into server: /usr/lib64/httpd/modules/ 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)

session_dir_conf *dconf = ap_get_module_config(r->per_dir_config,

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:


/* 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(type) type __stdcall
#define SESSION_DECLARE_NONSTD(type) type
#define SESSION_DECLARE(type) __declspec(dllexport) type __stdcall
#define SESSION_DECLARE_NONSTD(type) __declspec(dllexport) type
#define SESSION_DECLARE_DATA __declspec(dllexport)
#define SESSION_DECLARE(type) __declspec(dllimport) type __stdcall
#define SESSION_DECLARE_NONSTD(type) __declspec(dllimport) type
#define SESSION_DECLARE_DATA __declspec(dllimport)

#include "apr_hooks.h"
#include "apr_optional.h"
#include "apr_tables.h"
#include "apr_uuid.h"
#include "apr_pools.h"
#include "apr_time.h"

#include "httpd.h"
#include "http_config.h"
#include "ap_config.h"

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 10:36 AM.
Old 10-24-2011, 04:48 PM   #2
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,175
Blog Entries: 1

Rep: Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042

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.

1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Load Balaning sticky session issue ganesh_gore Linux - Server 0 06-22-2010 12:20 AM
Apache Module Load Error vishallagdev Linux - Server 4 02-02-2008 10:45 PM
Apache module won't load. amphion Linux - Software 1 10-19-2005 07:50 AM
Can't load php module in Apache pepino Linux - Newbie 2 10-21-2003 10:26 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration