gerrit如何配置多端口服務器的apache上配置了redmine和gerrit,redmine使用默認端口80,gerrit按照網(wǎng)上配置httpd.conf, <VirtualHost *> 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 /home/xx/gerrt_sites/etc/passwords Require valid-user </Location> ProxyPass / http: </VirtualHost> 這樣配置的結(jié)果就是通過127.0.0.1打開gerrit,但是不能打開127.0.0.1/redmine。網(wǎng)上說可以通過在apache中配置多站點來解決,但是偶配置了多次都不成功,改用多端口解決。方法: 1.首先在/etc/apache2/ports.conf中添加 NameVirtualHost *:8090 2.配置/etc/apache2/httpd.conf: ServerName localhost <Location /login/> 3.ProxyPass / http://127.0.0.1:8088/,這里的配置必須和/home/xx/gerrt_sites/etc/gerrit.config文件里面的 [httpd] 打開:127.0.0.1:8090,成功,127.0.0.1/redmine也可以打開。 之前一直用http://127.0.0.1:8088/來打開,結(jié)果總報錯: Check the HTTP server's authentication settings. The HTTP server did not provide the username in the 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 '/': 雖然可以使用了,但是感覺用多端口比較麻煩,總忘記。再看看多站點怎么配置吧! |
|
來自: ala咪s > 《SCM_gerrit》