下载和赋权wget https://dl.gitea.io/gitea/master/gitea-master-linux-amd64
chmod +x gitea
mv gitea-master-linux-amd64 gitea
创建git用户和用户组adduser git
chown git.git /data/wwwroot/git.com/vim /etc/passwd
### 编辑
git:x:1005:1005:,,,:/home/git:/sbin/nologin
Nginx配置### Nginx配置反代
location / {
proxy_pass http://localhost:3000/;
}
Mysql数据库创建和配置
推荐使用phpmyadmin
守护进程&开机自启vim /etc/systemd/system/gitea.service
### 编辑
[Unit]
Description=Gitea (Git with a cup of tea)
After=syslog.target
After=network.target
After=mysqld.service
#After=postgresql.service
#After=memcached.service
#After=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
RestartSec=2s
Type=simple
User=git
Group=git
WorkingDirectory=/data/wwwroot/git.moegay.com
ExecStart=/data/wwwroot/git.moegay.com/gitea web
Restart=always
Environment=USER=git HOME=/home/git
[Install]
WantedBy=multi-user.targesystemctl daemon-reload
systemctl restart gitea
systemctl enable gitea
最后更新于 2018-04-24 01:20:31 并被添加「」标签,已有 70507 位童鞋阅读过。
本站使用「署名 4.0 国际」创作共享协议,可自由转载、引用,但需署名作者且注明文章出处
本文档详细介绍了如何在Linux系统上下载、安装和配置Gitea,包括设置Git用户、Nginx反向代理以及Mysql数据库的连接。此外,还提供了Gitea服务的Systemd配置文件,确保服务的自动重启和开机启动。
578

被折叠的 条评论
为什么被折叠?



