Git server-gogs Build

Source: Internet
Author: User
Tags percona git commands

1, Gogs

A git server for Go language development

2. Software dependencies

2.1. Git install:

# yum-y Install git

2.2. mysql Installation

1 # yum-y Install percona-server-server-55-5.5.45-rel37.4.el6.x86_64.rpm percona-server-client-55-5.5.45-rel37.4.el6.x86_64.rpm  percona-server-shared-55-5.5.45-rel37.4.el6.x86_64. RPM23#  service mysql start45#  /usr/bin/ Mysql_secure_installation # Log in with security settings MySQL,67mysql-u root-p

The above is using Percona mysql, you can also use the mariadb. The MySQL version of CentOS6.5 is too low , and when installed, a coded message affects: In the Gogs installation directory, bring a mysql.sql cat and see a utf8mb4.

2.3. Installation

The Gogs service runs as a git user:

# Useradd Git

# Su-git

$ CD Gogs

Download Gogs installer gogs0.11.4_amd64.tar.gz, upload to CentOS and unzip, generate Gogs directory, inside is gogs all files.

Initialize the database:

$ mysql-uroot-p < Scripts/mysql.sql # is actually creating a gogs library, using Gogs's formatted SQL, note that root is not the root of the operating system, so as long as you have the root password, You can log in anywhere.

# # Create a MySQL user gogs for the Gogs Library and authorize

Mysql> GRANT all on gogs.* to ' gogs ' @ ' percent ' identified by ' gogs ';

MySQL > FLUSH privileges;

2.4. Configuration:

Configuration file:

Official reference: https://gogs.io/docs/advanced/configuration_cheat_sheet.html

      

① creating Custom/conf/app.ini Profiles in Gogs Catalog Department

② writes the following content:

1App_name =Jerry2Run_user =git3Run_mode =prod4 5 [Server]6HTTP_ADDR = 0.0.0.07Http_port = 30008DOMAIN = 192.168.112.1119Root_url = Http://192.168.112.111:3000/TenDisable_ssh =false OneSsh_port = 22 AStart_ssh_server =false -Offline_mode =false -  the [Database] -Db_type =MySQL -HOST = 127.0.0.1:3306 -NAME =Gogs +USER =Gogs -PASSWD =Gogs +Ssl_mode =Disable APATH = data/gogs.db at  - [Security] -Install_lock =false -Secret_key = JQPYMLFC8X33FC2
App.ini

  

2.5. Start Gogs

① can be started with the Gogs command

$./gogs Web

② added to the power-on-startup script

      Note : Create a log directory under the Gogs directory, otherwise the script will not start.

The following script uses the root user action:

      

2.6 First Time Login:

Http://192.168.111.111:3000/install

Enter the installation interface:

Modify the following points:

① Domain name: Use your own IP address, not just log in locally

② app URL Http://192.168.111.111:3000/

③ Note Here is an optional setting, remember to ban off, because the boot will default to find the project here, the network is very slow, and also inaccessible, so ban off.

      

then click Install;

Need to register the first user, the first user as the administrator account directly.

After the administrator logs in, there is a control Panel:

        

You can then create a normal user. The next step is the use of GIT commands, and the Gogs page operation.

    

    

Git server-gogs Build

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.