Install GO language support and GOGS version management tools

1. Go Language:

1.1 introduction

1.1.1 Official introduction:

The Go programming language is an open source project to make programmers more productive.

Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It’s a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language.

1.1.2 In brief:

Go is a fast, new language for Google Home. You can reduce the complexity of your code without sacrificing application performance.

Optimized for programming applications on multiprocessor systems, Go programs can be as fast as C or C++, secure, and support parallelism.

1.2 installation

1.2.1 download:

website

The official download

The official documentation

Since my server is Ubuntu, I chose the package go1.9.2.linux-amd64.tar.gz.

1.2.2 installation:

Install it in /usr/local/go. Install it in /usr/local/go.

Sudo tar-c /usr/local/-zxvf go1.9.2.linux-amd64.tar.gz

When the file is in place, open /etc/profile and add an environment variable:

# /etc/profile

export GOROOT=/usr/local/go
export PATH=$GOROOT/bin:$PATH

To make the configuration effective:

source /etc/profile

Then type Go version directly into the shell and you should see the output version number:

$ go version
go1.9.2 linux/amd64

At this point, the Go language environment is installed. Next up is the Gogs.

2. Gogs

2.1 introduction

2.1.1 Official introduction

A self-service Git service that is very easy to set up.

2.1.2 In brief:

Gogs is a lightweight version control tool based on Git, similar to GitHub and GitLab.

But they are much lighter, running on blocks of Raspberry Pi or even NAS.

So-called: Easy to install + cross-platform + lightweight

All source code for the project is hosted on GitHub under an MIT license. Free to use!

There have been more than 2W Stars so far, as you can see.

2.2 installation:

2.2.1 download:

Directly download from the official website :(Chinese products, it’s the official website of Chinese)

Chinese official

The official download

Online experience

2.2.2 installation:

Unzip the downloaded linux_amd64-gogs.zip file. And place it where you want it, such as/WWW /gogs

Create a new file “custom/conf/app.ini” in the program directory and change the corresponding configuration items to automatically overwrite the default configuration.

Attend the official configuration manual

The program itself provides a variety of ways to deploy and start, but here we choose the simplest: Run directly:

Create the run_gogs script and write the following:

nohup /www/gogs/gogs web &

Then run sh./run_gogs.

You can also use the like supervisor to manage it if necessary:

Official Reference Configuration

[program:gogs]
directory=/www/gogs/
command=/www/gogs/gogs web
autostart=true
autorestart=true
startsecs=10
stdout_logfile=/var/log/gogs/stdout.log
stdout_logfile_maxbytes=1MB
stdout_logfile_backups=10
stdout_capture_maxbytes=1MB
stderr_logfile=/var/log/gogs/stderr.log
stderr_logfile_maxbytes=1MB
stderr_logfile_backups=10
stderr_capture_maxbytes=1MB
user = git
environment = HOME="/home/git", USER="git"