Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> 電腦軟體教學 >> 伺服器技術 >> 關於伺服器

Apache 整合 SVN 重新編譯後模組載入失敗:undefined symbol dav_register_provider 解決 Apache 整合 SVN 重新編譯後模組載入失敗:undefined symbol dav_register_provider 解決

編輯:關於伺服器

錯誤現象:自行 ./configure && make && make install Apache 後啟動報錯:

httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf:
Cannot load /usr/local/apache2/modules/mod_dav_svn.so into server:
/usr/local/apache2/modules/mod_dav_svn.so: undefined symbol: dav_register_provider

根因分析

mod_dav_svn 依賴 mod_dav 提供的 dav_register_provider 符號。重新編譯時若未啟用 --enable-dav,mod_dav 不會編譯進核心或生成共享模組,導致符號缺失。

正確編譯參數

./configure \
  --prefix=/usr/local/apache2 \
  --enable-dav \
  --enable-so \
  --enable-maintainer-mode \
  --enable-rewrite \
  --enable-dav-fs \
  --enable-dav-lock \
  --with-apr=/usr/local/apr \
  --with-apr-util=/usr/local/apr-util

關鍵模組對照

模組編譯參數功能
mod_dav--enable-davWebDAV 核心協議支援
mod_dav_fs--enable-dav-fs檔案系統儲存提供者
mod_dav_lock--enable-dav-lock通用鎖定管理
mod_dav_svnSubversion 原始碼中編譯Subversion WebDAV 提供者

驗證步驟

# 檢查模組是否編入
httpd -l | grep dav
httpd -M | grep dav

# 檢查符號表
nm /usr/local/apache2/modules/mod_dav.so | grep dav_register_provider

補充:Subversion 編譯 Apache 模組

cd subversion-1.x.x
./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
make
make install
# 會生成 mod_dav_svn.so, mod_authz_svn.so 到 Apache modules 目錄
Copyright © Windows教程網 All Rights Reserved