I only have libmysqlclient.a and libmysqlclient_r.a, i'm a little unexperienced in all the terminology concerning libraries and apache modules, so i don't know the difference betwen the .so and .a files.
When i try to compile using :
apxs -c -D lmysqlclient -lm -lz -I/usr/local/mysql/include/ -L/usr/local/mysql/lib/ mod_auth_mysql.c
it halts with:
gcc -DDARWIN -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -g -Os -pipe -DHARD_SERVER_LIMIT=2048 -DEAPI -DSHARED_MODULE -I/usr/include/httpd -I/usr/local/mysql/include/ -Dlmysqlclient -c mod_auth_mysql.c
cc -bundle -undefined suppress -flat_namespace -Wl,-bind_at_load -o mod_auth_mysql.so mod_auth_mysql.o -L/usr/local/mysql/lib/ -lm -lz
[11:37][path/to/mod_auth_mysql-2.6.1] user%
Any help in getting it working?
Thank you in advance.
PD: MacOSX 10.3.5 with mysql-max-4.0.21-apple-darwin7.5.0-powerpc package installed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't have a libmysqlclient.so in my installation, either <g>.
.so modules are Apache modules which are dynamically loaded at run time (versus being compiled into the Apache code). .a modules are library modules which are linked into the code (in this case, mod_auth_mysql.so).
The problem you're having is noted in the "Compile String" thread in this forum. Basically, the -D option was incorrect in the 2.6.0 README file (it was corrected in the 2.6.1 README). You need to remove it.
Additionally, you had one other problem - you need to add a hyphen before llibmysqlclient. The full line should read:
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.
----------------------------------------------------------------------
Warning! dlname not found in /usr/local/apache2/modules/mod_auth_mysql.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/mod_auth_mysql.so
chmod: failed to get attributes of `/usr/local/apache2/modules/mod_auth_mysql.so': No such file or directory
apxs:Error: Command failed with rc=65536
.
[root@localhost mod_auth_mysql-2.6.1]# ls -sltr /usr/local/apache2/modules/
total 5439
4697 -rwxr-xr-x 1 root root 4798113 Oct 7 12:17 libphp4.so
10 -rw-r--r-- 1 root root 8440 Oct 13 22:46 httpd.exp
508 -rwxr-xr-x 1 root root 518857 Oct 13 23:32 mod_dav_svn.so
80 -rwxr-xr-x 1 root root 80792 Oct 13 23:32 mod_authz_svn.so
1 -rw-r--r-- 1 root root 783 Oct 14 13:42 mod_auth_mysql.la
84 -rw-r--r-- 1 root root 84616 Oct 14 13:42 mod_auth_mysql.a
Any help would be much appreciated.
Thanks,
Colin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmm, looks like there's a missing command from apxs.
My first step matches yours just fine (other than directories). However, in the second step I have three cp statements, where you have only two. Immediately following the libtool line, I have:
(This is in addition to the cp in the libtool line).
Unfortunately, I'm not an expert on the inner workings of apxs.
Do you have a mod_auth_mysql.so in your working directory? Also, which version of Apache are you running? And when you build Apache, did you build it with DSO support (if you built it more than once - did you do a "make clean" between the builds)?
I also don't know if there are any differences on OS X - I've never run it. Perhaps someone more familiar with that package can jump in here.
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just saw something I might have missed before. You have -I/usr/local/mysql/include/mysql. Shouldn't that be -I/usr/local/mysql/include? That's where my mysql.h is, anyway.
Please try it again, only this time add the parameter "-Wc,-Wall" (no quotes - and no spaces in the parm). This should provide more information.
Jerry
You also don't need the -I/usr/local/apache2/include.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
----------------------------------------------------------------------
Warning! dlname not found in /usr/local/apache2/modules/mod_auth_mysql.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/mod_auth_mysql.so
chmod: failed to get attributes of `/usr/local/apache2/modules/mod_auth_mysql.so': No such file or directory
apxs:Error: Command failed with rc=65536
.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I'm just not that great at the linux tools. I suspect it's something strange in your setup - perhaps an environment variable, for instance.
Hopefully someone more knowledgeable in this area can jump in and help. Otherwise, I might suggest you check out the Apache users mailing list and/or libtool mailing list on gnu.org.
Wish I could be of more help - but the module does build properly with the correct tools and settings. I just don't know enough to help any further. Sorry.
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
While the OSX users can build and install this DSO, if they use the Admin GUI and examine the modules list, they will see that something doesn't look right and this got me using gdb to figure out why all of the build/install problems were occuring.
Most people didn't install a different mysql and are unaware of the actual paths of files.
The following two commands will build the DSO assuming a stock OSX mysql installation using apache 1.3x.
For those of you using someone elses mysql binary, you'll have to change the mysql paths to correspond to your installaction.
A proper approach would be that the author uses a configure script that polls for the location of the mysql files and generate the appropriate building file based on OS and file locations which, based on using the standard configure scripts would be extremely simple since a check for mysql files is easy to do.
Let me also say, I'm not a fan of using someone elses binary of mysql (max) or php (entropy) and believe the user would be better off to build from source using the appropriate configure commands.
and you will see that I'm utilizing the default apple locations which makes installing DSO's such as this a very simple and mindless task.
The only reason I gdb'ed the DSO was that a discrepency occured in the module name that became visible while I was trying to debug it and I noticed this had a profound effect on performance.
The biggest discrepency was in mod_auth_mysql.c and mod_mysql_auth.c assignments but after correcting all of the discrepencies things seem to be working alot better and you should have access to this source once the author contacts me and makes it available to you which will alleviate a lot of the build/installation problems.
The biggest problem I'm seeing is that those who are unfamiliar with building sources are trying to build and install files without knowing what they are doing or why they are doing it.
Don't install anything unless you absolutely need it is a good rule of thumb and this is why using someone elses binaries is not a good idea, take 10 minutes and learn how to do it, there are good tutorials for many projects that can be applied to almost every project out there if you just learn to read the signs.
-- Dale
dale@daleenterprise.com
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, a configure script is nice for complex installations. However, I think it's a bit of overkille here.
To build mod_auth_mysql, you need to know three paths:
1. The path to axps
2. The path to the MySQL include files
3. The path o the MySQL libraires
You would still have to know #1 (and set it as an option). You *may* still need to know 2 and 3, depending on your installation.
Additionally, two calls to apxs (which could actually be done in a single call) builds and installs everything. People who are installing the module should be able to at least determine the paths.
Configure is nice - but it adds another layer of complication which I don't think is necessary - and would not solve some of the problems seen here.
Please note: the biggest install problem was a typo in the README file. The configure script will also not cure that problem.
Jerry
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
by use of a configure script, you could locate the include and library files, then based on the platform, issue the appropriate apx command making the installation a smoother process.
-- Dale
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As indicated in another thread - you can do this, but thre are additional potential problems. And it would not fix the typo which was in the README file.
Sorry.
Jeryr
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I only have libmysqlclient.a and libmysqlclient_r.a, i'm a little unexperienced in all the terminology concerning libraries and apache modules, so i don't know the difference betwen the .so and .a files.
When i try to compile using :
apxs -c -D lmysqlclient -lm -lz -I/usr/local/mysql/include/ -L/usr/local/mysql/lib/ mod_auth_mysql.c
it halts with:
gcc -DDARWIN -DUSE_HSREGEX -DUSE_EXPAT -I../lib/expat-lite -g -Os -pipe -DHARD_SERVER_LIMIT=2048 -DEAPI -DSHARED_MODULE -I/usr/include/httpd -I/usr/local/mysql/include/ -Dlmysqlclient -c mod_auth_mysql.c
cc -bundle -undefined suppress -flat_namespace -Wl,-bind_at_load -o mod_auth_mysql.so mod_auth_mysql.o -L/usr/local/mysql/lib/ -lm -lz
[11:37][path/to/mod_auth_mysql-2.6.1] user%
Any help in getting it working?
Thank you in advance.
PD: MacOSX 10.3.5 with mysql-max-4.0.21-apple-darwin7.5.0-powerpc package installed.
I don't have a libmysqlclient.so in my installation, either <g>.
.so modules are Apache modules which are dynamically loaded at run time (versus being compiled into the Apache code). .a modules are library modules which are linked into the code (in this case, mod_auth_mysql.so).
The problem you're having is noted in the "Compile String" thread in this forum. Basically, the -D option was incorrect in the 2.6.0 README file (it was corrected in the 2.6.1 README). You need to remove it.
Additionally, you had one other problem - you need to add a hyphen before llibmysqlclient. The full line should read:
apxs -c -lmysqlclient -lm -lz -I/usr/local/mysql/include/ -L/usr/local/mysql/lib/ mod_auth_mysql.c
Jerry
That output is not an error. It is just the compiler telling you what it is doing. The mod appears to have compiled correctly.
from the source code dir run:
apsx -i -a mod_auth_mysql.so
this will install the mod and alter your httpd.conf.
then you have to either set up a restricted dir in your httpd.conf or make a .htaccess file.
I'm having similar problems, and the .so is definitely not being created:
[root@localhost mod_auth_mysql-2.6.1]# apxs -c -D APACHE2 -I/usr/local/mysql/include/mysql -L/usr/local/mysql/lib/mysql -I/usr/local/apache2/include -lmysqlclient -lm -lz mod_auth_mysql.c
/usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/BerkeleyDB.4.2/include -I/usr/local/mysql/include/mysql -I/usr/local/apache2/include -DAPACHE2 -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
/usr/local/apache2/build/libtool --silent --mode=link gcc -o mod_auth_mysql.la -I/usr/local/mysql/include/mysql -I/usr/local/apache2/include -DAPACHE2 -L/usr/local/mysql/lib/mysql -lmysqlclient -lm -lz -rpath /usr/local/apache2/modules -module -avoid-version mod_auth_mysql.lo
[root@localhost mod_auth_mysql-2.6.1]# apxs -i mod_auth_mysql.la
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' mod_auth_mysql.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp mod_auth_mysql.la /usr/local/apache2/modules/
cp .libs/mod_auth_mysql.lai /usr/local/apache2/modules/mod_auth_mysql.la
cp .libs/mod_auth_mysql.a /usr/local/apache2/modules/mod_auth_mysql.a
ranlib /usr/local/apache2/modules/mod_auth_mysql.a
chmod 644 /usr/local/apache2/modules/mod_auth_mysql.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/apache2/modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apache2/modules
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.
----------------------------------------------------------------------
Warning! dlname not found in /usr/local/apache2/modules/mod_auth_mysql.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/mod_auth_mysql.so
chmod: failed to get attributes of `/usr/local/apache2/modules/mod_auth_mysql.so': No such file or directory
apxs:Error: Command failed with rc=65536
.
[root@localhost mod_auth_mysql-2.6.1]# ls -sltr /usr/local/apache2/modules/
total 5439
4697 -rwxr-xr-x 1 root root 4798113 Oct 7 12:17 libphp4.so
10 -rw-r--r-- 1 root root 8440 Oct 13 22:46 httpd.exp
508 -rwxr-xr-x 1 root root 518857 Oct 13 23:32 mod_dav_svn.so
80 -rwxr-xr-x 1 root root 80792 Oct 13 23:32 mod_authz_svn.so
1 -rw-r--r-- 1 root root 783 Oct 14 13:42 mod_auth_mysql.la
84 -rw-r--r-- 1 root root 84616 Oct 14 13:42 mod_auth_mysql.a
Any help would be much appreciated.
Thanks,
Colin
Hi, i'm the one who started the thread, and my prolem is solved now ^.^
Thank you Jerry your command correction solved the problem.
Colin,
Hmm, looks like there's a missing command from apxs.
My first step matches yours just fine (other than directories). However, in the second step I have three cp statements, where you have only two. Immediately following the libtool line, I have:
cp ./libs/mod_auth_mysql.so /usr/local/apache2/modules/mod_auth_mysql.so
(This is in addition to the cp in the libtool line).
Unfortunately, I'm not an expert on the inner workings of apxs.
Do you have a mod_auth_mysql.so in your working directory? Also, which version of Apache are you running? And when you build Apache, did you build it with DSO support (if you built it more than once - did you do a "make clean" between the builds)?
I also don't know if there are any differences on OS X - I've never run it. Perhaps someone more familiar with that package can jump in here.
Jerry
I'm running 2.0.52 with SO support enabled. There's no mod_auth_mysql.so generated. Also, I'm not actually running OSX - I'm on Redhat, kernel 2.4.20
colin,
Sorry, got you mixed up with "nobody" here.
I just saw something I might have missed before. You have -I/usr/local/mysql/include/mysql. Shouldn't that be -I/usr/local/mysql/include? That's where my mysql.h is, anyway.
Please try it again, only this time add the parameter "-Wc,-Wall" (no quotes - and no spaces in the parm). This should provide more information.
Jerry
You also don't need the -I/usr/local/apache2/include.
Oddly enough, that's my mysql include path. Anyway, here goes:
[root@localhost mod_auth_mysql-2.6.1]# /usr/local/apache2/bin/apxs -Wc,-Wall -c -D APACHE2 -I/usr/local/mysql/include/mysql -L/usr/local/mysql/lib/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
/usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/apache2/include -I/usr/local/BerkeleyDB.4.2/include -Wall -I/usr/local/mysql/include/mysql -DAPACHE2 -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
/usr/local/apache2/build/libtool --silent --mode=link gcc -o mod_auth_mysql.la -Wall -I/usr/local/mysql/include/mysql -DAPACHE2 -Wc,-Wall -L/usr/local/mysql/lib/mysql -lmysqlclient -lm -lz -rpath /usr/local/apache2/modules -module -avoid-version mod_auth_mysql.lo
[root@localhost mod_auth_mysql-2.6.1]# ls -sltr
total 140
13 -rw-r--r-- 1 1002 1002 11677 Oct 4 14:31 README
37 -rw-r--r-- 1 1002 1002 36165 Oct 4 14:31 mod_auth_mysql.c
4 drwxr-xr-x 2 root root 4096 Oct 14 17:38 libs
0 -rw-r--r-- 1 root root 0 Oct 14 19:39 mod_auth_mysql.slo
84 -rw-r--r-- 1 root root 84384 Oct 14 19:39 mod_auth_mysql.o
1 -rw-r--r-- 1 root root 10 Oct 14 19:39 mod_auth_mysql.lo
1 -rw-r--r-- 1 root root 782 Oct 14 19:39 mod_auth_mysql.la
[root@localhost mod_auth_mysql-2.6.1]# /usr/local/apache2/bin/apxs -Wc,-Wall -i mod_auth_mysql.la /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' mod_auth_mysql.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp mod_auth_mysql.la /usr/local/apache2/modules/
cp .libs/mod_auth_mysql.lai /usr/local/apache2/modules/mod_auth_mysql.la
cp .libs/mod_auth_mysql.a /usr/local/apache2/modules/mod_auth_mysql.a
ranlib /usr/local/apache2/modules/mod_auth_mysql.a
chmod 644 /usr/local/apache2/modules/mod_auth_mysql.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/apache2/modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apache2/modules
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.
----------------------------------------------------------------------
Warning! dlname not found in /usr/local/apache2/modules/mod_auth_mysql.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/mod_auth_mysql.so
chmod: failed to get attributes of `/usr/local/apache2/modules/mod_auth_mysql.so': No such file or directory
apxs:Error: Command failed with rc=65536
.
Also, I did a make clean and rebuilt/reinstalled my apache - no help.
Thanks,
Colin
Colin,
Well, at this point I'm out of ideas.
Sorry, I'm just not that great at the linux tools. I suspect it's something strange in your setup - perhaps an environment variable, for instance.
Hopefully someone more knowledgeable in this area can jump in and help. Otherwise, I might suggest you check out the Apache users mailing list and/or libtool mailing list on gnu.org.
Wish I could be of more help - but the module does build properly with the correct tools and settings. I just don't know enough to help any further. Sorry.
Jerry
Colin,
Have you had any luck determing what the problem here is? If so, I'd like to know what you had to do so I can add the info to the README file.
Thanks,
Jerry
While the OSX users can build and install this DSO, if they use the Admin GUI and examine the modules list, they will see that something doesn't look right and this got me using gdb to figure out why all of the build/install problems were occuring.
Most people didn't install a different mysql and are unaware of the actual paths of files.
The following two commands will build the DSO assuming a stock OSX mysql installation using apache 1.3x.
apxs -c -D lmysqlclient -lm -lz -I/usr/include/mysql -L/usr/lib/mysql mod_auth_mysql.c
apxs -i mod_auth_mysql.so
For those of you using someone elses mysql binary, you'll have to change the mysql paths to correspond to your installaction.
A proper approach would be that the author uses a configure script that polls for the location of the mysql files and generate the appropriate building file based on OS and file locations which, based on using the standard configure scripts would be extremely simple since a check for mysql files is easy to do.
Let me also say, I'm not a fan of using someone elses binary of mysql (max) or php (entropy) and believe the user would be better off to build from source using the appropriate configure commands.
You can examine my build structures at:
for PHP4
http://www.macftphttp.serverbox.org/info.php
http://www.macftphttp.serverbox.org/gd_info.php
http://www.macftphttp.serverbox.org/pear_info.php
for PHP5
http://www.daleenterprise.com/info.php
http://www.daleenterprise.com/gd_info.php
http://www.daleenterprise.com/pear_info.php
and you will see that I'm utilizing the default apple locations which makes installing DSO's such as this a very simple and mindless task.
The only reason I gdb'ed the DSO was that a discrepency occured in the module name that became visible while I was trying to debug it and I noticed this had a profound effect on performance.
The biggest discrepency was in mod_auth_mysql.c and mod_mysql_auth.c assignments but after correcting all of the discrepencies things seem to be working alot better and you should have access to this source once the author contacts me and makes it available to you which will alleviate a lot of the build/installation problems.
The biggest problem I'm seeing is that those who are unfamiliar with building sources are trying to build and install files without knowing what they are doing or why they are doing it.
Don't install anything unless you absolutely need it is a good rule of thumb and this is why using someone elses binaries is not a good idea, take 10 minutes and learn how to do it, there are good tutorials for many projects that can be applied to almost every project out there if you just learn to read the signs.
-- Dale
dale@daleenterprise.com
Dale,
Yes, a configure script is nice for complex installations. However, I think it's a bit of overkille here.
To build mod_auth_mysql, you need to know three paths:
1. The path to axps
2. The path to the MySQL include files
3. The path o the MySQL libraires
You would still have to know #1 (and set it as an option). You *may* still need to know 2 and 3, depending on your installation.
Additionally, two calls to apxs (which could actually be done in a single call) builds and installs everything. People who are installing the module should be able to at least determine the paths.
Configure is nice - but it adds another layer of complication which I don't think is necessary - and would not solve some of the problems seen here.
Please note: the biggest install problem was a typo in the README file. The configure script will also not cure that problem.
Jerry
by use of a configure script, you could locate the include and library files, then based on the platform, issue the appropriate apx command making the installation a smoother process.
-- Dale
Dale,
As indicated in another thread - you can do this, but thre are additional potential problems. And it would not fix the typo which was in the README file.
Sorry.
Jeryr