In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to install Gogs in Centos8 system". In daily operation, I believe many people have doubts about how to install Gogs in Centos8 system. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to install Gogs in Centos8 system". Next, please follow the editor to study!
Centos8 environment
Gogs_0.11.91
Create a git user
[root@localhost ~] # useradd git [root@localhost ~] # echo '123456' | passwd-- stdin gitChanging password for user git.passwd: all authentication tokens updated successfully.
Set up sudo for git users
[root@localhost ~] # visudogit ALL= (ALL) NOPASSWD: ALL
Download and configure the basic environment
[root@localhost ~] # yum-y install tar wget git mariadb mariadb-server
Set mariadb to boot and start the mariadb service
[root@localhost] # systemctl enable mariadb-- now
Create a gogs database
# switch to git user [root@localhost ~] # su-git# create database [git@localhost ~] $mysql-u root-e "CREATE DATABASE IF NOT EXISTS gogs CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" [git@localhost ~] $mysql-u root-e "show databases "+-+ | Database | +-+ | gogs | | information_schema | | mysql | | performance_schema | +-+
Create a database gogs user and grant access to the gogs database:
[git@localhost ~] $mysql-u root-e "create user gogs; grant all privileges on gogs.* to gogs@'%' identified by 'gogs123';" # check whether the user gogs is added and whether all access rights are granted. [git@localhost ~] $mysql-u root-e "select Host,User,Password from mysql.user; show grants for gogs@'%';"
Download the gogs installation package
Download the installation package for the corresponding operating system from gogs's website https://gogs.io/docs/installation/install_from_binary.
[git@localhost ~] $wget https://dl.gogs.io/0.11.91/gogs_0.11.91_linux_amd64.tar.gz[git@localhost ~] $tar xvf gogs_0.11.91_linux_amd64.tar.gz
Start gogs and open the port of the firewall
[git@localhost gogs] $sudo firewall-cmd-- permanent-- add-port=3000/tcpsuccess [git@localhost gogs] $sudo firewall-cmd-- reloadsuccess [git@localhost] $/ home/git/gogs/gogs web
Open a browser and enter the ip address of the server, port 3000. Database user and password, use the one you just created. "apply URL" fill in the ip address of the gogs server. Then click install now.
After that, we enter the login screen and we can create a new user.
Go to the registration page and register the user.
Registration is complete, log in, we can click on my warehouse and create the first warehouse.
Copy the warehouse address and download the warehouse in your own operating system
Create a description file in the warehouse and upload it to the remote warehouse.
[root@localhost ~] # git clone http://192.168.60.137:3000/user01/example01.gitCloning into 'example01'...warning: You appear to have cloned an empty repository. [root@localhost ~] # cd example01/ [root@localhost example01] # echo "This is example01's README" > README.md [root@localhost example01] # git add. [root@localhost example01] # git config-global user.name user01 [root@localhost example01] # git config-- global user.email user01@example .com [root@localhost example01] # git commit-m "add a README.md" [master (root-commit) 9d7df1d] add a README.md 1 file changed 1 insertion (+) create mode 100644 README.md [root@localhost example01] # git pushEnumerating objects: 3, done.Counting objects: 100% (3 delta 3), done.Writing objects: 100% (3 done.Total 3), 240 bytes | 240.00 KiB/s, done.Total 3 (delta 0) Reused 0 (delta 0) Username for 'http://192.168.60.137:3000': user01Password for' http://user01@192.168.60.137:3000': To http://192.168.60.137:3000/user01/example01.git * [new branch] master-> master
You can see the upload success in the remote warehouse.
At this point, the study on "how to install Gogs in Centos8 system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.