Install the Go language support and Gogs version management tool
1. GO:
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, user-friendly new language for Google. You can reduce code complexity without losing application performance.
Optimized specifically for programming applications on multiprocessor systems, Go programs are as fast as C or C++, safe, and parallelistic.
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:
The installation is quite simple. Just download the installation package and decompress it to /usr/local/go.
sudo tar -C /usr/local/ - ZXVF go1.9.2. Linux - amd64. Tar. GzCopy the code
Open /etc/profile and add an environment variable to it:
# /etc/profile
export GOROOT=/usr/local/go
export PATH=$GOROOT/bin:$PATH
Copy the code
For the configuration to take effect:
source /etc/profile
Copy the code
Go version = go version = go version = go version = go version
$Go version GO1.9.2 Linux/AMd64Copy the code
At this point, the GO environment is installed. Next up is the Gogs.
2. Gogs
2.1 introduction
2.1.1 Official Introduction
An easy to set up Git self-service service.
2.1.2 In brief:
Gogs is a lightweight Git-based version control tool similar to Github and Gitlab.
But they are much lighter, and can run on a Raspberry Pi or even a NAS mainframe.
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!
So far, it’s more than 2W Stars. You can see that.
2.2 installation:
2.2.1 download:
Direct official website download :(Chinese products, is the Chinese official website)
Chinese official
The official download
Online experience
2.2.2 installation:
Decompress the downloaded linux_amd64-gogs.zip file. And put it where you want, like/WWW /gogs
Ini file: custom/conf/app.ini. Create a new file in the program directory: custom/conf/app.ini.
Attach the official configuration manual
The application 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 &
Copy the code
Then run sh./run_gogs.
You can also use something like Supervisor to manage it if you need to:
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"
Copy the code