I am using centos 7 64bit here, I have tried centos 6 and it is also possible!
1. Install dependent software
yum -y install policycoreutils openssh-server openssh-clients postfix
2. Set postfix to start and start automatically after booting, postfix supports gitlab sending function
systemctl enable postfix && systemctl start postfix
3. Download the gitlab installation package, then install
Download address of centos 6 system: https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6
Download address of centos 7 system: https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7
Mine is centos7, so I found a gitlab8.0.0 version in https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7. It is recommended to download a relatively new version, I chose here An older version is just an experiment
Download the rpm package and install:
wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm
rpm -i gitlab-ce-8.0.0-ce.0.el7.x86_64.rpm
**4. Modify the gitlab configuration file to specify the server ip and custom port: **
vim /etc/gitlab/gitlab.rb
Exit and save
ps: Note that the port set here cannot be occupied, the default is port 8080, if 8080 has been used, please customize other ports, and open the corresponding port in the firewall settings
5. Reset and start GitLab
carried out:
gitlab-ctl reconfigure
gitlab-ctl restart
ok: run: gitlab-git-http-server:(pid 3922) 1s
ok: run: logrotate:(pid 3929) 0s
ok: run: nginx:(pid 3936) 1s
ok: run: postgresql:(pid 3941) 0s
ok: run: redis:(pid 3950) 0s
ok: run: sidekiq:(pid 3955) 0s
ok: run: unicorn:(pid 3961) 1s
Prompt "ok: run:" indicates successful startup
6. Visit GitLab page
If there is no domain name, directly enter the server ip and designated port for access
Initial account: root Password: 5iveL!fe
First login to change password
6. To set up the gitlab sending function, you need to pay attention to:
The default postfix used by the sending system, smtp is enabled by default, both of which are enabled, neither of them will work.
I set to close smtp here and open postfix
Close smtp method: vim /etc/gitlab/gitlab.rb
Find #gitlab_rails['smtp_enable'] = true and change to gitlab_rails['smtp_enable'] = false
Execute gitlab-ctl reconfigure after modification
The other is to turn off postfix and set to turn on smtp. For related tutorials, please refer to the official website https://doc.gitlab.cc/omnibus/settings/smtp.html
Test whether it can be notified by email:
Log in and add a user, here I use qq mailbox to add a user
Log in to the qq mailbox, you can receive an email notification (if you can't receive it, please check the spam mailbox or check whether the email is blocked and deleted. If so, please add to the whitelist and delete the user and add the user again to receive it, otherwise please check Mail log and make relevant settings)
Error handling:
Generally it is a permission problem, the solution: chmod -R 755 /var/log/gitlab
If it still doesn’t work, please check your memory. Installing and using GitLab requires at least 4GB of available memory (RAM + Swap)! Since the operating system and other running applications also use memory, be sure to note that the current server has at least 4GB before installing GitLab Available memory. Less than 4GB of memory will cause various weird problems, and 500 errors often occur during use.
Error n itdb: could not obtain information about current user: Permission denied
Error executing action run
on resource 'execute[/opt/gitlab/embedded/bin/initdb -D /var/opt/gitlab/postgresql/data -E UTF8]'
According to the error message, the user's permission problem is probably locked. Installing gitlab-ce will automatically add four users:
gitlab-www:x:497:498::/var/opt/gitlab/nginx:/bin/false
git:x:496:497::/var/opt/gitlab:/bin/sh
gitlab-redis:x:495:496::/var/opt/gitlab/redis:/bin/nologin
gitlab-psql:x:494:495::/var/opt/gitlab/postgresql:/bin/sh
Both Google and Baidu could not search for a solution. Since the error prompts the permission problem, there will be no problem if you follow this direction to check. Later, after checking the file /etc/passwd permission is 600, after giving 644 permission, the error was successfully resolved. problem
Refer to gitlab Chinese official website https://www.gitlab.cc/downloads/#centos7
Recommended Posts