download
If wGET is not installed, install it first
yum install wget
Copy the code
The installation is complete
[root@localhost local]# yum install wgetFastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * epel: mirrors.aliyun.com * extras: mirrors.aliyun.com * updates: Mirrors.aliyun.com Resolving dependencies --> Checking transactions --> Package wget.x86_64.0.1.14-18.el7_6.1 will be installed --> Resolving dependencies Complete dependency resolution = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Package Schema version source size = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Installing: Wget x86_64 1.14-18.el7_6.1 base 547 K = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Is this OK [Y/D /N]: y Downloading Packages: Downloading 1 Wget - 1.14-18. El7_6. 1. X86_64. RPM | 547 kB 00:00:00 Running transaction check Running the transactiontest
Transaction testWget-1.14-18.el7_6.1.x86_64 1/1 Verifying: WGET-1.14-18.el7_6.1.x86_64 1/1 Installed: Wget.x86_64 0:1.14-18.el7_6.1 Over!Copy the code
Download gitblit
Wget HTTP: / / http://dl.bintray.com/gitblit/releases/gitblit-1.8.0.tar.gzCopy the code
The download is complete
[root@localhost local]Wget # http://dl.bintray.com/gitblit/releases/gitblit-1.8.0.tar.gz- the 2020-03-27 11:59:22 - http://dl.bintray.com/gitblit/releases/gitblit-1.8.0.tar.gz is resolve host dl.bintray.com (dl.bintray.com)... 52.41.180.114 54.191.3.105 are connected (dl.bintray.com dl.bintray.com | 52.41.180.114 | : 80... The connected. An HTTP request has been sent and is awaiting a response... Location: 302 http://d29vzk4ow07wi7.cloudfront.net/d23f30c1fe7d28648d682f387f9a16bfd05cd000da418489d00f04e10279776f? The response - the content - disposition = attachment % 3 bfilename % % 22 gitblit - 1.8.0 comes with 3 d. The tar. Gz % 22 & Policy = eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZ SI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvZDIzZjMwYzFmZTdkMjg2NDhkNjgyZjM4N2Y5YTE2YmZkMDVjZDAwMGRhNDE4NDg5Z DAwZjA0ZTEwMjc5Nzc2Zj9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMmdpdGJsaXQtMS44LjAudGFyL md6JTIyIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNTg1MjgyMjgzfSwiSXBBZGRyZXNzIjp7IkFXUzpTb3VyY2VJc CI6IjAuMC4wLjAvMCJ9fX1dfQ__&Signature=kLEsE2~0a-gSiDvvEPDNqjAuOO8ab7-aqqzuZjDm2sRBZGtPmrkGINTxHEJn~-2hGeQkxX61okj5uV2sq9 2xSnkPXxSuw9WKJvRPYB35HLdXUTEj2aMbNtKV8J-Dq3eSkQEnLWv7SBOAFn07nrHJE8PpuIy0lKC~ulCXnM1WBmOvr6AWjf3Nla0kLpdBV3HtpCTeTgPNwb CSZYHyqrFtaNI~CQCW8aHQVji-wOLYsy~wyrQ0jjywB8r~P-jSCCAzcyFH7OVqMbJuDsFl63Mw7lK4OVU9jHKKZly6M8GcZXIhqBKS-Ddz9CZ9jHhuoPo5kV Hn8jxGsbKHkunv1Zs -Fw__& key-pair-id =APKAIFKFWOMXM2UMTSFA [follow to new URL] --2020-03-27 11:59:24-- http://d29vzk4ow07wi7.cloudfront.net/d23f30c1fe7d28648d682f387f9a16bfd05cd000da418489d00f04e10279776f? The response - the content - disposition = attachment % 3 bfilename % % 22 gitblit - 1.8.0 comes with 3 d. The tar. Gz % 22 & Policy = eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZ SI6Imh0dHAqOi8vZDI5dnprNG93MDd3aTcuY2xvdWRmcm9udC5uZXQvZDIzZjMwYzFmZTdkMjg2NDhkNjgyZjM4N2Y5YTE2YmZkMDVjZDAwMGRhNDE4NDg5Z DAwZjA0ZTEwMjc5Nzc2Zj9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPWF0dGFjaG1lbnQlM0JmaWxlbmFtZSUzRCUyMmdpdGJsaXQtMS44LjAudGFyL md6JTIyIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNTg1MjgyMjgzfSwiSXBBZGRyZXNzIjp7IkFXUzpTb3VyY2VJc CI6IjAuMC4wLjAvMCJ9fX1dfQ__&Signature=kLEsE2~0a-gSiDvvEPDNqjAuOO8ab7-aqqzuZjDm2sRBZGtPmrkGINTxHEJn~-2hGeQkxX61okj5uV2sq9 2xSnkPXxSuw9WKJvRPYB35HLdXUTEj2aMbNtKV8J-Dq3eSkQEnLWv7SBOAFn07nrHJE8PpuIy0lKC~ulCXnM1WBmOvr6AWjf3Nla0kLpdBV3HtpCTeTgPNwb CSZYHyqrFtaNI~CQCW8aHQVji-wOLYsy~wyrQ0jjywB8r~P-jSCCAzcyFH7OVqMbJuDsFl63Mw7lK4OVU9jHKKZly6M8GcZXIhqBKS-Ddz9CZ9jHhuoPo5kV Hn8jxGsbKHkunv1Zs - Fw__ & Key Pair - Id = APKAIFKFWOMXM2UMTSFA is resolve host d29vzk4ow07wi7.cloudfront.net (d29vzk4ow07wi7.cloudfront.net)... 13.35.127.69, 13.35.127.111, 13.35.127.37,... Are connected (d29vzk4ow07wi7.cloudfront.net d29vzk4ow07wi7.cloudfront.net | 13.35.127.69 | : 80... The connected. An HTTP request has been sent and is awaiting a response... 200 OK Length: 42063149 (40M) [Application /gzip] Saving to: "Gitblit - 1.8.0 comes with. Tar. Gz" 100% [= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = >] 42063149 3.57 MB/s available 13 s Gitblit-1.8.0.tar. gz [42063149/42063149]Copy the code
Unpack the
My directory is in /usr/local/
cd usr/localThe tar - xf gitblit - 1.8.0 comes with. Tar. GzCopy the code
Modify the configuration
1. Change the port configuration
CD gitblit-1.8.0ll CD data vi defaults.properties Press ESC and enter :wq to save the configuration and exit
[root@localhost local]# CD gitblit - 1.8.0 comes with[root @ localhost gitblit - 1.8.0 comes with]# ll1 root root 984 5月 15 2014 Add-indexed Branch. Sh -rwxr-xr-x. 1 root root 82 4月 20 2014 author.sh 6 root root 153 3月 27 14:27 data drwxr-xr-x. 5 root root 4096 3月 27 14:27 docs drwxr-xr-x. 2 root root 4096 3月 27 14:27 ext-rw-r --r--. 1 root root 3685177 6月 23 2016 gitblit.jar -rwxr-xr-x. 1 root root 52 4月 20 2014 gitblit.sh 1 root root 59 April 20 2014 gitblit-stop.sh -rwxr-xr-x. 1 root root 87 April 20 2014 install-service-centos.sh 1 root root 1249 November 23 2015 install-service-fedora.sh -rwxr-xr-x. 1 root root 92 April 20 2014 Sh -rwxr-xr-x. 1 root root 997 February 26 2015 java-proxy-config.sh -rw-r--r--. 1 root root 11556 January 18 2016 license-rwxr-xr-x. 1 root root 599 June 17 2014 Migrate -tickets.sh -rw-r--r-- 1 root root 12237 January 18 2016 NOTICE -rwxr-xr-x. 1 root root 641 6月 17 2014 reindex-tickets.sh -rwxr-xr-x. 1 root root 1224 2月 26 2015 Sh -rwxr-xr-x. 1 root root 1512 5月 15 2014 service-ubuntu.sh [root@localhost gitblit-1.8.0]# cd data
[root@localhost data]# llDrwxr-xr-x. 2 root root 70 3月 27 14:27 certs-rw-r --r--. 1 root root 65818 6月 23 2016 defaults.properties Drwxr-xr-x. 2 root root 25 3月 27 14:27 git-r --r--. 1 root root 535 6月 23 2016 gitblit.properties drwxr-xr-x. 2 root Root 4096 3月 27 14:27 gitignore drwxr-xr-x. 2 root root 274 3月 27 14:27 groov-rw-r --r--. 1 root root 87 6月 23 2016 Projects.conf -rw-r--r--. 1 root root 74 6月 23 2016 users.conf [root@localhost data]# vi defaults.properties
Copy the code
Go to server.httpPort and set the HTTP port number
# Standard http port to serve. <= 0 disables this connector.
# On Unix/Linux systems, ports < 1024 require root permissions.
# Recommended value: 80 or 8080
#
# SINCE 0.5.0
# RESTART REQUIRED
server.httpPort = 7070
Copy the code
Go to server.httpBindInterface and set the IP address of the server. Set your server IP here.
# Specify the interface for Jetty to bind the standard connector.
# You may specify an ip or an empty value to bind to all interfaces.
# Specifying localhost will result in Gitblit ONLY listening to requests to
# localhost.
#
# SINCE 0.5.0
# RESTART REQUIREDServer. HttpBindInterface = 192.168.1.70Copy the code
Find server. HttpsBindInterface, setting of the machine’s IP
# Specify the interface for Jetty to bind the secure connector.
# You may specify an ip or an empty value to bind to all interfaces.
# Specifying localhost will result in Gitblit ONLY listening to requests to
# localhost.
#
# SINCE 0.5.0
# RESTART REQUIREDServer. HttpsBindInterface = 192.168.1.70Copy the code
Server. httpsPort = 8443 Leave the default value unchanged
2. Change the path configuration
Vi service-centos.sh Press ESC and enter :wq to save the configuration and exit
GITBLIT_PATH=/usr/local/ gitblit - 1.8.0 comes with GITBLIT_BASE_FOLDER = / usr /local/ gitblit - 1.8.0 comes with/data GITBLIT_HTTP_PORT = 7070 8443 GITBLIT_LOG GITBLIT_HTTPS_PORT = = / var /log/gitblit.log
Copy the code
Start the
1. Start jars
When you press CTRL + C or exit the terminal, the process will be closed and the service will be closed. Therefore, you must put the jar program in the background and modify the gitblit.sh file. Change the vi gitblit.sh file to the following
#! /bin/bash
nohup java -jar gitblit.jar --baseFolder data >/dev/null &
Copy the code
2. The service is started
Add gitblit as a service
install-service-centos.sh
service gitblit start
Copy the code
access
User name: admin Password: admin
Extra dependency library
If you need
yum install -y gcc-c++ curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
yum install lsof
yum install net-tools
Copy the code
Lsof -i:8888 – View the port kill -9 pid – Kills the service
Setting a Firewall
If you need
Firewall-cmd --zone=public --add-port=7070/ TCP --permanent Enables the port firewall-cmd --zone=public --add-port=7071/ TCP --permanent enable port firewall-cmd --zone=public --add-port=8443/ TCP --permanent enable port firewall-cmd --reload Restart the firewall to take effectCopy the code
You can also enable HTTP and HTTPS ports
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
sudo systemctl restart firewalld.service
Copy the code