!Failing | Gerrit EC2 server connect with Github | AWS Ec2

1

Hi, I have created a gerrit EC2 server using security groups as: (Using EC2 service) I am entering the EC2 instance from UI Start instance button (EC2 instance Connect)

  1. Type: All Type Source: My IP
  2. Type: SSH Source: Ipv4
  3. Type: All TCP Source: My IP

With above and following Gerrit installation steps, I am able to view the gerrit server using public DNS. Steps followed for installation of gerrit server & gerrit user creation:

1. apt-get update
2. apt-get install default-jdk
3. wget https://gerrit-releases.storage.googleapis.com/gerrit-3.5.1.war
4. java -jar gerrit-3.5.1.war init --batch -d ~/gerrit_example
5. sudo ufw allow 8080
6. sudo apt install apache2 apache2-utils
7. git config --file ~/gerrit_example/etc/gerrit.config auth.type HTTP
8. git config --file ~/gerrit_example/etc/gerrit.config httpd.listenUrl 'proxy-http://*:8080/'
9. git config --file ~/gerrit_example/etc/gerrit.config gerrit.canonicalWebUrl 'http://ec2-44-212-65-224.compute-1.amazonaws.com/'
10. git config --file ~/gerrit_example/etc/gerrit.config download.scheme ssh
11. ~/gerrit_example/bin/gerrit.sh restart
12. sudo a2enmod proxy_http
13. sudo a2dissite 000-default
14. sudo a2enmod proxy_http
15. vi /etc/apache2/sites-available/010-gerrit.conf
And add below:
<VirtualHost *:80>
  ServerName ec2-54-173-2-2.compute-1.amazonaws.com
  ProxyRequests off
  ProxyVia off
  ProxyPreserveHost on
  <Proxy *>
      Order deny,allow
      Allow from all
  </Proxy>
  <Location />
      AuthType Basic
      AuthName "Gerrit Code Review"
      Require valid-user
      AuthUserFile /etc/apache2/gerrit.passwd
  </Location>
  AllowEncodedSlashes on
  ProxyPass / http://127.0.0.1:8080/ nocanon
  ProxyPassReverse / http://127.0.0.1:8080/ nocanon
  ErrorLog /var/log/apache2/gerrit.error.log
  CustomLog /var/log/apache2/gerrit.access.log combined
</VirtualHost>

16. sudo htpasswd -c /etc/apache2/gerrit.passwd admin
  -> SET PASSWORD FOR USER ADMIN
17. sudo a2ensite 010-gerrit
18. sudo service apache2 reload

Post above steps, able to view gerrit server with username admin login.

Now I want to have a gerrit repository. For this I have a github repo on normal github repository. I want a mechanism to push and review code on gerrit for this github repo such that any changes reviewed on gerrit must be updated on github as well.

I followed below steps:

1. git clone <GitHub repository URL: https://github.com/<xyz>/<xyz.git> >
2. cd <repository_name>
3. git remote add gerrit <Gerrit SSH URL> (<gerrit_username>@<hostname>:<port>/<xyz.git>)
4. git push gerrit HEAD:refs/for/master

On 4 step, getting access denied issues. Access denied issue

Created ssh key using below command and added to the gerrit Access rights. SSh key generation

Post this also, getting Access denied issues.

Tried to ping the hostname and it got pinged. Tried to debug the <user>@<hostname> and got connection timed out while connecting to the hostname server port 29418 as below Connection debugging

Pleas help on the same as per the requiremnt. Requirement:

Now I want to have a gerrit repository. For this I have a github repo on normal github repository. I want a mechanism to push and review code on gerrit for this github repo such that any changes reviewed on gerrit must be updated on github as well.

Arjit
asked 9 days ago146 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions