gitea安装

0、环境说明

系统:Centos7

数据库版本:mariadb 5.5.68

1、安装数据库

这里使用 yum 安装 centos7 默认的 mariadb 数据库

yum install mariadb-server -y

对数据库进行初始化

mysql_secure_installation

运行结果如下

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL 
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! 
In order to log into MySQL to secure it, we'll need the current 
password for the root user. If you've just installed MySQL, and 
you haven't set the root password yet, the password will be blank, 
so you should just press enter here. 
Enter current password for root (enter for none):<–初次运行直接回车 
OK, successfully used password, moving on… 
Setting the root password ensures that nobody can log into the MySQL 
root user without the proper authorisation. 
Set root password? [Y/n]    #是否设置root用户密码,输入y并回车或直接回车 
New password:               #设置root用户的密码 
Re-enter new password:      #再输入一次你设置的密码 
Password updated successfully! 
Reloading privilege tables.. 
… Success! 
By default, a MySQL installation has an anonymous user, allowing anyone 
to log into MySQL without having to have a user account created for 
them. This is intended only for testing, and to make the installation 
go a bit smoother. You should remove them before moving into a 
production environment. 
Remove anonymous users? [Y/n]   #是否删除匿名用户,生产环境建议删除,所以直接回车 
… Success! 
Normally, root should only be allowed to connect from 'localhost'. This 
ensures that someone cannot guess at the root password from the network. 
Disallow root login remotely? [Y/n] #是否禁止root远程登录,根据自己的需求选择Y/n并回车,建议禁止 
… Success! 
By default, MySQL comes with a database named 'test' that anyone can 
access. This is also intended only for testing, and should be removed 
before moving into a production environment. 
Remove test database and access to it? [Y/n] #是否删除test数据库,直接回车 
- Dropping test database… 
… Success! 
- Removing privileges on test database… 
… Success! 
Reloading the privilege tables will ensure that all changes made so far 
will take effect immediately. 
Reload privilege tables now? [Y/n] #是否重新加载权限表,直接回车 
… Success! 
Cleaning up… 
All done! If you've completed all of the above steps, your MySQL 
installation should now be secure. 
Thanks for using MySQL! 

2、创建git用户(组)

groupadd git
useradd -g git git -s /bin/git-shell

上面命令创建了一个git用户并加入了git用户组(并且为了安全禁止使用shell登录,这个创建用户后也可以在/etc/passwd文件里修改),我们接下来就用这个git用户运行gitea程序。

当然这一步不做也可以,不用git用户的话用当前用户或者root用户也可以,只是在配置gitea的时候要注意一下

3、创建gitea数据库

进入数据库执行如下代码

create database gitea DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE USER 'gitea_user'@'localhost' IDENTIFIED BY 'git_password';
GRANT ALL PRIVILEGES ON gitea.* TO gitea_user@localhost IDENTIFIED BY 'gitea_password';
FLUSH PRIVILEGES;

4、下载gitea安装包

访问 gitea | Gitea 下载对应自己系统的安装包,并上传至服务器

 5、启动gitea

第一次启动gitea

chmod +x gitea
./gitea web

5、配置gitea

 http://ip:3000 web默认端口在3000,打开gitea页面之后,随便点击界面上的按钮(注册,登录之类的),或者在地址后加上/install,会跳转到『初始配置』页面进行安装前的配置,如下图:

 

 这里的配置按照自己的实际情况来就可以了,配置完之后安装即可
配置之后也是可以更改的,gitea的配置文件在gitea/custom/conf/app.ini
具体的配置项可以去官方文档查看.

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
如果您想在Windows上安装Gitea,可以按照以下步骤进行操作。 1. 首先,您需要前往Gitea的官方网站,并下载适用于Windows的最新版本的Gitea可执行文件。 2. 下载完成后,您可以双击可执行文件,然后按照安装向导的指示进行安装。您可以选择安装路径和其他设置。 3. 安装完成后,您可以在开始菜单或桌面上找到Gitea的快捷方式。双击打开Gitea。 4. 第一次运行Gitea时,您需要填写一些配置信息,例如数据库类型、数据库连接信息、管理员用户名和密码等。根据您的需求和网络环境,进行相应的配置。 5. 配置完成后,您可以选择启动Gitea服务。Gitea将会在指定的端口上监听请求,并通过浏览器访问该端口以进入管理界面。 通过以上步骤,您就可以在Windows上成功安装Gitea,并开始管理自己的项目代码了。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [Gitea在windows平台的安装和简单使用教程](https://blog.csdn.net/wajun111/article/details/124239952)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [Gitea在Windows平台的安装和启动教程](https://blog.csdn.net/ngwngw/article/details/129830979)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

曼走丶999

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值