Source: https://help.aliyun.com/document_detail/52857.html
Gitlab deployment environment
Method One: image deployment
Mirror Name: gitlab code management (Centos 64 Wei | gitlab) | mirroring help documentation
Enter image details page, click Buy Now and follow the prompts step of purchasing ECS instance.
After the purchase is complete, log ECS management console, in the left navigation bar, click the instance and enter the instance ECS list page, select the region ECS instances where purchased, purchase and find the ECS example, in obtaining the IP address of the instance column public IP address.
Method two: manual deployment
- Installation dependencies.
sudo yum install -y curl policycoreutils-python openssh-server
- Set SSH boot from the start and start the SSH service.
sudo systemctl enable sshd sudo systemctl start sshd
- Install Postfix to send notification messages.
sudo yum install postfix
- Set Postfix boot from the start.
sudo systemctl enable postfix
- Starting Postfix.
- Enter the command
vim /etc/postfix/main.cf
to open the main.cf file and find the following diagram elements: - These lines of code changed
inet_interfaces = all
, then press theEsc
key, then enter:wq
and press Enter to save and close the main.cf file. - Enter the command
sudo systemctl start postfix
to start Postfix service.
- Enter the command
- Add GitLab package repository.
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
- Installation GitLab.
sudo EXTERNAL_URL="GitLab服务器的公网IP地址" yum install -y gitlab-ce
8. Modify profile gitlab
Edit gitlab.rb
sudo gedit /etc/gitlab/gitlab.rb
The following data
external_url 'http://gitlab.example.com'
change to
external_url 'http://192.168.9.58:9696'
Port can be arbitrarily set, as long as no conflict on the line
After the change, you need to perform the following code
sudo gitlab-ctl reconfigure
Finally, access 192.168.9.58:9696 in the server browser, found to have been modified successfully
If you still can not access
9. Close the virtual machine firewall
At this visit 192.168.9.58:9696 on the host, and again could not open gitlab, now the need to shut down the VM firewall
Turn off the firewall ufw disable
1) permanently take effect after the restart will not recover (centos)
Open: chkconfig iptables on
Close: chkconfig iptables off
2) with immediate effect, after the restart recovery
Open: service iptables start
Close: service iptables stop
Check firewall status: service iptables status