Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Set up gitlab environment locally, configure mail notifications and basic operations

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Go to gitlab official website, select the corresponding operating system-CentOS 6 (and RedHat/Oracle/Scientific Linux 6), and install it according to the official prompts:

Install the necessary dependencies for configuration In Centos 6 and 7, the following command will open HTTP and SSH access in the system firewall.

sudo yum install openssh-server sudo yum install postfix sudo yum install cronie sudo service postfix start sudo chkconfig postfix on sudo lokkit -s http -s ssh

Download rpm package for gitlab

curl -O

https://downloads-packages.s3.amazonaws.com/centos-6.6/gitlab-7.7.2_omnibus.5.4.2.ci-1.el6.x86_64.rpm

sudo rpm -i gitlab-ce-7.10.0~omnibus.2-1.x86_64.rpm

Configure and launch GitLab

Open/etc/gitlab/gitlab.rb, change external_url = 'git.example.com' to your own IP address: 10.10.10.1, and execute the following command to compile GitLab.

sudo gitlab-ctl reconfigure

GitLab Username: root Password: 5iveL! fe

configure port

Gitlab installation package comes with Nginx, to use port 80 for external services, Unicorn to use port 8080 for internal services, but these two ports have been occupied on our server. Therefore, the solution is: modify the default port of Nginx to 9000, specify the default port of Unicorn to 9001, and modify the default port of Gitlab-shell to 9001.

configuration mode

external_url 'http://ip_adress:9000'

unicorn['port'] = 9001

In the company's network environment, the dedicated line disables port 80 and prohibits mapping, so the port is changed to port number 18080.

Configure GitLab's default email address

GitLab uses postfix to send emails. Therefore, you can uninstall sendmail that comes with the system.

Use yum list installed to check whether sendmail exists in the system. If it exists, use yum remove sendmail command to uninstall it.

Test whether the system can send mail properly.

echo "Test mail from postfix" | mail -s "Test Postfix" xxx@xxx.com

Note: xxx@xxx.com above is the email address you wish to receive.

When the mailbox receives the mail sent by the system, copy the address of the system, such as root@iZ23syflhhz.localdomain, open/etc/gitlab/gitlab.rb,

# gitlab_rails['gitlab_email_from'] = 'gitlab@example.com'

modified to

gitlab_rails['gitlab_email_from'] = 'root@iZ23syflhhzZ.localdomain'

After saving, execute sudo gitlab-ctl reconfigure to recompile GitLab. If the filtering function of the mailbox is strong, please add the sending address of the system to the whitelist of the mailbox to prevent the mail from being filtered.

Note: The log of mail sent in the system can be viewed with the command tail /var/log/maillog.

I also added this paragraph to the gitlab.rb configuration file

# Use smtp instead of sendmail/postfix.

gitlab_rails['smtp_enable'] = true

gitlab_rails['smtp_address'] = "smtp.exmail.qq.com"

gitlab_rails['smtp_port'] = 25

gitlab_rails ['smtp_user_name']= "Mailbox required"

gitlab_rails ['smtp_password']= "password"

gitlab_rails['smtp_domain'] = "smtp.qq.com"

gitlab_rails['smtp_authentication'] = "login"

gitlab_rails['smtp_enable_starttls_auto'] = true

gitlab_rails['smtp_tls'] = false

gitlab_rails['smtp_openssl_verify_mode'] = false

April 14, 2016, today colleagues encountered a 500 error when using gitlab, the prompt is encoding error, after checking the relevant information, the conclusion is... This is a bug, old version bug, update to the new version is ok... This is really unbearable…The update to version 7.10.4 is now working properly.

The inspiration for solving the problem came from this post:

https://gitlab.com/gitlab-org/omnibus-gitlab/issues/481

Repair operation according to this post:

https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/7/gitlab-ce-7.10.4~omnibus.1-1.x86_64.rpm

The operation done is to replace the original version and solve the problem.

Since the company is a dedicated network, the public IP is on an ASA firewall. If you want the external network to also access my gitlab website, you need me to map the address. The configuration process is as follows:

static (inside,outside) tcp interface 18089 10.10.10.1 18089 netmask 255.255.255.255

access-list Out_In extended permit tcp any host public network IP eq 18089

In this way, you can access http://public network:18089 on the external network to access gitlab, and you must access the IP address of the internal network to access it inside the company.

References:

http://segmentfault.com/a/1190000002722631

http://www.lenky.info/archives/2014/06/2413 Using gitlab on windows

http://www.tuicool.com/articles/bEz6Vf gitlab operating manual

http://segmentfault.com/a/1190000002439923 gitlab data backup and recovery

http://blog.chinaunix.net/uid-17291169-id-4454012.html gitlab Forgot Password How to Reset

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report