1)apache2 setting--------------------
<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 /opt/gerrit_web/etc/passwords
Require valid-user
</Location>
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>
2) gerrit setting
[gerrit]
basePath = git
canonicalWebUrl = http://192.168.0.240
[database]
type = h2
database = db/ReviewDB
[index]
type = LUCENE
[auth]
type = http
[sendemail]
enable=true
smtpServer=xxxxxx
smtpServerPort=25
sslVerify=false
smtpUser=gerrit@xxxxx
smtpPass=xxxxxx
from=gerrit@xxxxxxx
[container]
user = jason
javaHome=/opt/java/jdk1.7.0_67/jre
[sshd]
listenAddress = *:29418
[httpd]
listenUrl = proxy-http://localhost:8080/
[cache]
directory = cache
[accounts]
visibility = ALL
[gitweb]
cgi = /usr/share/gitweb/gitweb.cgi