LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-18-2011, 09:28 AM   #1
pixelgrunt
LQ Newbie
 
Registered: Feb 2011
Posts: 5

Rep: Reputation: 0
undefined symbol: mysql_select_db when reloading httpd with mod_auth_mysql.so INCLUDE


Greetings all,

I've been a lurker here for a long time, and this is my first post. Please be gentle.

I searched for solutions here on LQ.org and other resources online, but nothing so far has helped. The Slackware forum seems to be the most appropriate place for this question, but I'm willing to move it if needed.

I have Slackware r13.0 32 bit installed, and I'm interested in getting SNORT installed with Barnyard and BASE to learn about IDS using my own home network. I'm following a guide found here:

http://dentonj.freeshell.org/slackware-snort-0.2.txt

I'm having trouble getting past the "create the BASE tables" section. Everything up to that point seems to have been functioning properly. When I attempt to login with my username/password, I get rejected.

The httpd error log reports the following:

[DATE] [error] [client] user snort not found: /frontend

I can manually get into the mysql database with this username/password combination. I've been working on this on and off again for the past few days, and I forgot what led me to the mod_auth_mysql.so module, but I remember reading some posts elsewhere that pointed to this module. I found the source, and used apxs to compile and install it. However, when I insert the "LoadModule mysql_auth_module modules/mod_auth_mysql.so" line into the httpd.conf file, I can't restart the httpd service, and I'm given this error:

httpd: Syntax error on line 117 of /etc/httpd/httpd.conf: Cannot load /usr/modules/mod_auth_mysql.so into server: /usr/modules/mod_auth_mysql.so: undefined symbol: mysql_select_db

It seems that the frontend URL on my server is attempting to use php to authenticate to the mysql database. Am I on the right track here?

I've seen other posts with similar problems, but they recommend re-installing either mysql or php from the slackware site, but the Slackware package browser site (http://packages.slackware.it/) is down until a new one is written from scratch. Is there someplace else I can look for these packages if this is what is needed?
 
Old 02-19-2011, 08:37 PM   #2
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Quote:
Originally Posted by pixelgrunt View Post
However, when I insert the "LoadModule mysql_auth_module modules/mod_auth_mysql.so" line into the httpd.conf file, I can't restart the httpd service, and I'm given this error:

httpd: Syntax error on line 117 of /etc/httpd/httpd.conf: Cannot load /usr/modules/mod_auth_mysql.so into server: /usr/modules/mod_auth_mysql.so: undefined symbol: mysql_select_db
Your LoadModule line is wrong. Correct syntax is:
Code:
LoadModule $modulename $relative_path_to_module_from_server_root
In other words, you probably want this:
Code:
LoadModule mysql_auth_module lib/httpd/modules/mod_auth_mysql.so
assuming this is present in /etc/httpd/httpd.conf:
Code:
ServerRoot "/usr"
 
Old 02-20-2011, 09:08 PM   #3
pixelgrunt
LQ Newbie
 
Registered: Feb 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the help rworkman, I appreciate the catch on the LoadModule line in httpd.conf. Sometimes it takes a second set of eyes to catch the [relatively] obvious stuff.

Alas, I made the change to:

Code:
LoadModule mysql_auth_module lib/httpd/modules/mod_auth_mysql.so
and it still fails with the same error when I try to restart httpd.

The .so file is in that directory, and has the same permissions as the other shared objects in the directory:

Code:
root@sintra:/usr/lib/httpd/modules# ls -al mod_auth_mysql.so
-rwxr-xr-x 1 root root 25066 2011-02-17 15:25 mod_auth_mysql.so
It's still hanging up on the mysql_select_db symbol:

Code:
httpd: Syntax error on line 118 of /etc/httpd/httpd.conf: Cannot load /usr/lib/httpd/modules/mod_auth_mysql.so into server: /usr/lib/httpd/modules/mod_auth_mysql.so: undefined symbol: mysql_select_db
 
Old 02-22-2011, 10:46 PM   #4
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
You used apxs to build it? I don't see how it would have built without the linked libraries being loadable. Have you done anything else to the system since building that module?
 
Old 02-23-2011, 09:29 AM   #5
pixelgrunt
LQ Newbie
 
Registered: Feb 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rworkman View Post
You used apxs to build it?
Aye. Here is the apxs command that I used (as pulled from my history):

Code:
apxs -c -lmysqlclient -I/usr/include/mysql -L/usr/lib/mysql -lm -lz mod_auth_mysql.c
I don't understand it either.

Quote:
Originally Posted by rworkman View Post
Have you done anything else to the system since building that module?
Looking over my history again, I see that I applied a mod_auth_mysql patch as described in this thread:

http://www.linuxquestions.org/questi...hlinux-841977/

The problem looked similar enough, and I had been banging my head against the wall long enough that I was willing to try almost anything. It didn't work before that patch, and it doesn't work since.

The only way I can get httpd to restart is by commenting out this [newly fixed] line:

Code:
LoadModule mysql_auth_module lib/httpd/modules/mod_auth_mysql.so
Of course, then I get the expected authentication issues when attempting to load the BASE web front end.

Did I booger it up badly? I really appreciate your help.
 
Old 02-23-2011, 11:19 PM   #6
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
The patch is necessary to build the module, so that's not the problem. I just built it here, and it loads fine.
The missing symbol is provided by libmysqlclient.so

Show me the output of this:

Code:
ldd /usr/lib/httpd/modules/mod_auth_mysql.so
 
Old 02-26-2011, 07:49 PM   #7
pixelgrunt
LQ Newbie
 
Registered: Feb 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rworkman View Post
Show me the output of this:
Code:
ldd /usr/lib/httpd/modules/mod_auth_mysql.so
Gladly:

Code:
root@sintra:~# ldd /usr/lib/httpd/modules/mod_auth_mysql.so
	linux-gate.so.1 =>  (0xffffe000)
	libm.so.6 => /lib/libm.so.6 (0xb7f48000)
	libz.so.1 => /usr/lib/libz.so.1 (0xb7f34000)
	libc.so.6 => /lib/libc.so.6 (0xb7dd4000)
	/lib/ld-linux.so.2 (0xb7f97000)
The output for the linux-gate.so.1 initially grabbed my attention, but a quick Google search taught me something new about that result in ldd output.

I'm still at a loss, and I still appreciate your help with this.
 
Old 02-26-2011, 10:55 PM   #8
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 2,559

Rep: Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351Reputation: 1351
Quote:
Originally Posted by pixelgrunt View Post
Gladly:

Code:
root@sintra:~# ldd /usr/lib/httpd/modules/mod_auth_mysql.so
	linux-gate.so.1 =>  (0xffffe000)
	libm.so.6 => /lib/libm.so.6 (0xb7f48000)
	libz.so.1 => /usr/lib/libz.so.1 (0xb7f34000)
	libc.so.6 => /lib/libc.so.6 (0xb7dd4000)
	/lib/ld-linux.so.2 (0xb7f97000)
The output for the linux-gate.so.1 initially grabbed my attention, but a quick Google search taught me something new about that result in ldd output.

I'm still at a loss, and I still appreciate your help with this.
Ohh. It isn't linked with the mysql libraries. I don't know *why* - the apxs command you gave *should* have linked it, but something went wrong somehow. Start over: rebuild the apache module and copy the new one into place.
 
Old 02-27-2011, 05:14 AM   #9
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Try moving the -L before the -lmysqlclient

apxs -c -L/usr/lib/mysql -lmysqlclient -I/usr/include/mysql -lm -lz mod_auth_mysql.c
 
Old 02-27-2011, 07:29 PM   #10
pixelgrunt
LQ Newbie
 
Registered: Feb 2011
Posts: 5

Original Poster
Rep: Reputation: 0
Hooray! One level of the onion has been peeled. Now I can restart httpd successfully at least. Thanks a tonrworkman and GazL for your help. It's helpful folks like you that attracted me to Linux in the first place.

If you don't mind, could you take a moment to explain what led you to interpret the ldd output the way you did? It looked acceptable to me, what gave it away that it wasn't linked to the mysql libraries?

Thanks again. Now I'm greeted with the error:

Code:
ADONewConnection: Unable to load database driver ''
But I'll beat my head against that for a while before bugging you all again. I'll create a new thread if:

a) I con't figure it out on my own
and
b) I can't find a thread somewhere else that points to a solution.
 
Old 02-02-2012, 03:49 AM   #11
hakansukur
LQ Newbie
 
Registered: Jul 2011
Location: Hungary
Posts: 9

Rep: Reputation: Disabled
lmysqclient

Hello

(sorry my english)

I had same problem.

When I first run apxs command:

apxs -cia -L/usr/lib/libmysqlclient.so.15 -I/usr/local/mysql-5.1.54-linux-x86_64/include/ -lz -lm mod_auth_mysql.c

the result library file didn't contain (ldd mod_auth_mysql.so) libmyslclient, and the httpd didn't start (syntax error...etc.)

I must used -lmysqlclient in apxs command. The problem was that libmysqlclient.so was not in /usr/lib, instead of it,there were libmysqlclient.so.15, etc, so I created a symbolic link:

ln -s /usr/lib/libmysqlclient.so.15 /usr/lib/libmysqlclient.so

And after this, I rerun apxs command:

apxs -cia -I/usr/local/mysql-5.1.54-linux-x86_64/include/ -lm -lz -lmysqlclient mod_auth_mysql.c

After this, libmysqlclient was in mod_auth_mysql.so, and httpd was restarted successfully.

Last edited by hakansukur; 02-02-2012 at 03:50 AM.
 
  


Reply



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
/usr/sbin/httpd: symbol lookup error: /usr/sbin/httpd: undefined symbol: apr_atomic_x dasoberdick Slackware 16 10-11-2014 02:36 AM
symbol lookup error: /usr/lib/libavcodec.so.51: undefined symbol: av_crc04C11DB7 priceey Linux - Software 0 05-06-2009 08:14 AM
./firefox-bin :symbol lookup error:/lib/libgthread-2.0.so.0: undefined symbol: arulupsaras Linux - General 1 11-08-2008 04:48 AM
symbol lookup error: /usr/lib/libgtk-x11.2.0.so.0: undefined symbol:... IamI Slackware 17 02-29-2008 11:10 AM
Workaround: 'symbol lookup error: k3b: undefined symbol: lstat64' devdol Linux - Software 2 02-15-2008 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:59 PM.

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