• 在Linux上安装Gogs(CentOS7、Red Hat7、中标麒麟服务器版V7)


    主要是安装这些东西:Git、MySQL、Gogs

    MySQL安装可以参考https://www.cnblogs.com/levia/p/11396512.html

    这里记录我我执行过的命令(随意记录的可能没什么参考价值)

    yum -y install git
    git --version
    rpm -qa|grep -i mysql
    rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
    rpm -qa|grep mariadb
    reboot
    mkdir /usr/local/mysql8
    cd /usr/local/mysql8
    cat /etc/redhat-release
    wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.25-1.el7.x86_64.rpm-bundle.tar
    tar -xvf mysql-8.0.25-1.el7.x86_64.rpm-bundle.tar
    rpm -ivh mysql-community-common-8.0.25-1.el7.x86_64.rpm
    yum list mysql-community-client-plugins
    rpm -ivh mysql-community-client-plugins-8.0.25-1.el7.x86_64.rpm
    rpm -ivh mysql-community-libs-8.0.25-1.el7.x86_64.rpm
    rpm -ivh mysql-community-libs-compat-8.0.25-1.el7.x86_64.rpm
    rpm -ivh mysql-community-devel-8.0.25-1.el7.x86_64.rpm
    rpm -ivh mysql-community-client-8.0.25-1.el7.x86_64.rpm
    rpm -ivh mysql-community-server-8.0.25-1.el7.x86_64.rpm
    rpm -ivh mysql-community-embedded-compat-8.0.25-1.el7.x86_64.rpm
    systemctl status mysqld
    systemctl start mysqld
    grep -i password /var/log/mysqld.log
    net start mysql
    mysql -u root -p 'mysql'
    systemctl stop firewalld.service
    systemctl disable firewalld.service
    cd ../
    tar -zxvf gogs_0.12.3_linux_amd64.tar.gz
    cd gogs
    cd var
    cd /
    mv /usr/local/gogs /home/git/
    cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system/
    ./gogs web
    sudo systemctl start gogs.service
    sudo systemctl enable gogs.service
    systemctl reload gogs.service
    systemctl restart gogs.service
    

    gogs.service

    [Unit]
    Description=Gogs
    #After=syslog.target
    After=network.target
    #After=mysqld.service
    
    [Service]
    # Modify these two values and uncomment them if you have
    # repos with lots of files and get an HTTP error 500 because
    # of that
    ###
    #LimitMEMLOCK=infinity
    #LimitNOFILE=65535
    #Type=simple
    User=root
    #Group=git
    WorkingDirectory=/home/git/gogs
    ExecStart=/home/git/gogs/gogs web
    Restart=always
    #Environment=USER=root HOME=/home/git
    
    # Some distributions may not support these hardening directives. If you cannot start the service due
    # to an unknown option, comment out the ones not supported by your version of systemd.
    # ProtectSystem=full
    # PrivateDevices=yes
    # PrivateTmp=yes
    # NoNewPrivileges=true
    
    [Install]
    WantedBy=multi-user.target
    

    安装完成之后如果没改过端口,访问3000即可看到gogs的页面。

  • 相关阅读:
    算法与数据结构——图
    算法与数据结构——栈与队列
    数据结构与算法——线性表(完结)
    算法与数据结构——串
    算法与数据结构——树(完结)
    关于 prometheus 向 gateway 推送的备忘
    如何 在vs 2022 中使用 .net 4 , 4.5 ,等低版本 framework进行开发
    点赞模块设计 Redis缓存 + 定时写入数据库实现高性能点赞功能
    List数组使用stream根据时间进行排序实现
    linux上安装git
  • 原文地址:https://www.cnblogs.com/cluyun/p/14911385.html
Copyright © 2020-2023  润新知