(Notes) Notes (2020)

Up and running private GIT server with GUI

10 years ago I have installed SVN Избавляемся от Team Foundation Server - ставим Subversion and it still working fine. Also I have a lot various account in different GIT server, also many times I have installed private Windows GIT server in local network, but now I need to install my own private GIT server with full web access and full Github functionality. There are a lot of GIT server GUI, even better than Github, for example https://secure.phabricator.com/ (with chatting room, forum, useful links in dashboard, Q&A and mockup tools and so on), but in my case I need a simple clone of Github. For this purpose I select https://gogs.io/.

And below I want to show full cyrcle how to install and use GIT with GOGS GUI in Ubintu.

So, first step is prepare Ubuntu

# sudo apt-get update
# sudo apt-get upgrade
# sudo reboot

1. Install and tune MySQL.

Install MySQL

# sudo apt install mysql-server
# sudo mysql_secure_installation
# sudo systemctl status mysql.service


Set remote mode on, try to connect remotelly. Not need step in common, but in my case this step is needed.

# cd /etc/mysql/mysql.conf.d
# sudo nano mysqld.conf
# sudo systemctl restart mysql.service


Crete new user, create database, grant user access to database.

# mysql -u root -p


2. Install and check GIT engine.

# sudo apt-get install nginx git nano fcgiwrap apache2-utils -y

Access control to GIT may be organize by many ways. First way is described in original GIT documentation https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server. In this case I have generated public key in my GIT client, created new account in server add add my public key to GIT server account.

# sudo adduser git
# su git
# cd
# pwd
# mkdir .ssh && chmod 700 .ssh
# touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys
# cd .ssh
# nano authorized_keys


Second way is access control by htpasswd and nginx. In this case I have created user Cryprochest and access to GIT repository by password stored in htpasswd.

sudo mkdir /var/www/html/git
sudo chown -R www-data:www-data /var/www/html/git
sudo nano /etc/nginx/sites-available/default
sudo nginx -t

This is my nginx config.



sudo htpasswd -c /var/www/html/git/htpasswd cryptochest
sudo systemctl restart nginx
cd /var/www/html/git
sudo mkdir frontend.git
cd frontend.git
sudo git --bare init
sudo git update-server-info
sudo chown -R www-data:www-data .
sudo chmod -R 755 .


This is full workable solution, but GUI is nothing at all. I check how private GIT repository is working and check size after Git push.

# ls -la /var/www/html/git/frontend.git/objects/pack


# cd /var/www/html/git/frontend.git
# git log


3. Install clone of Github.

So, if GIT is working and MySQL is working too, we can go ahead and install GOGS.

First step is download Gogs.

# sudo curl https://dl.gogs.io/0.12.3/gogs_0.12.3_linux_amd64.tar.gz | tar -xz


Than need to start gogs.

# ./gogs web .


In first start you usually will receive various errors, you can check it by

# cat /log/gogs.log
# ./gogs --help
# ./gogs web --help
# ps -aux | grep gogs
# sudo netstat -nlp | grep :22
# sudo ss -lptn


After first start gogs configuration file will be created and you will see gogs setup web form.



If something going wrong you can delete this file and fry to start from beginning.



Instalation configuration is huge and main mistake in documentation (in m opinion) is statement that admin account in last section is optional and not needed.



But finally, I'm sure, you will receive workable config and will be redirected inside gogs.



Thats it, installation is done.

4. Configure Gogs as service.

# cd /etc/systemd/system
# ls -la
# sudo nano gogs.service 

This is my gogs.service config



# sudo systemctl daemon-reload
# sudo systemctl start gogs
# sudo systemctl enable gogs

Thats it, since than you will enjoy own private clone of Microsoft Github, but without Microsoft.





Comments ( )
<00>  <01>  <02>  <03>  <04>  <05>  <06>  <07>  <08>  <09>  <10>  <11>  <12>  <13>  <14>  <15>  <16>  <17>  <18>  <19
Link to this page: http://www.vb-net.com/PrivateGIT/Index.htm
<SITEMAP>  <MVC>  <ASP>  <NET>  <DATA>  <KIOSK>  <FLEX>  <SQL>  <NOTES>  <LINUX>  <MONO>  <FREEWARE>  <DOCS>  <ENG>  <MAIL ME>  <ABOUT ME>  < THANKS ME>