Zero. Environment
ubuntu16.04
1. Installation
1.1 Install dependencies
sudo apt-get install curl openssh-server ca-certificates postfix
1.2 Add Tsinghua mirror
curl https://packages.gitlab.com/gpg.key 2> /dev/null | sudo apt-key add - &>/dev/null
vim opens the file /etc/apt/sources.list.d/gitlab-ce.list and adds the following line:
deb https: // mirrors .tuna .tsinghua .edu .cn / gitlab-ce / ubuntu xenial main
1.3 Installation
sudo apt-get updatesudo
sudo apt-get install gitlab-ce
1.4 Configuration
sudo gitlab-ctl reconfigure
1.5 Open sshd and postfix services
service sshd start
service postfix start
1.6 Check if it is running normally
sudo gitlab-ctl status
Browser open: http://127.0.0.1
2. Configuration data file storage location
2.0 gitlab default storage folder
/var/opt/gitlab/git-data
2.1 Create your own storage folder
mkdir /home/x/xx
2.2 Modify gitlab configuration
vim /etc/gitlab/gitlab.rb
Modified as follows:
git_data_dirs({
"default" => {
"path" => "/home/x/xx"}})
2.3 Reload configuration
gitlab-ctl stop
gitlab-ctl reconfigure
gitlab-ctl start
3. Configure the port
2.1 Default Port
gitlab default port is 80
2.2 Change the default port
sudo -i
cd /var/opt/gitlab/nginx/conf/
vim gitlab-http.conf
server {
listen *:8008; # The number is the port to be modified
server_name gitlab.example.com;
2.3 Reboot
gitlab-ctl restart
2.4 Testing
Browser input: ip:port
refer to:
http://blog.csdn.net/discoverer100/article/details/51814171
https://blog.whsir.com/post-1490.html
http://blog.csdn.net/wizard_rp/article/details/73147129