shu*_*ham 7 apache http gerrit
我正在尝试使用http baisc身份验证来配置gerrit,我的httpd配置是
<VirtualHost *:8081>
ServerName localhost
ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location "/login/">
AuthType Basic
AuthName "Gerrit Code Review"
AuthBasicProvider file
AuthUserFile /usr/local/apache/passwd/passwords
Require valid-user
</Location>
ProxyPass / http://localhost:8081/
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
和我的gerrit.config是
[gerrit]
basePath = git
canonicalWebUrl = http://localhost:8081/
[database]
type = mysql
hostname = localhost
database = reviewdb
username = gerrit
[auth]
type = HTTP
[sendemail]
smtpServer = localhost
smtpUser = gerrit
[container]
user = gerrit
javaHome = /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = proxy-http://*:8081/
[cache]
directory = cache
Run Code Online (Sandbox Code Playgroud)
我不知道我哪里出错,但访问http:// xxxx:8081说
The HTTP server did not provide the username in the Authorization header when it forwarded the request to Gerrit Code Review.
If the HTTP server is Apache HTTPd, check the proxy configuration includes an authorization directive with the proper location, ensuring it ends with '/':
Run Code Online (Sandbox Code Playgroud)
我的gerrit在inbuild码头计数器上运行,我的操作系统是6.4
我哪里错了.?
好吧,其实我在端口8081上创建了一个虚拟主机,我的码头(与gerrit一起出现)也在听同一个端口,我的配置几乎保持不变,但这些是额外的步骤: -
listen <port-no>在你的http conf文件中添加这一行现在,在端口8082上设置virtualhost,将虚拟主机更改为端口号
<VirtualHost *:8082>
ServerName localhost
ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location "/login/">
AuthType Basic
AuthName "Gerrit Code Review"
AuthBasicProvider file
AuthUserFile /usr/local/apache/passwd/passwords
Require valid-user
</Location>
ProxyPass / http://localhost:8081/
Run Code Online (Sandbox Code Playgroud)
将规范URL更改为端口8082(以便将其重定向到同一端口)
请享用.!!
| 归档时间: |
|
| 查看次数: |
24687 次 |
| 最近记录: |