Build a git Web server

Source: Internet
Author: User

build a git web server

1 . Install and configure the necessary dependencies

sudo yum install-y Curl Policycoreutils-python openssh-serversudo systemctlenable Sshdsudo systemctlstartsshd Sudofirewall-cmd--permanent--add-service=httpsudo Systemctl reloadfirewalld

2. Add the Gitlab package repository and install the package

To add a Gitlab package repository:

curlhttps://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh| sudo bash

Next, install GitLab Bag

sudo external_url= "http://gitlab.example.com" Yum install-y gitlab-ee

If the download is very slow can direct computer download upload: https://packages.gitlab.com/gitlab/gitlab-ee/I was downloaded as follows:


Then perform the installation:

Yum Install-y Gitlab-ee

3. Modify gitlab website

Vi/etc/gitlab/gitlab.rbexternal_url ' http://gitlab.example.com ' modification

RECONFIGURE RECONFIGURE

Gitlab-ctlreconfigure

4. start gitlab service

Gitlab-ctl start gitlab-ctl stop stop gitlab-ctl restart reboot


5. Browser Browsing

http://192.168.6.7

The Default user name is root, the first access lets you set the root password, and you can log in after setting.

6, private server recommended to close the registration

For example, to remove the hook, remember a total of two sign-up enabled; Close the first one, and the second one is for login.

650) this.width=650; "Src=" Https://s5.51cto.com/oss/201710/23/f3417af57e03ec17d44ca6917429fc04.png-wh_500x0-wm_3 -wmp_4-s_1071311435.png "title=" 111.png "alt=" F3417af57e03ec17d44ca6917429fc04.png-wh_ "/>


7, the Gitlab of Chinese

Stop Gitlab

Gitlab-ctl stop

View gitlab version

Cat/opt/gitlab/embedded/service/gitlab-rails/version

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/23/7288c3839d94fec42e27bb4f53af2993.png-wh_500x0-wm_3 -wmp_4-s_252217363.png "title=" 222.png "alt=" 7288c3839d94fec42e27bb4f53af2993.png-wh_ "/>

Download the corresponding Chinese package

git clone https://gitlab.com/xhang/gitlab.git-b V10.0.4-zh

to see if the version of the Chinese patch is v10.0.4:

Cat Gitlab/version

Compare Chinese label and original tag, export patch diff file to /root

CD Gitlab

sudo git diff v10.0.4 v10.0.4-zh >. /10.0.4-zh.diff

update 10.0.4-zh.diff as a patch to gitlab

back to the root directory

Cd

Yum-y Install Patch–y

patch-d/OPT/GITLAB/EMBEDDED/SERVICE/GITLAB-RAILS-P1 <10.0.4-zh.diff

8. start Gitlab

Gitlab-ctl start

9. Browser Browsing

650) this.width=650; "Src=" Https://s2.51cto.com/oss/201710/23/bd66314b22ae97cbc5f7b382701eb20f.png-wh_500x0-wm_3 -wmp_4-s_2091321436.png "title=" 333.png "alt=" Bd66314b22ae97cbc5f7b382701eb20f.png-wh_ "/>

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/23/77b490ac14a01ca59d0570bc8b88f4bf.png-wh_500x0-wm_3 -wmp_4-s_506663605.png "title=" 444.png "alt=" 77b490ac14a01ca59d0570bc8b88f4bf.png-wh_ "/>

10. Create Gitlab Project

650) this.width=650; "Src=" Https://s4.51cto.com/oss/201710/23/ad14d3516f941c59cb2fab4151a21fc2.png-wh_500x0-wm_3 -wmp_4-s_2242182912.png "title=" 555.png "alt=" Ad14d3516f941c59cb2fab4151a21fc2.png-wh_ "/>

11. The client clones and publishes the project file

Client installs git

Yum–y Install git

Configure global name and Email

git config--global user.name "root"

git config--global user.email "[Email protected]"

The client generates the corresponding public and private key

Ssh-keygen-t rsa-c [email protected]

Copy the public key contents to the SSH key of the gitlab user

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/23/cffc87f65b79089f5aa390d4bb45c3cc.png-wh_500x0-wm_3 -wmp_4-s_2308173030.png "title=" 666.png "alt=" Cffc87f65b79089f5aa390d4bb45c3cc.png-wh_ "/>

12. The client clones and publishes the project file

Clone Warehouse

git clone http://221.122.60.125/root/testtest.git


Go to warehouse folder Testtest

CD Testtestgit Init set to Warehouse


Create a project file

Touch test01 test02mkdir Abctouch abc/test01 abc/test02

uploading files to a project    

git Add. # dot means upload all files and folders git commit–m "push test and ABC" #提交上传的文件到缓存区 and set the description Git push–u origin master #推送上传文件到远程 Warehouse

Browser to see if the upload was successful

650) this.width=650; "Src=" Https://s1.51cto.com/oss/201710/23/32bfc5d9b6820fd83266ef0b4f14166a.png-wh_500x0-wm_3 -wmp_4-s_2577216993.png "title=" 777.png "alt=" 32bfc5d9b6820fd83266ef0b4f14166a.png-wh_ "/>

13. Delete the Testtest file and re-download the GIT project to verify that the release was successful.

650) this.width=650; "Src=" Https://s3.51cto.com/oss/201710/23/0c41f82eb111723ef154ef034222cabb.png-wh_500x0-wm_3 -wmp_4-s_1432116738.png "title=" 888.png "alt=" 0c41f82eb111723ef154ef034222cabb.png-wh_ "/>


This article is from the "506554897" blog, please be sure to keep this source http://506554897.blog.51cto.com/2823970/1975245

Build a git Web server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.