There are several problems in your configuration:
- Apache and try to listen on the same port 8081, this is not possible
- You ProxyPass are not the best, this will create some minor problems. These problems are:
- Unable to create project names with a slash in it: main / sub
- When viewing files, a checkmark will not be displayed next to the file to display it as considered, again this is due to incorrect processing of the slash
- The most commonly used subfolder, not the root, I think it works better with reverse proxies.
This is my recommended configuration for you:
<VirtualHost *:80> ServerName localhost ProxyRequests Off ProxyVia Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> <Location "/"> AuthType Basic AuthName "Gerrit Code Review" AuthBasicProvider file AuthUserFile /usr/local/apache/passwd/passwords Require valid-user </Location> AllowEncodedSlashes On ProxyPass /r http://localhost:8081/r nocanon </VirtualHost>
Of course, don't forget to change gerrit.config, canonicalWebUrl is what you enter in the address bar, and not what apache uses to search for gerrit.
[gerrit] basePath = git canonicalWebUrl = http:
To prevent the default apache page from showing, add index.php to the root folder, which will redirect your browser to an additional path:
<?php header('Location: http://localhost:8082/r/'); ?>
source share