In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Most people do not understand the knowledge points of this article "how to install Subversion version control system in CentOS7", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to install Subversion version control system in CentOS7" article.
Subversion is a free / open source version control software that records every change you make to the data warehouse and enables you to retrieve the modified version file at a certain time. Its core is the data warehouse, you need to submit your files to the data warehouse, update the data warehouse files, and be able to find the current data through the version as needed.
Because the project needs to build a SVN server in CentOS 7.4 environment, but the subversion version that comes with CentOS is only 1.7.14.
It is a far cry from SVN 1.8.19 and SVN 1.9.7 released on Subversion's official website on August 10th, which will seriously affect the use of SVN clients, so we need to uninstall our own Subversion and use yum to reinstall the latest version of Subversion.
We carry out orders.
Yum remove subversion*yum clean all
Uninstall subversion and related library packages directly
But when we use the yum command to reinstall subversion, we find that the Subversion version of CentOS with its own source is still 1.7.14
It is not feasible to install the latest version of Subversion from CentOS's own source. We need to add another Repo source.
Referring to the article https://tecadmin.net/install-subversion-1-8-on-centos-rhel/#, we are in
Add the subversion.repo file to the / etc/yum.repos.d directory, as follows
[Subversion] name=Wandisco SVN Repobaseurl= http://opensource.wandisco.com/centos/$releasever/svn-1.9/RPMS/$basearch/enabled=1gpgcheck=0
Since SVN1.9 is installed here and svn-1.9 is configured in the repo file, if you want to install SVN1.8, you can change it to svn-1.8
Execute the yum install-y subversion command to install Subversion
Some changes have been made.
1) create the user svngroupadd svnuseradd-g svn svn needed to run the SVN server
The reason for creating a svn user to start the SVN server instead of using the root user to start the SVN server is that if you start the SVN server with the root user and access the SVN server with a non-root account through the SVN client, the
"xxxxxxxx db/txn-current-lock:permission denied" error.
Add svn users to sudoers users
2) execute the rpm-ql subversion command to understand the location of the SVN installation 3) create the SVN version library folder mkdir-p / opt/svnRepos
Switch to svn user and add access to this folder for svn user
Sudo chmod-R o+rw / opt/svnRepos4) create SVN version library svnadmin create / opt/svnRepos
Some new folders have been added under the / opt/svnRepos folder after executing the command
5) add user password and access rights
Enter the conf directory and you can see the following files
The authz file is a permission control file
Passwd is the account password file
Svnserve.conf is the SVN service profile
Modify the passwd file and add the user svnuser1 and access password in the [users] section
Modify the authz file to add svn root access to the svnuser1 user at the end of the file
Here [/] indicates that it is the svn root directory, and svnuser1=rw indicates that the svnuser1 user has read and write permissions to the root directory. If you want to restrict certain users to certain folders
Read and write permissions. [/] here can be changed to a specific folder directory, and then specific user permissions can be added. I will not repeat them here.
6) modify svn configuration file
Modify the svnserve.conf file
Open the comments for the following items (in white font in the figure)
Anon-access = read # Anonymous user readable
Auth-access = write # authorised user writable
Password-db = passwd # which file is used as the account file
Authz-db = authz # which file to use as the permissions file
Realm = / opt/svnRepos # authentication space name, directory where the version library is located
7) start the SVN server
Execute the following command
Svnserve-d-r / opt/svnRepos-- config-file=/opt/svnRepos/conf/svnserve.conf
The parameter-d of this instruction indicates that the Svn server is running as a daemon, and-r represents the root directory of the Svn server, followed by the root directory of SVN.
-config-file is the configuration file referenced by the Svn server startup, followed by the configuration file path.
For more parameters of the svnserve instruction, please refer to this article.
Https://linux.die.net/man/8/svnserve
After startup, you can see that the svnserve process has been started.
8) Open the SVN server port on the firewall
The default port of the SVN server is 3690. If you want to change the default port, you can add the-listen-port parameter when you run the svnserve command, followed by the port number you need to specify.
Execute the following command to open the SVN server port on the CentOS7 system firewall
Firewall-cmd-permanent-add-port=3690/tcpsystemctl restart firewalld.service
Install Tortoise SVN 1.9.7 on the client, create a new folder after the installation is complete, right-click in the folder, select [Repo-brower] menu from the pop-up right-click menu, enter SVN://IP (we are SVN://192.168.56.102 in this case) in the pop-up address dialog box, and enter the user name rick and password in the verification dialog box. You can access the SVN root directory, and we use the svnuser1 user to log in to SVN, as shown in the following figure
We use the svnuser1 user to create three new trunk,tags and branches folders under the root directory
9) set the SVN server to boot service
There are relevant files on the Internet by modifying the / etc/rc.local file to set the SVN server to boot, this practice is out of date in the CentOS 7 environment, we use the CentOS 7 normal way to add services.
Let's change to the / usr/lib/systemd/system directory, create a file named svnserver.service, and add the following
[Unit] Description=SVN Server service After= network.target [service] Type=forkingExecStart= / usr/bin/svnserve-d-r / opt/svnRepos-- config-file=/opt/svnRepos/conf/svnserve.confExecStop= / home/svn/stopSVN.shUser=svnRestart=on-abort [Install] WantedBy=multi-user.target
The command is directly used to start the SVN server here. I tried to write a .sh file to replace it, but there was a code=exited,status=203/EXEC error after startup.
StopSVN.sh is the script file used to shut down the SVN service, as follows:
#! / bin/sh# to see if there is a process corresponding to svnserve, and if so, close the process ps-ef | grep svnserve | grep-v grepif [$?-ne 0] then echo "the svn server does not start" else killall-9 sh svnservefi#
After saving the svnserver.service file, execute the following command
Systemctl daemon-reloadsystemctl enable svnserver.servicesystemctl start svnserver.service
If there is no error message in the shell window, indicating that the startup was successful, we can execute the following command to check the startup status
Systemctl status svnserver.service
Run the following command to stop the service
Systemctl stop svnserver.service
When we run systemctl stop svnserver.service at this time, we can see that the service has been disabled.
At this point, the SVN server is successfully installed in the Linux server. After starting the CentOS system again, the SVN server will start up.
In addition, the SELinux included with CentOS is Enforcing by default and is on. For the self-started SVN service, it will cause a Permisson Denied error when the client accesses the SVN server. We need to close it manually and modify the / etc/selinux/config file.
# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing-SELinux security policy is enforced.# permissive-SELinux prints warnings instead of enforcing.# disabled-No SELinux policy is loaded.SELINUX=disabled# SELINUXTYPE= can take one of three two values:# targeted-Targeted processes are protected,# minimum-Modification of targeted policy. Only selected processes are protected.# mls-Multi Level Security protection.SELINUXTYPE=targeted
Change the SELINUX from enforcing to disabled, restart the system, and after the SVN service is started, there is no Permssion Denied error in accessing from the client.
The above is about the content of this article on "how to install Subversion version control system in CentOS7". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more related 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.