To install and configure GitLab in CentOS 7 environment, whether it is an intranet or an extranet environment, the following is a simple tutorial:
-
Install and configure dependencies:
- Open a terminal and log in to CentOS 7 with root privileges.
-
Install the necessary dependencies, including curl, openssh-server, postfix, etc.
yum install -y curl openssh-server postfix systemctl enable sshd postfix systemctl start sshd postfix
-
Add the GitLab repository:
-
Run the following commands to add the GitLab repository and install GitLab:
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash yum install -y gitlab-ce
-
-
Configure GitLab:
- Open the GitLab configuration file
/etc/gitlab/gitlab.rb
for configuration. -
Configure the external URL, which is the access address of GitLab.
external_url 'http://your_domain_or_IP'
- Optional: Depending on your needs, you can also configure other options such as SMTP mail server, backup settings, etc.
- Save and close the configuration file.
- Open the GitLab configuration file
-
Install and configure GitLab:
-
Run the following commands to install and configure GitLab:
gitlab-ctl reconfigure
-
-
To access and use GitLab:
- Visit the configured external URL ( http://your_domain_or_IP ) in a web browser .
- Follow the instructions of the wizard to create an administrator account and password.
- Once logged in, you can create projects, invite members, manage repositories, and more.
-
Configure the firewall:
- If a firewall is enabled on your server, you will need to configure the firewall to allow access to GitLab.
-
Run the following commands to open HTTP and SSH ports (as needed):
firewall-cmd --permanent --zone=public --add-service=http firewall-cmd --permanent --zone=public --add-service=https firewall-cmd --permanent --zone=public --add-service=ssh firewall-cmd --reload
These are the basic steps to install and configure GitLab on CentOS 7 environment. Depending on your needs and specific environment, additional configuration and tuning may be required. Please ensure that you have a detailed understanding of your network environment and security requirements and take appropriate security measures before performing any operations related to network connection and security.