Slackware 13(apache 2.2 & MySQL 5.0) 시스템에 auth_mod_auth(3.0.0) 모듈을 추가해 보았습니다.
BUILD 파일에 설명된 대로 apxs에 대한 일반적인 명령줄을 실행했습니다.
apxs -c -L/usr/lib/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c
하지만 다음과 같은 오류가 발생합니다.
/usr/lib/apr-1.3.12/build-1/libtool --silent --mode=compile i486-slackware-linux-gcc -prefer-pic -O2 -march=i486 -mtune=i686 -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd -I/usr/include/apr-1 -I/usr/include/apr-1 -I/usr/include/mysql -c -o mod_auth_mysql.lo mod_auth_mysql.c && touch mod_auth_mysql.slo
mod_auth_mysql.c:591: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:591: error: initializer element is not constant
mod_auth_mysql.c:591: error: (near initialization for 'mysql_auth_cmds[0].cmd_data')
mod_auth_mysql.c:595: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:595: error: initializer element is not constant
mod_auth_mysql.c:595: error: (near initialization for 'mysql_auth_cmds[1].cmd_data')
mod_auth_mysql.c:599: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:599: error: initializer element is not constant
mod_auth_mysql.c:599: error: (near initialization for 'mysql_auth_cmds[2].cmd_data')
mod_auth_mysql.c:603: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:603: error: initializer element is not constant
mod_auth_mysql.c:603: error: (near initialization for 'mysql_auth_cmds[3].cmd_data')
mod_auth_mysql.c:607: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:607: error: initializer element is not constant
mod_auth_mysql.c:607: error: (near initialization for 'mysql_auth_cmds[4].cmd_data')
mod_auth_mysql.c:611: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:611: error: initializer element is not constant
mod_auth_mysql.c:611: error: (near initialization for 'mysql_auth_cmds[5].cmd_data')
mod_auth_mysql.c:615: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:615: error: initializer element is not constant
mod_auth_mysql.c:615: error: (near initialization for 'mysql_auth_cmds[6].cmd_data')
mod_auth_mysql.c:619: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:619: error: initializer element is not constant
mod_auth_mysql.c:619: error: (near initialization for 'mysql_auth_cmds[7].cmd_data')
mod_auth_mysql.c:623: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:623: error: initializer element is not constant
mod_auth_mysql.c:623: error: (near initialization for 'mysql_auth_cmds[8].cmd_data')
mod_auth_mysql.c:627: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:627: error: initializer element is not constant
mod_auth_mysql.c:627: error: (near initialization for 'mysql_auth_cmds[9].cmd_data')
mod_auth_mysql.c:631: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:631: error: initializer element is not constant
mod_auth_mysql.c:631: error: (near initialization for 'mysql_auth_cmds[10].cmd_data')
mod_auth_mysql.c:635: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:635: error: initializer element is not constant
mod_auth_mysql.c:635: error: (near initialization for 'mysql_auth_cmds[11].cmd_data')
mod_auth_mysql.c:639: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:639: error: initializer element is not constant
mod_auth_mysql.c:639: error: (near initialization for 'mysql_auth_cmds[12].cmd_data')
mod_auth_mysql.c:643: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:643: error: initializer element is not constant
mod_auth_mysql.c:643: error: (near initialization for 'mysql_auth_cmds[13].cmd_data')
mod_auth_mysql.c:651: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:651: error: initializer element is not constant
mod_auth_mysql.c:651: error: (near initialization for 'mysql_auth_cmds[14].cmd_data')
mod_auth_mysql.c:655: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:655: error: initializer element is not constant
mod_auth_mysql.c:655: error: (near initialization for 'mysql_auth_cmds[15].cmd_data')
mod_auth_mysql.c:659: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:659: error: initializer element is not constant
mod_auth_mysql.c:659: error: (near initialization for 'mysql_auth_cmds[16].cmd_data')
mod_auth_mysql.c:663: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:663: error: initializer element is not constant
mod_auth_mysql.c:663: error: (near initialization for 'mysql_auth_cmds[17].cmd_data')
mod_auth_mysql.c:667: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:667: error: initializer element is not constant
mod_auth_mysql.c:667: error: (near initialization for 'mysql_auth_cmds[18].cmd_data')
mod_auth_mysql.c:671: error: expected expression before 'mysql_auth_config_rec'
mod_auth_mysql.c:671: error: initializer element is not constant
mod_auth_mysql.c:671: error: (near initialization for 'mysql_auth_cmds[19].cmd_data')
mod_auth_mysql.c: In function 'format_request':
mod_auth_mysql.c:947: warning: pointer/integer type mismatch in conditional expression
apxs:Error: Command failed with rc=65536
mysql 라이브러리가 코드가 기대하는 것과 일치하지 않는 것 같습니다. 주위를 둘러보니 이 모듈이 최신 버전이 아니지만(2005년 6월) 사용 가능한 마지막 버전인 것 같습니다.
비슷한 설정으로 작동하게 한 사람이 있습니까? 나는 성공하지 못한 채 오랫동안 그것을 조정해 왔습니다 :-(
답변1
나는 여기서 답을 찾았습니다.http://bugs.gentoo.org/show_bug.cgi?format=multiple&id=192391
효과가있다! :-)
파일에서는 으로 변경됩니다 APR_XtOffsetOf
.APR_OFFSETOF
.c
문제를 해결하기 위한 패치:
--- mod_auth_mysql.c.orig 2007-09-13 09:36:14.000000000 +0200
+++ mod_auth_mysql.c 2007-09-13 09:41:49.000000000 +0200
@@ -589,87 +589,87 @@
static
command_rec mysql_auth_cmds[] = {
AP_INIT_TAKE1("AuthMySQLHost", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlhost),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlhost),
OR_AUTHCFG, "mysql server host name"),
AP_INIT_TAKE1("AuthMySQLPort", ap_set_int_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlport),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlport),
OR_AUTHCFG, "mysql server port number"),
AP_INIT_TAKE1("AuthMySQLSocket", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlsocket),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlsocket),
OR_AUTHCFG, "mysql server socket path"),
AP_INIT_TAKE1("AuthMySQLUser", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqluser),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqluser),
OR_AUTHCFG, "mysql server user name"),
AP_INIT_TAKE1("AuthMySQLPassword", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlpasswd),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlpasswd),
OR_AUTHCFG, "mysql server user password"),
AP_INIT_TAKE1("AuthMySQLDB", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlDB),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlDB),
OR_AUTHCFG, "mysql database name"),
AP_INIT_TAKE1("AuthMySQLUserTable", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlpwtable),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlpwtable),
OR_AUTHCFG, "mysql user table name"),
AP_INIT_TAKE1("AuthMySQLGroupTable", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlgrptable),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlgrptable),
OR_AUTHCFG, "mysql group table name"),
AP_INIT_TAKE1("AuthMySQLNameField", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlNameField),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlNameField),
OR_AUTHCFG, "mysql User ID field name within User table"),
AP_INIT_TAKE1("AuthMySQLGroupField", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlGroupField),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlGroupField),
OR_AUTHCFG, "mysql Group field name within table"),
AP_INIT_TAKE1("AuthMySQLGroupUserNameField", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec,
mysqlGroupUserNameField),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlGroupUserNameField),
OR_AUTHCFG, "mysql User ID field name within Group table"),
AP_INIT_TAKE1("AuthMySQLPasswordField", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlPasswordField),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlPasswordField),
OR_AUTHCFG, "mysql Password field name within table"),
AP_INIT_TAKE1("AuthMySQLPwEncryption", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlEncryptionField),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlEncryptionField),
OR_AUTHCFG, "mysql password encryption method"),
AP_INIT_TAKE1("AuthMySQLSaltField", ap_set_string_slot,
- (void*) APR_XtOffsetOf(mysql_auth_config_rec, mysqlSaltField),
+ (void*) APR_OFFSETOF(mysql_auth_config_rec, mysqlSaltField),
OR_AUTHCFG, "mysql salfe field name within table"),
/* AP_INIT_FLAG("AuthMySQLKeepAlive", ap_set_flag_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlKeepAlive),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlKeepAlive),
OR_AUTHCFG, "mysql connection kept open across requests if On"),
*/
AP_INIT_FLAG("AuthMySQLAuthoritative", ap_set_flag_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlAuthoritative),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlAuthoritative),
OR_AUTHCFG, "mysql lookup is authoritative if On"),
AP_INIT_FLAG("AuthMySQLNoPasswd", ap_set_flag_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlNoPasswd),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlNoPasswd),
OR_AUTHCFG, "If On, only check if user exists; ignore password"),
AP_INIT_FLAG("AuthMySQLEnable", ap_set_flag_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlEnable),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlEnable),
OR_AUTHCFG, "enable mysql authorization"),
AP_INIT_TAKE1("AuthMySQLUserCondition", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlUserCondition),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlUserCondition),
OR_AUTHCFG, "condition to add to user where-clause"),
AP_INIT_TAKE1("AuthMySQLGroupCondition", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlGroupCondition),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlGroupCondition),
OR_AUTHCFG, "condition to add to group where-clause"),
AP_INIT_TAKE1("AuthMySQLCharacterSet", ap_set_string_slot,
- (void *) APR_XtOffsetOf(mysql_auth_config_rec, mysqlCharacterSet),
+ (void *) APR_OFFSETOF(mysql_auth_config_rec, mysqlCharacterSet),
OR_AUTHCFG, "mysql character set to be used"),
{ NULL }