|
[root@Gitlab ~]#dnf update -y [root@Gitlab ~]#reboot
[root@Gitlab ~]#curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
[root@Gitlab ~]#dnf install -y gitlab-ce #Thêm tên miền [root@Gitlab ~]#nano /etc/gitlab/gitlab.rb EXTERNAL_URL="http://tenmiencuaban" #Apply các thay đổi [root@Gitlab ~]#gitlab-ctl reconfigure [root@Gitlab ~]#gitlab-ctl stop [root@Gitlab ~]#gitlab-ctl start
#Truy cập gitlab: http://tenmiencuaban hoặc http://ip> #password ban đầu sẽ lưu ở đây [root@Gitlab ~]#cat /etc/gitlab/initial_root_passwordls
#Lưu ý: dns gitlab server cần phân giải được LDAP/AD server. Tạo user, OU trên AD để xác thực kết nối [root@Gitlab ~]#nano /etc/gitlab/gitlab.rb #Thêm hoặc chỉnh sửa đoạn sau: gitlab_rails['ldap_enabled'] = true gitlab_rails['ldap_servers'] = { 'main' => { 'label' => 'AD', 'host' => ‘AD.GIANGIT.COM', 'port' => 389, 'uid' => 'sAMAccountName', 'bind_dn' => ‘CN=gitlab,OU=IT,DC=giangit,DC=com', 'password' => 'It12345678!', 'encryption' => 'plain', 'verify_certificates' => true, 'timeout' => 10, 'active_directory' => true, 'base' => ‘DC=giangit,DC=com', 'user_filter' => '(objectClass=user)', 'lowercase_usernames' => false } } #Save, exit, apply và kiểm tra cấu hình: [root@Gitlab ~]#gitlab-ctl reconfigure [root@Gitlab ~]#gitlab-rake gitlab:ldap:check http://tenmiencuaban hoặc http://ip>
------------------------------------------ Cài đặt SSL cho gitlab để sử dụng https://gitlab.giangit.com
[root@Gitlab ~]# nano /etc/gitlab/gitlab.rb #Thêm nội dung external_url 'https://gitlab.giangit.com' letsencrypt['enable'] = true letsencrypt['contact_emails'] = ['email của bạn'] # Tự động renew letsencrypt['auto_renew'] = true [root@Gitlab ~]# gitlab-ctl reconfigure GitLab sẽ:
Truy cập: https://gitlab. giangit.com
|
