1.安装Linux虚拟机
-- 安装后配置a.停止防火墙# systemctl stop firewalld.service# systemctl disable firewalld.service# systemctl status firewalld.serviceb.停止SElinux
--临时关闭#setenforce 0--永久关闭修改/etc/selinux/config 文件将SELINUX=enforcing改为SELINUX=disabled重启机器即可 2.修改Linux服务器IP地址a.设置服务器IP地址#cd /etc/sysconfig/network-scripts#ls /etc/sysconfig/network-scripts/ifcfg-*注意:ifcfg-lo是本地回环地址的配置文件,所有计算机都有,不要修改#vi ifcfg-ens33修改内容:TYPE=EthernetPROXY_METHOD=noneBROWSER_ONLY=noBOOTPROTO=staticDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=ens33UUID=ffe6f0d2-6717-436d-b4a0-31eae5baa5b6DEVICE=ens33ONBOOT=yesIPADDR=192.168.52.6NETMASK=255.255.255.0BROADCAST=192.168.52.255GATEWAY=192.168.52.1b.重启网络服务
#service network restartc.验证IP地址#ifconfig 3.将ISO文件挂载到Linux上a.将iso文件拷贝到Linux上(使用Ftp或SSH文件工具)b.加载iso文件#mount -o loop -t iso9660 /Centos.iso /mntc.验证持载#cd /mnt#ls4.配置本地YUM源
a.修改yum文件#cd /etc/yum.repos.d/#mkdir bk#mv *.repo ./bk#cd ./bk#cp CentOS-Media.repo ../dvd.repo#cd ..#vi dvd.repo修改内容如下:[dvd]name=CentOS-$releasever - Mediabaseurl=file:///mntgpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7b.刷新yum
yum clean all5.安装SVN
a.安装#yum install subversionb.验证#svnserve --version6.配置SVN
a.创建版本库#mkdir -p /data/svn#svnadmin create /data/svn/project1#svnadmin create /data/svn/project2b.创建版本库共用的配置文件
#cd /data/svn#mkdir ./conf#cp /data/svn/project1/conf/passwd /data/svn/conf/passwd#cp /data/svn/project1/conf/authz /data/svn/conf/authz#cp /data/svn/project1/conf/svnserve.conf /data/svn/conf/svnserve.conf#cd /data/svn/conf#vi passwd修改内容为[users]svn_admin=svn201903#pro1=pro1pro2=pro2#vi authz修改内容为[aliases]# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average[groups]
admin=svn_admingroup1=pro1group2=pro2[/]
@admin=rw*=[project:/]
@admin=rw@group1=rw*=[project2:/]
@admin=rw@group2=rw*=#vi svnserve.conf修改内容为:[general]anon-access = noneauth-access = writepassword-db = /data/svn/conf/passwdauthz-db = /data/svn/conf/authzrealm = svn[sasl]
# use-sasl = true# min-encryption = 0# max-encryption = 256c.启动SVN服务
#svnserve -d -r /data/svn --config-file /data/svn/conf/svnserve.conf --listen-port 3690d.验证SVN服务是否正常
#ps -ef|grep svn|grep -v grep #查看进程#netstat -ln |grep 3690 #检查端口e.停止SVN服务
#killall svnserve 或#kill -9 <SVN的PID>f.在本地用SVN客户端访问SVN,看看是否正常
svn://192.168.52.6/project16.配置SVN可以通过Http协议访问a.安装apache#yum install httpd#httpd -versionb.启动apache并验证#service httpd start在本地上访问http://192.168.52.6c.安装SVN需要的模块#yum install mod_dav_svn#cd /etc/httpd/modules/#ll *svn*.soe.配置Conf文件#cd /etc/httpd/conf#vi httpd.conf在文件的后面,加下如下内容LoadModule dav_module modules/mod_dav.soLoadModule dav_svn_module modules/mod_dav_svn.so<Location /svn>DAV svnSVNParentPath /data/svnAuthType BasicAuthName "SVN 1.7"AuthUserFile /data/svn/conf/http_passwdAuthzSVNAccessFile /data/svn/conf/authzRequire valid-user</Location>f.创建http协议访问SVN的密码文件http_passwd#htpasswd -cbm /data/svn/conf/http_passwd svn_admin svn201903##htpasswd -bm /data/svn/conf/http_passwd pro1 pro1#htpasswd -bm /data/svn/conf/http_passwd pro2 pro2#cd /data/svn/conf#chmod 666 http_passwd#chown -R apache:apache /data/svn
g.重启SVN服务和Apache服务
#killall svnserve #svnserve -d -r /data/svn --config-file /data/svn/conf/svnserve.conf --listen-port 3690#service httpd restarth.用浏览器验证SVN
http://192.168.52.6/svn/project1
enjoy :)