![Debian 将 Apache 升级到 2.4.4 后,Libapache2-svn 将无法工作](https://linux22.com/image/612785/Debian%20%E5%B0%86%20Apache%20%E5%8D%87%E7%BA%A7%E5%88%B0%202.4.4%20%E5%90%8E%EF%BC%8CLibapache2-svn%20%E5%B0%86%E6%97%A0%E6%B3%95%E5%B7%A5%E4%BD%9C.png)
我已经使用 Apache2 和 SVN 运行了很长时间。对于一些其他我必须进行系统升级的原因:
apt-get upgrade
一切似乎都正常,除了我的 Apache2 配置。现在它无法启动DAV: SVN
。我注意到了这一点mod_dav_svn
,并且mod_authz_svn
突然不见了。所以我尝试安装它们:
root@kolky:/etc/apache2# apt-get install libapache2-svn
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libapache2-svn : Depends: apache2.2-common but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我可以理解这不起作用,因为我的 apache 版本是:
root@kolky:/etc/apache2# apache2 -v
Server version: Apache/2.4.4 (Debian)
Server built: May 31 2013 10:04:32
root@kolky:/etc/apache2# svn --version
svn, version 1.7.9 (r1462340)
root@kolky:/etc/apache2# svnadmin --version
svnadmin, version 1.7.9 (r1462340)
root@kolky:/etc/apache2# cat /etc/issue
Debian GNU/Linux jessie/sid \n \l
root@kolky:/etc/apache2# uname -r
2.6.32-5-amd64
有解决方案吗?我可以用 mod_dav_svn 运行 Apache2.4.4 吗?还是我必须降级我的 Apache?
答案1
我建议你使用以下 repo -http://opensource.wandisco.com/debian/dists/
答案2
你可以看一下错误描述。显然你可以通过自己编译包来让它工作。 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666794#17 另外,请记住,您不需要执行“apt-get upgrade”来升级某些软件包。“upgrade”操作会升级您安装的每个软件包。您可以改用“apt-get install package_name”来升级某些软件包。
编辑:
以下是手动构建以保持 web svn 存储库正常运行的步骤:
作为非 root 用户:
cd /tmp
mkdir svn_tmp
cd svn_tmp
sudo apt-get install apache2-dev
sudo apt-get build-dep subversion
apt-get source --compile subversion
等到检查部分开始。然后停止该过程(Ctrl-C):
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
... (Ctrl - C)
让我们编辑一些文件。首先,subversion-1.7.9/debian/control。确保 apache2-dev 出现在 Build-Depends 部分(第 7 行左右):
Build-Depends: debhelper, libneon27-gnutls-dev, libserf-dev (>= 1), zlib1g-dev,
libapr1-dev, libaprutil1-dev, libdb5.1-dev,
libsasl2-dev, apache2-dev,
...
然后,检查是否有 libapache-2 部分。如果有,请确保删除 apache2.2-common 依赖项。如果没有,请添加完整部分:
Package: libapache2-svn
Section: httpd
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: db5.1-util
Description: Subversion server modules for Apache
This package provides the mod_dav_svn and mod_authz_svn modules for
the Apache 2.2 web server. These modules provide Subversion's WebDAV
server backend, to serve repositories over the http and https
protocols. See the 'subversion' package for more information.
然后,编辑 subversion-1.7.9/debian/rules 并确保 ENABLE_APACHE 为真:
ENABLE_APACHE := yes
现在,我们准备再次开始构建过程:
cd /tmp/svn_tmp/subversion-1.7.9 && dpkg-buildpackage -b -uc
这个过程可能需要很长时间。对我来说,花了大约 1 个小时。最后,我们可以安装该软件包。
sudo dpkg -i /tmp/svn_tmp/libapache2-svn_1.7.9-1+nmu3_amd64.deb
sudo a2enmod dav_svn
sudo a2enmod authz_svn
sudo service apache2 restart
就这样。
答案3
添加ppa:ondrej/apache2可以帮助您安装缺少的 Apache2 软件包,特别是如果您最近添加了 PHP 5 最新存储库(来自这个答案):
sudo add-apt-repository ppa:ondrej/apache2
sudo apt-get update
sudo apt-get install libapache2-svn