我已经20小时试图解决这个问题了。
我有一个使用Redmine + Mercurial的完美系统。
然后我虚拟化并重新安装了所有内容。
Redmine现在有效,但Mercurial不会。
它总是抛出404 Not Found或500 Internal Server Error(如果repo名称不好)。
我尝试过很多东西,包括删除Redmine身份验证。
启用网站的repos.tracker.conf:
<VirtualHost *:80>
ServerName repos.tracker.intranet.****.com.ar
DocumentRoot /var/www/repos.dev01/
ServerAlias www.repos.tracker.intranet.****.com.ar repos.****.com.ar
ServerAdmin jsivil@****.com.ar
LogLevel warn
ErrorLog /var/log/apache2/repos_error
CustomLog /var/log/apache2/repos_access combined
PerlLoadModule Apache2::Redmine
#PerlLoadModule Apache::DBI
ScriptAliasMatch "^/hg(.*)" "/opt/repos/hgwebdir.cgi$1"
<LocationMatch "^/hg">
AuthType Basic
AuthName "Redmine Mercurial Repository"
Require valid-user
#Redmine auth
PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
RedmineDSN "DBI:mysql:database=redmine;host=127.0.0.1"
RedmineDbUser "redminedb"
RedmineDbPass "redminepass"
</LocationMatch>
</VirtualHost>
tracker.conf:
<VirtualHost *:80>
ServerAdmin jsivil@****.com.ar
ServerName tracker.intranet.****.com.ar
ServerAlias www.tracker.intranet.****.com.ar
DocumentRoot /var/www/dev01
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/dev01>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
/opt/repos/hgweb.cgi
#!/usr/bin/python2.7
#
# An example hgweb CGI script, edit as necessary
# See also https://www.mercurial-scm.org/wiki/PublishingRepositories
# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/opt/repos/hgweb.config"
# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
#import sys; sys.path.insert(0, "/path/to/python/lib")
# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)
/opt/repos/hgweb.config
[paths]
/=/opt/repos/hg/**
[web]
allow_push = *
push_ssl = false
allowbz2 = yes
allowgz = yes
allowzip = yes
baseurl = /hg
权限:
root@tracker:/opt/repos/hg# ls -la
total 16
drwxrw-r-- 4 www-data root 4096 ene 1 15:37 .
drwx------ 3 www-data root 4096 ene 1 15:37 ..
drwxrw-r-- 3 www-data root 4096 oct 5 21:35 animalizate
drwxrw-r-- 3 www-data root 4096 oct 5 22:11 mercurial-hooks
答案 0 :(得分:0)
我终于修复了错误。
我使用了/usr/share/doc/mercurial/examples/hgweb.wsgi中的脚本
然后404错误就消失了。