Important
sudo
must be executed as root user.
sudo yum update -y
sudo yum install git -y
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-users.html
https://repost.aws/knowledge-center/new-user-accounts-linux-instance
# root user
sudo mkdir /srv/git
sudo chown -R git:git /srv/git
# git user
mkdir /srv/git/repo.git
cd repo.git
git init --bare
User:
git clone git@address:/srv/git/repo.git
sudo yum install git-daemon -y
sudo mkdir /srv/git/public
Command
git daemon --verbose --base-path=/srv/git/public --export-all --reuseaddr --detach /srv/git/public
System service (recommended)
sudo vim /etc/systemd/system/git-daemon.service
sudo systemctl enable git-daemon
User
git clone git://address/public.git
sudo systemctl start httpd
sudo systemctl enable httpd
sudo yum install gitweb git-instaweb -y
cd path/to/repo.git
git instaweb --httpd=httpd
# http://ipaddress:1234
our $projectroot = "/srv/git/public";
/etc/httpd/conf.d/gitweb.conf
Alias /git /var/www/git
sudo systemctl restart httpd
# http://ipaddress/git
/etc/httpd/conf.d/gitweb.conf
<VirtualHost *:80>
ServerName gitserver
DocumentRoot /var/www/git
<Directory /var/www/git>
…
</Directory>
</VirtualHost>
sudo systemctl restart httpd
# http://ipaddress
sudo dnf install -y certbot python3-certbot-apache
sudo systemctl daemon-reload
sudo systemctl enable --now certbot-renew.timer
sudo certbot --apache