首页 > 代码库 > 编译安装shibboleth-sp遇到的问题

编译安装shibboleth-sp遇到的问题

In file included from mod_shib_20.cpp:68:

mod_shib.cpp:118: warning: deprecated conversion from string constant to ‘char*‘

mod_shib.cpp: In member function ‘virtual const char* ShibTargetApache::getScheme() const‘:

mod_shib.cpp:385: error: ‘ap_http_method‘ was not declared in this scope

mod_shib.cpp: In member function ‘virtual std::string ShibTargetApache::getRemoteAddr() const‘:

mod_shib.cpp:417: error: ‘struct conn_rec‘ has no member named ‘remote_ip‘

In file included from mod_shib_20.cpp:68:

mod_shib.cpp: In function ‘int shib_post_read(request_rec*)‘:

mod_shib.cpp:681: warning: unused variable ‘rc‘

mod_shib.cpp: In member function ‘virtual shibsp::AccessControl::aclresult_t htAccessControl::authorized(const shibsp::SPRequest&, const shibsp::Session*) const‘:

mod_shib.cpp:1221: error: ‘ap_requires‘ was not declared in this scope


安装shibboleth-sp时一直报这个错,搞了好几天,查谷歌,百度都没找到解决办法

无奈之下,从源码下手,去找原因,

从谷歌得知这个问题是apache中include文件夹下的httpd.h没有ap_http_method这个方法

于是我搜索apache的源码,从change文件里找到了原因,原来http2.2.14中ap_http_method已经被ap_http_scheme替代

这样写的:

ap_http_scheme() replaced with ap_http_method() - this function

     returns the scheme (http v.s. https)


终于找到问题所在,看来shibboleth-sp-2.5.3源码包是有bug的,然后打开源码包中的mod_shib.cpp文件把

return m_sc->szScheme ? m_sc->szScheme : ap_http_scheme(m_req);

改为

return m_sc->szScheme ? m_sc->szScheme : ap_http_scheme(m_req);

重新编译,问题解决!!!