centos 安装gitea

  • 安装Git

    • yum -y install git
      
  • 下载Gitea,下载最新的版本可以参考https://dl.gitea.io/gitea

    • wget -O gitea https://dl.gitea.io/gitea/1.12.3/gitea-1.12.3-linux-amd64
      
  • 在下载到Gitea的目录下,修改权限

    • chmod +x gitea
      
  • 运行Gitea

    • ./gitea web
      
    • 后台运行:nohup ./gitea web &
      
  • 使用服务来启动

    • 新建一个文件

      • vi /usr/lib/systemd/system/gitea.service
        
      • 写入

      • [Unit]
        Description=gitea
        
        [Service]
        User=root
        ExecStart=gitea的安装路径
        Restart=on-abort
        
        [Install]
        WantedBy=multi-user.target
        
    • 重载daemon,让新的服务文件生效

      • systemctl daemon-reload
        
    • 现在可以用systemctl来启动gitea了:

      • systemctl start gitea
        
    • 设置开机重启

      • systemctl enable gitea
        
    • 停止查看状态

      • systemctl stop gitea
        
        systemctl status gitea
        
posted @ 2020-08-18 19:08  Myuniverse  阅读(784)  评论(0编辑  收藏  举报