In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
Today, I would like to share with you how to build Git services based on http protocol on VMware+centOS8. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
one。 cause
To enable the Android terminal to access the git service in the virtual machine, it is necessary to build a git server for the http protocol.
two。 Equipment information
Windows10 Family Chinese version (1903) VMware 15 Pro (15. 5. 0 Build-14665864) CentOS 8 (GUI was closed in 1905 and VMware uses NAT mode)
three。 Preparatory work
(1) windows Firewall opens 80-Port Control Panel-system and Security-Windows Defender Firewall Click Advanced Settings-Click inbound rules-create new rules to change the type of rules to be created. The port settings are shown in the following figure.
Select allow connections and set them as follows
Name setting Click outbound rule at will-the next steps for creating a new rule are the same as the inbound rule settings above
(2) close SELinux
Open the selinux configuration file
Vi/etc/SELinux/config is changed to SELINUX=disabled. Restart centOS to permanently shut down selinux
Note:
1.SELinux has three states, namely, mandatory, licensed, and disabled. two。 Check the current status command: getenforcing. 3. Temporary shutdown command: setenforce. 4. Temporarily open: setenforce. 1 (cannot be opened after permanent closure)
(3) change Virtual Network Editor Click VMware menu bar Edit-Virtual Network Editor-change Settings Click VMnet8 NAT Mode-NAT Settings-add and set as shown in the figure (the IP address of the virtual machine is queried by ifconfig, any description)
four。 Install apache
(I) install httpd
Yum install httpd
(2) start the httpd service
Systemctl starts httpd.service
(3) modify firewall d configuration file and restart firewall d.
Firewall-cmd-zone=public-add-port=80/TCP-permanent systemctlrestardfirewalled. Service can turn off the firewall directly if it is too troublesome.
Note:
1. Check the firewall status: systemctl status firewalld 2. Temporarily turn off the firewall: systemctl stops firewalld 3. Permanently turn off the firewall: systemctl disables firewalld 4. Restart the firewall: systemctl enables the firewall (this command turns on the firewall permanently)
five。 Configure git
(1) create an empty warehouse
Mkdir-p/home/git repo/share. Git// short positions can be set up in any directory CD/home/git repo/share. Git init-Barechown-Apache: Apache/home/git repo (2) create an account and set permissions
Htpasswd-m-c/etc/httpd/conf. D/git-team. Htpasswdxxx//XXX is the name of the account. Chown Apache 3360 Apache/etc/httpd/conf. D/git-team. Htpasswdchmod 640/etc/httpd/conf. DUnix git-can be set at will
Vi / etc/httpd/conf/httpd.conf
Add the following, including the option conf.d/*. Conf is on the last line.
VirtualHost*:80
The IP address of the server name. X.X.X#centOS
SetEnvGIT_HTTP_EXPORT_ALL
Setenv git _ project _ root/home/git repo # this should be the same as the location where the empty warehouse was created
Script alias/git//usr/libexec/git-core/git-http- backend /
Location /
AuthTypeBasic
AuthName'Git'
AuthUserFile/etc/httpd/conf. D/git-team. Htpasswd
Require a valid user
/ location
/ VirtualHost (2) restart httpd
Systemctl restart httpd.service
Note:
1. Query httpd service status: systemctl status httpd.service 2. Query whether to start the httpd service: system ctlis-enabled httpd. Service 3 . Set the httpd service to the startup state: systemctlenable httpd.service. four. Set the httpd service to startup and non-startup: systemctl disables httpd.service
After you have done this, you can perform git operations on the external network, such as cloning
IP address of git clone http://windows / git/share.git
These are all the contents of the article "how to build Git Services on VMware+centOS8 based on http Protocol". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.