【问题标题】:Mysterious DocumentRoot using Apache2.2.22 on RaspberryPi (Debian Wheezy) whilst trying to setup SVN在尝试设置 SVN 时在 RaspberryPi (Debian Wheezy) 上使用 Apache2.2.22 的神秘 DocumentRoot
【发布时间】:2014-04-20 21:14:56
【问题描述】:

我正在尝试在运行 Debian Wheezy 的 Raspberry Pi 上使用 Apache2.2.22(从现在开始为 Apache!)通过 SSL 运行 SVN 存储库。

我是 Apache 新手,正在尝试各种配置。我真正想做的只是让 Apache 提供 SVN 存储库,没有别的,即没有 DocumentRoot,而是使用 SVNParentPath。

这可能是不可能的,但如果没有别的,我想知道为什么在删除站点启用和站点可用目录中的所有站点并检查 /etc/apache2 目录和子目录中的所有其他文件以获取术语 DocumentRoot 之后使用默认 /var/www DocumentRoot。

重启Apache2服务后我去

http:\\raspberrypi 

我明白了它的工作原理!页。

在重新启动 Apache 时,我也没有收到有关缺少 DocumentRoot 的警告。我已经重新安装了 Apache,每次对 .conf 文件进行更改时,我都会重新启动服务并清除浏览器历史记录。

这是一个 Debian 设置,所以没有 httpd.conf 文件。

dav_svn.conf 文件只包含 cmets。

/etc/apache2/apache2.conf 看起来像这样(注释掉的任何内容都不会显示):

LockFile ${APACHE_LOCK_DIR}/accept.lock

PidFile ${APACHE_PID_FILE}

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 5

<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>


<IfModule mpm_worker_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>


<IfModule mpm_event_module>
    StartServers          2
    MinSpareThreads      25
    MaxSpareThreads      75 
    ThreadLimit          64
    ThreadsPerChild      25
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>


User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

AccessFileName .htaccess

<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy all
</Files>

DefaultType None

HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

Include mods-enabled/*.load
Include mods-enabled/*.conf

Include ports.conf

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

Include conf.d/

Include sites-enabled/

ports.conf 文件(带有 cmets):

# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default
# This is also true if you have upgraded from before 2.2.9-3 (i.e. from
# Debian etch). See /usr/share/doc/apache2.2-common/NEWS.Debian.gz and
# README.Debian.gz

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

如上所述,站点启用或站点可用目录中没有文件。

如果有人能解释为什么我在访问时没有收到 DocumentRoot 错误或没有页面,我将不胜感激

http://raspberrypi URI。

谢谢, 丰富的

【问题讨论】:

    标签: apache debian raspberry-pi document-root


    【解决方案1】:

    Apache 有一个默认的文档根目录 /usr/local/apache/htdocs 。如果未在任何配置中指定,它将使用此值。

    【讨论】:

    • 感谢您的快速回复。我的系统上没有这个目录 - 所以看不到它如何从中提供 html 页面。
    【解决方案2】:

    Apache 为DocumentRoot property 定义了一个默认值,以便在配置中未设置任何值时使用。如文档中所述,默认值为 /usr/local/apache/htdocs(硬编码),但可以在编译时更改。

    但是,您使用的是 Debian。大多数 Debian 软件包都有一些小的调整以满足他们自己的目标和标准。仅举一些例子,在 Apache 2 中它们包括:

    • 使用分隔的.conf文件;
    • 自定义默认文件夹;
    • www-data 用户的创建。

    此外,如果您深入研究 Apache 2 Debian 软件包源代码 (Wheezy specifically),您会注意到 Apache 2 的默认文件夹已更改为使其符合 FHS。这就是它们位于 /var/www 的原因。

    此外,需要注意的是,Apache 2 Debian 软件包中有一个 recent commitDocumentRoot 更改为 /var/www/html。您应该预计此更改会出现在未来的版本中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-21
      • 1970-01-01
      • 2010-12-10
      • 2013-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-10
      相关资源
      最近更新 更多