gogs下载:https://gogs.io/docs/installation/install_from_binary
gogs提供的压缩包 提供了service文件,路径:
/scripts/systemd/gogs.service
gogs.service 默认配置如下:
[Unit] Description=Gogs After=syslog.target After=network.target After=mariadb.service mysqld.service postgresql.service memcached.service redis.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=git Group=git WorkingDirectory=/home/git/gogs ExecStart=/home/git/gogs/gogs web Restart=always Environment=USER=git 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
根据自己的情况进行修改,然后将gogs.service cp到 /usr/lib/systemd/system/ 目录下
启动:
systemctl start gogs.service
开机自启:
systemctl enable gogs.service
1.如需转载本站原创文章,请务必注明文章出处并附上链接,非常感谢。
2.本站用于记录个人 工作、学习、生活,非商业网站,更多信息请 点击这里
上一篇: vue2与vue3的区别对比
下一篇: 不建议移动端网页使用rem单位布局