Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Mysql 3.23.53a to work with Apache 2.0.44

Status
Not open for further replies.

wieglenda

IS-IT--Management
Feb 8, 2003
30
US
Hey all, I'm trying to compile the mod_auth_mysql.c module into apache 2.0.44, but I keep running into build errors. Things like "can't find mysql.h" errors even though I point to the file on install, and various other build problems. I have a version of mod_auth_mysql that was created on Dec 22, 2002 and I'm also worried that this version will not work with the latest apache build. Does anyone know how to get apache to work with mysql? Can I recompile apache to include it?

Thanks, Thomas
 
most ppeople generally compile apache with php, and then compile php with mysql support and use it that way.
 
How do you compile the module? Do you do it manually or with a [tt]configure && make[/tt] sort of commands? Where did you install MySQL? Which OS are you working on? //Daniel
 
php would be compilied like this:


./configure --with-apxs=/path/to/bin/apxs --prefix=/path/to/php --with-mysql=/path/to/mysql
 
Well, I understand that you compile php with apache and mysql, and I've done that already. I wanted to be able to have a username/password script in mysql available for apache to query. I don't think that php and apache connect like that... If you compile mod_auth_mysql into apache, you can have apache query myql databases for .htaccess folders.

Thomas
 
"How do you compile the module?"

I don't know if you mean, "How DID you try to compile the module" or "How can I compile the module"

"Do you do it manually or with a configure && make sort of commands?"

What exactly does this statement mean? The only way to compile the module in question is manually (that I know of)

"Where did you install MySQL?"

/usr/bin

"Which OS are you using?"

Linux 2.2.18 (last version)
 
And when you are compiling the module, are you supplying [tt]gcc[/tt] the right arguments? //Daniel
 
Ok, when I ran the compile on the module, I did supply it with the correct path to the mysql.h file and the other mysql files that are associated with the module compilation. I don't remember exactly I typed, but it was something like this

/../apache2/bin/apxs -c -i -a -I/../location of mysql -L /../location of mysql.h file -lmysqlclient mod_auth.mysql.c

I'm not positive if that is exactly what I typed, but it's pretty close.

Thomas
 
as I said in the first post: can't find mysql.h error

And no matter were I told apxs to look for mysql.h, it wouldn't find it.

I actually went and modified the mod_auth_mysql.c file so that it would point to the correct location, but it still through out different errors, but they were different... I can't say what they were right now, I'd have to run the apxs compile again.
 
you can't compile it without the apxs utility, it is a .c file and needs to be compiled IN apache so apache can use the .so module.
 
Umm... No. The apxs script simply calls [tt]gcc[/tt] with some additional switches. I never compile my modules with the apxs script. //Daniel
 
So how would I compile without using the apxs script? What would I type?
 
These are the commands I use:
[tt]gcc -fpic -DSHARED_MODULE -I/path/to/apache/include -c mod_auth_mysql.c
ld -Bshareable -o mod_auth_mysql.so mod_auth_mysql.o[/tt] //Daniel
 
What is that path to apache referencing to? The mysql.h file? Or should that be, /path/to/mysql/mysql.h and also, do I need to have a reference to the mysql libs?

Thomas
 
Sounds like you need the mysql header ("includes") installed. On my system (Mandrake), it's in /usr/include/mysql. So you'd add to your gcc flags:
Code:
-I/usr/lib/mysql
Seems most distro package the libs and headers seperately. For instance, on my Mandrake box, I have the following packages available:
libmysql10
libmysql10-devel

Naming conventions may be different for your distro, but the principle is the same.
--
JR
 
The path to Apache is referencing to whatever you supplied as your prefix when configuring Apache, the default being [tt]/usr/local/apache[/tt]. You should try adding the [tt]-I/path/to/mysql/include/mysql[/tt] switch to the [tt]gcc[/tt] command as well. //Daniel
 
Oh, and yes, you do need to include [tt]-lmysqlclient[/tt] in the [tt]gcc[/tt] line. //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top