【问题标题】:Apache Virtual Host -- subdomain for cgitApache 虚拟主机——cgit 的子域
【发布时间】:2013-07-24 17:54:46
【问题描述】:

我对 apache 的虚拟主机配置感到困惑。我想在子域上部署cgit,例如:http://cgit.mydomain.com

我已将其用作我的配置模板:http://hjemli.net/pipermail/cgit/2011-July/000235.html 这是我的虚拟主机配置:

<VirtualHost *>
    ServerAdmin admin@mydomain.org
    ServerName cgit.mydomain.org
    ErrorLog "/var/log/httpd/cgit-error_log"
    CustomLog "/var/log/httpd/cgit-access_log" common
    DocumentRoot "/usr/share/webapps/cgit/"

    <Directory "/usr/share/webapps/cgit/">
        AllowOverride None
        Options ExecCGI FollowSymlinks
        Order allow,deny
        Allow from all
    </Directory>

    Alias /cgit.css "/usr/share/webapps/cgit/cgit.css"
    Alias /cgit.png "/usr/share/webapps/cgit/cgit.png"
    Alias /favicon.ico "/usr/share/webapps/cgit/favicon.ico"
    ScriptAlias / "/usr/share/webapps/cgit/cgit.cgi/"
</VirtualHost>

这是我cgitrc的一部分:

css=/cgit.css
logo=/cgit.png
favicon=/favicon.ico

一切正常,但 css 文件和网站图标不起作用,因此cgit 网页已损坏。当我转到 URL http://cgit.mydomain.com/cgit.css cgit 时告诉我没有名为 cgit.css 的仓库。通常我应该在浏览器中看到cgit.css 文件。

一种可能的解决方案是使用 /cgit/ 作为脚本别名,但我不想在我的 URL 中包含 /cgit/ 片段。在http://cgit.osmocom.org 上它工作正常。

【问题讨论】:

  • "一切正常,但 css 文件和网站图标不起作用,[...] 一个可能的解决方案是使用 /cgit/ 作为脚本别名 [...]" virtual-root=/cgit/cgitrc

标签: apache virtualhost cgit


【解决方案1】:

我很清楚为什么,但现在设置工作了!将DocumentRoot "/usr/share/webapps/cgit/" 添加到我的虚拟主机后,我昨天停止了工作。 今天我查看了我的cgit 网站,一切都很好!我认为这类似于缓存问题...

上面的虚拟主机设置有效。

【讨论】:

    猜你喜欢
    • 2012-12-03
    • 2022-01-12
    • 2015-05-27
    • 2014-12-28
    • 2015-02-24
    • 2013-12-14
    • 2017-01-02
    • 2018-11-21
    • 2013-04-26
    相关资源
    最近更新 更多