• 在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的页面。

  • 相关阅读:
    Android和kernel杂散点集合
    Kernel的IIC驱动分析
    Uboot流程分析
    关于在eclipse当中,对接口方法的实现使用@Override报错的解决方式
    任务调度工具oozie和azkaban的对比
    实现Linux和windows之间实现文件传输的问题解决方式。sftp和ftp
    使用spring-boot创建定时任务。同时创建多线程执行定时任务。
    【C++11】新特性——auto的使用
    Inline函数使用注意事项
    结构体变量的sizeof计算
  • 原文地址:https://www.cnblogs.com/cluyun/p/14911385.html
Copyright © 2020-2023  润新知