Gerrit 2.12.x無法view diff

安裝配置好gerrit之後,push完代碼之後,無法打開每一個非工程根目錄下的文件進行view。

報錯如下:

The page you requested was not found, or you do not have permission to view this page.


原因是因爲:

(源自:https://bugs.chromium.org/p/gerrit/issues/detail?id=3081&q=The%20page%20you%20requested%20was%20not%20found%2C%20or%20you%20do%20not%20have%20permission%20to%20view%20this%20page.&colspec=ID%20Type%20Stars%20Milestone%20Status%20Priority%20Owner%20Summary

https://review.cyanogenmod.org/Documentation/config-reverseproxy.html#_apache_2_configuration)


To run Gerrit behind an Apache server using 'mod_proxy', enable thenecessary Apache2 modules:

  a2enmod proxy_http
  a2enmod ssl          ; # optional, needed for HTTPS / SSL

Configure an Apache VirtualHost to proxy to the Gerrit daemon,setting the 'ProxyPass' line to use the 'http://' URL configuredabove. Ensure the path of ProxyPass and httpd.listenUrl match,or links will redirect to incorrect locations.

	<VirtualHost *>
	  ServerName review.example.com

	  ProxyRequests Off
	  ProxyVia Off
	  ProxyPreserveHost On

	  <Proxy *>
	    Order deny,allow
	    Allow from all
	  </Proxy>

	  AllowEncodedSlashes On
	  ProxyPass /r/ http://127.0.0.1:8081/r/ nocanon
	</VirtualHost>

The two options 'AllowEncodedSlashes On' and 'ProxyPass .. nocanon' are required since Gerrit 2.6.


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章