Because of the environmental migration, we migrated SVN from CentOS 6.8 to CentOS 7.3, the original httpd-2.2.15 has been upgraded to httpd-2.4.6, and the Yum installation httpd mod_auth_mysql in CentOS 7.3 has not been supported.
1. Environmental preparedness
[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[[email protected] ~]# uname -an
Linux Web245 3.10.0-514.6.1.el7.x86_64 #1 SMP Wed Jan 18 13:06:36 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[[email protected] ~]# yum -y install httpd httpd-devel mariadb mariadb-libs mariadb-devel subversion mod_dav_svn mod_ssl patch
2. File download and preparation
Mod_auth_mysql Project Address
Https://sourceforge.net/projects/modauthmysql
Apache22.diff Patch Address
https://sourceforge.net/p/modauthmysql/patches/7/
wget https://nchc.dl.sourceforge.net/project/modauthmysql/modauthmysql/3.0.0/mod_auth_mysql-3.0.0.tar.gz
wget https://sourceforge.net/p/modauthmysql/patches/_discuss/thread/efda3a06/c5a7/attachment/apache22.diff
3.mod_auth_mysql Compilation and Installation
tar zxf mod_auth_mysql-3.0.0.tar.gz
cd mod_auth_mysql-3.0.0
#Patch the module
patch -p0 <../apache22.diff
Modify the source code
Line 908: [return r->connection->remote_ip;] becomes [return r->connection->client_ip;]
1273 rows: by [const apr_array_header_t *reqs_arr = Ap_requires (r);] changed to [const apr_array_header_t *reqs_arr = Apr_table_elts (R- >HEADERS_IN);]
sed -i ‘s#return r->connection->remote_ip;#return r->connection->client_ip;#g‘ mod_auth_mysql.c
sed -i ‘s#ap_requires(r)#apr_table_elts(r->headers_in)#g‘ mod_auth_mysql.c
Compile
Apxs-c-l/usr/lib64/mysql-i/usr/include/mysql-lmysqlclient-lm-lz MOD_AUTH_MYSQL.C
If the following error occurs
/usr/bin/ld:cannot find-lmysqlclient
Collect2:error:ld returned 1 exit status
Apxs:Error:Command failed with rc=65536
The path is probably wrong.
Apxs-c-L/usr/lib/mysql -i/usr/include/mysql-lmysqlclient-lm-lz mod_auth_mysql.c
Modify the red section above for /usr/lib64/mysql
Installation
Apxs-i mod_auth_mysql.la
################################################################
The above patch can also be used to directly use the apache2.4 patch
https://sourceforge.net/p/modauthmysql/patches/13/
This article is from "Maple Night" blog, please be sure to keep this source http://fengwan.blog.51cto.com/508652/1898048
Mod_auth_mysql installation and configuration of CentOS 7 under httpd-2.4.6