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
        


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM