0

我正在运行 Ubuntu 8.10,并且我已经尽可能快地安装了必要的软件包。在系统 > 管理 > 服务下,我在列表中看到“Webserver (Apache2)”。

谷歌搜索表明 /etc/hosts 文件可能存在问题,没有一行读取“127.0.0.1 localhost”,但我检查了该文件,它就在那里。我不知道下一步该做什么。

更清楚地说,尝试访问http://localhost/不会加载任何页面。浏览器只是继续加载,但页面永远不会出现。

这是我的 access.log:

192.168.1.101 - - [09/Feb/2009:09:59:54 -0800] "HEAD / HTTP/1.0" 200 - "-" "-"
192.168.1.101 - - [10/Feb/2009:02:10:26 -0800] "HEAD / HTTP/1.0" 200 - "-" "-"

和error.log(主要是我在重置,试图通过摆弄它来让它工作)

[Mon Feb 09 08:17:47 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 15:40:27 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 15:42:13 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 15:58:27 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 15:59:57 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 16:31:12 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 16:32:45 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 16:46:26 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 16:49:53 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Mon Feb 09 22:54:51 2009] [notice] caught SIGTERM, shutting down
[Mon Feb 09 22:58:19 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:02:04 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:04:54 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:18:24 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:18:25 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:28:58 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:28:59 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:32:10 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:32:11 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:43:45 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:43:46 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 00:45:51 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 00:45:52 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 02:21:34 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 02:21:34 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 02:24:39 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 02:24:40 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:00:33 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 04:00:33 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:29:03 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 04:29:03 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:31:12 2009] [notice] SIGUSR1 received.  Doing graceful restart
[Tue Feb 10 04:31:12 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:39:45 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 04:41:23 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:48:42 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 04:48:43 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
[Tue Feb 10 04:48:45 2009] [notice] caught SIGTERM, shutting down
[Tue Feb 10 04:48:50 2009] [notice] Apache/2.2.9 (Ubuntu) DAV/2 SVN/1.5.1 mod_ssl/2.2.9 OpenSSL/0.9.8g configured -- resuming normal operations
4

2 回答 2

2

为了让 SVN 在 Ubuntu 下与 apache 一起工作,您需要:

  • 安装正确的软件包
  • 启用正确的 apache 模块
  • 为 apache 提供一个工作配置文件
  • 创建存储库

我已经在各种版本的 Ubuntu 和 Debian 下通过 apache 安装了 SVN,但从未使用最新的 Ubuntu。希望我的配置对你有帮助。

安装正确的包

确保您安装了以下软件包“libapache2-svn”和“subversion”。

启用正确的 apache 模块

转到文件夹“/etc/apache2/mods-enabled”并验证文件“dav_svn.conf”和“dav_svn.load”是否存在。如果它们丢失了,只需执行以下操作:

sudo a2enmod dav_svn

为 apache 提供一个工作配置文件

这就是乐趣的开始。我决定为我自己的存储库使用虚拟主机,即使它对外界不可见。假设您决定在http://svn.localhost/repos/下提供您的存储库。首先将以下条目添加到 '/etc/hosts'

127.0.0.1 svn.localhost

然后为 apache 创建一个配置文件并将其保存到 '/etc/apache2/sites-enabled/' :

<VirtualHost *>
    ServerName svn.localhost

    ErrorLog /var/log/apache2/svn-error.log
    CustomLog /var/log/apache2/svn-access.log combined


    <Location /repos>

        # Enable the repository
        DAV svn

        # Path to your repository
        SVNPath /home/subversion

        # The following allows for basic http authentication.
        AuthType Basic
        AuthName "Subversion Repository"
        AuthUserFile /etc/apache2/dav_svn.passwd

        # Allow anonymous read, but make committers authenticate themselves
        <LimitExcept GET PROPFIND OPTIONS REPORT>
            Require valid-user
        </LimitExcept> 

        # Have the network shares autocomit their modifications
        SVNAutoversioning on

        # Needed because Microsoft Web Folders defaults to a timeout of 120, a higher number will work better
        DAVMinTimeout 600

        #
        # Broken WebDAV for Windows XP
        #
        BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
        BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
        BrowserMatch "Microsoft-WebDAV-MiniRedir/5.1.2600" redirect-carefully
        BrowserMatch "^WebDrive" redirect-carefully
        BrowserMatch "^WebDAVFS" redirect-carefully

        <IfModule mod_headers.c>
            Header add MS-Author-Via "DAV"
        </IfModule>

        <IfModule mod_encoding.c>
            EncodingEngine on
            NormalizeUsername on
        </IfModule>
    </Location>

</VirtualHost>

创建存储库

使用以下命令创建您的存储库:

sudo mkdir -p /home/subversion/ sudo svnadmin create /home/subversion/ sudo chown -R www-data:www-data /home/subversion/

如果您决定将存储库定位在不同的文件夹下,请确保更新配置文件中 /home/subversion/ 的 apache 设置。

使用命令 htpasswd 更新您的密码文件 /etc/apache2/dav_svn.passwd。

于 2009-02-10T12:16:19.400 回答
0

如果我没记错的话,您可以配置 Apache 绑定到的网络接口,localhost默认情况下可能不包括在内。

您是否尝试过连接机器的外部主机名或 IP(例如192.168.x.y)?

此外,尝试阅读本指南中针对 Ubuntu 8.10的“安装 Apache”部分。

于 2009-02-10T11:50:25.403 回答