首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Ubuntu中使用apache2设置cgit?

如何在Ubuntu中使用apache2设置cgit?
EN

Ask Ubuntu用户
提问于 2016-06-18 16:02:08
回答 1查看 3.7K关注 0票数 4

我多次尝试用apache2配置cgit,但都失败了。以下是我的配置:

apache2 conf:

代码语言:javascript
复制
<VirtualHost *80:>
    DocumentRoot /var/www/htdocs/cgit

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/home/git/repositories">
            AllowOverride None
            Options +ExecCGI
            DirectoryIndex /cgi-bin/cgit.cgi
            Order allow,deny
            Allow from all
    </Directory>

    <Directory "/var/www/htdocs/cgit">
         AllowOverride None
         Options +ExecCGI
         Order deny,allow
         Allow from all
    </Directory>
 </VirtualHost>

cgit /etc/cgitrc:

代码语言:javascript
复制
# cgit configuration
virtual-root=/git/
enable-index-links=1
enable-log-filecount=1
enable-log-linecount=1
snapshot=tar.gz zip

logo=/cgit/cgit.png
css=/cgit/cgit.css

# repositories
repo.url=blc
repo.path=/home/git/repositories/testing.git

以及使用默认配置安装cgit,即。docroot位于/var/www/htdocs/cgit中,可执行的cgi位于/usr/lib/cgi-bin/下。

但是当我试图访问http://localhost/git时,我总是得到这样的信息:The requested URL /git was not found on this server.

我哪里错了?谢谢你的帮忙!

EN

回答 1

Ask Ubuntu用户

发布于 2016-08-11 02:00:48

您在apache2中启用了cgi吗?在异种环境中,默认情况下不启用它。

代码语言:javascript
复制
cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/cgi.load cgi.load

在cgit的Ubuntu包中为我工作

票数 3
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/788589

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档