官网教程上面的第一步是安装curl、ssh、postfix和cronie工具。第一个工具用于下载安装包,第二个用于安全访问和文件传输,第三个是用来搭建自己的邮箱服务器,第四个是linux定时任务工具。因为我们的机器连不了外网,所以不需要安装curl。因为我们的机器本来就安装好了sshserver、postfix和cronie,所以,我只需执行下面的第2、3、4条命令。它们的作用是启动postfix和允许外部通过80端口和22端口访问本机。
sudo yum install curl openssh-server openssh-clients postfix cronie
sudo service postfix start
sudo chkconfig postfix on
sudo lokkit -s http -s ssh
sudo yum install policycoreutils-python
sudo chkconfig postfix on
systemctl enable postfix.service
gitlab中文网站:https://www.gitlab.cc/downloads/#centos6
中文官网下载安装包地址:
https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/
gitlab-ce-10.5.0-ce.0.el6.x86_64.rpm
rpm -qa|grep gitlab rpm -e --nodeps gitlabxxxxx
rpm -ivh gitlab-ce-10.5.0-ce.0.el6.x86_64.rpm
安装完成之后,会出现如下页面,里面包含很多有用的信息,所以截图如下
[root@iZbp19yhul3o6tcqf0czjvZ local]# rpm -ihv gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm Preparing... ################################# [100%] Updating / installing... 1:gitlab-ce-8.0.0-ce.0.el7 ################################# [100%] gitlab: Thank you for installing GitLab! gitlab: To configure and start GitLab, RUN THE FOLLOWING COMMAND: sudo gitlab-ctl reconfigure gitlab: GitLab should be reachable at http://iZbp19yhul3o6tcqf0czjvZ gitlab: Otherwise configure GitLab for your system by editing /etc/gitlab/gitlab.rb file gitlab: And running reconfigure again. gitlab: gitlab: For a comprehensive list of configuration options please see the Omnibus GitLab readme gitlab: https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md gitlab: It looks like GitLab has not been configured yet; skipping the upgrade script. [root@iZbp19yhul3o6tcqf0czjvZ local]# |
vim /etc/gitlab/gitlab.rb
Vim /var/opt/gitlab/gitlab-rails/etc/gitlab.yml (修改gitlab--》 host 为本机IP即可)
将gitlab.example.com 改为 本机地址(http://192.168.8.110) ,在访问的时候就不需要配置host 了
## GitLab URL ##! URL on which GitLab will be reachable. ##! For more details on configuring external_url see: ##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab external_url 'http://192.168.8.110' |
可以关闭防火墙
firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status firewalld 开机禁用 : systemctl disable firewalld 开机启用 : systemctl enable firewalld |
使用命令:sudo gitlab-ctl reconfigure(参考安装成功后的提示信息)
(gitlab-ctl restart)重启gitlab
关闭:gitlab-ctl stop
开启:gitlab-ctl start
查看状态:gitlab-ctl status
执行了上面的步骤,如果没有exception,就表示安装成功了。
(启动时间会比较长)
第一次访问,默认用户是root,要求输入密码。
创建普通用户
1、创建用户,找到users , 创建用户,输入用户名,邮箱,确认提交。
2、修改用户的密码即可。
分配项目权限:Settings --> members
1、使用http方式:先复制连接
输入用户名和密码
next就完成了
1、rpm -ivh gitlab-ce-10.5.0-ce.0.el6.x86_64.rpm 出现报错
error: Failed dependencies:
policycoreutils-python is needed by gitlab-ce-10.5.0-ce.0.el6.x86_64
原因:10.x以后开始依赖policycoreutils-python,9.x时还没有依赖该项
解决:
安装gitlab的依赖项即可
yum install policycoreutils-python
2、代码提交不上去
解决:
Root用户登陆,进入设置:
修改其默认设置即可。