Installing Cgit on CentOS 7

Get all the packages installed:

sudo yum install git-all httpd perl-Time-HiRes cgit composer highlight httpd-tools mariadb mariadb-server mod_ssl openssl pandoc patch php php-gd php-intl php-mysql php-tidy php-xcache php-xml python-markdown python-pygments

Set up the git user:

sudo /usr/sbin/groupadd git

sudo /usr/sbin/useradd -c "git user account" -d /srv/git -m -g git -s /bin/bash git

sudo passwd git

sudo usermod -aG git apache

sudo usermod -aG apache git

sudo usermod -aG git git

Give http a swift restart:

sudo systemctl restart httpd

Edit the cgit repo file to use cgit repos

sudo vi /etc/cgitrc

##and included like this:



Create our first repo

sudo vi /etc/cgitrepos

section=Erik’s Really Cool Stuff



repo.desc=Erik repository



make the repo and set the permissions:

sudo mkdir /srv/git/erik.git/

sudo git init --bare /srv/git/erik.git

sudo chmod -R 2775 /srv/git/

sudo chown -R erik.git /srv/git/

Test it 

git config –global “Erik”

git config –global

git init

git remote add origin

git add .

git commit -m “Initial commit”

git push -u origin master



sudo systemctl stop httpd

sudo rm -f /var/cache/cgit/*

sudo systemctl start httpd
Facebooktwittergoogle_plusredditpinterestlinkedinmailby feather