Installation Configuration centos-gitlab

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.

 
NOTE After mirroring deployed distal access is disabled by default, so direct access to the ECS server's public IP is GitLab not have access to the login screen, gitlab_opennet.sh script in the first run / alidata directory, open the remote access, and then and then access the public network IP GitLab to access the home page through a browser.

Method two: manual deployment

  1. Installation dependencies.
     
    sudo yum install -y curl policycoreutils-python openssh-server
  2. Set SSH boot from the start and start the SSH service.
     
    sudo systemctl enable sshd
    sudo systemctl start sshd
  3. Install Postfix to send notification messages.
     
    sudo yum install postfix
  4. Set Postfix boot from the start.
     
    sudo systemctl enable postfix
  5. Starting Postfix.
    1. Enter the command vim /etc/postfix/main.cfto open the main.cf file and find the following diagram elements:

    2. These lines of code changed inet_interfaces = all, then press the Esckey, then enter :wqand press Enter to save and close the main.cf file.
    3. Enter the command sudo systemctl start postfixto start Postfix service.
  6. Add GitLab package repository.
     
     curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
  7. 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 

Guess you like

Origin www.cnblogs.com/dengtang/p/11325089.html