SVN服务的启动 防火墙等

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chenguanghan123/article/details/82318307

设置开机启动:

# vi /etc/rc.d/rc.local

# chmod 777 rc.local(确保该文件有执行权限)

在末尾添加

/usr/bin/svnserve -d -r /var/svn

 

永久关闭防火墙:

systemctl disable firewalld

 

启动SVN服务                 svnserve –d -r /var/svn/svnrepos 

启动svn                      systemctl start SVNserve.service

查看SVN服务                 ps aux |grep svnserve

 

查看防火墙状态              

 iptables status   

或者 systemctl status firewalld.service

启动和关闭防火墙

重启后生效

开启:       chkconfig iptables on

关闭:       chkconfig iptables off

即时生效,重启后失效

开启:       service iptables start

关闭:       service iptables stop

 

启动防火墙 systemctl start firewalld.service

关闭防火墙 systemctl stop firewalld.service

 

查看svn状态                     systemctl status SVNserve.service   或  ps aux |grep svnserve

查看正在使用的端口               lsof –i

杀死进程                         kill -9 - pid号

 

启动svn版本库  svnserve -d -r /var/svn/svnrepos(停止SVN命令  killall svnserve)

 

服务器重启之后先查看SVN服务是否是运行状态,用命令: ps aux |grep svnserve

如果服务是启动状态会出现两个进程,一个是有路径的进程一个是没有路径的进程

如果只有一个进程,那么说明服务没有启动,需要重新启动一下SVN服务,也就是用命令:svnserve –d -r /var/svn/svnrepos 后面的路径具体还是要看SVN版本库的地址,我的是svnrepos

启动服务后需要再次查看SVN服务的状态,确定服务是否启动:ps aux |grep svnserve

如果有两个进程,说明服务已经启动,此时,测试tortoise svn是否可以连接,如果能连接说明SVN服务正常了,

如果没有连接成功,需要查看一下防火墙状态:

我的centos7是用systemctl status firewalld.service命令查看,服务器上可能会不同,但是思路相同

如果服务是开启的,用命令关掉:systemctl stop firewalld.service 执行命令后要再次查看SVN服务状态,确定SVN服务关闭

关闭防火请后重新测试tortoise svn是否可以连接,如果连接成功说明SVN服务正常

如果仍然不能连接成功,可以尝试重新启动SVN服务,先查看进程号:ps aux |grep svnserve

用 kill -9 -pid  杀死带路径的进程 pid 是具体的进程号,杀死以后再次查看SVN服务状态,确定服务被杀死:ps aux |grep svnserve 此时应该只有一个进程

然后用 svnserve –d -r /var/svn/svnrepos  重新创建版本库,也就是重新启动SVN服务,具体路径还是视情况而定,创建完成后查看服务状态,用ps aux |grep svnserve 有两个进程说明服务成功

用tortoise svn测试上面的路径,能够链接成功说明SVN服务正常

 

 

 

 

 

chkconfig

查找路径命令: find / -name svn(这条命令查的是svn的路径)

猜你喜欢

转载自blog.csdn.net/chenguanghan123/article/details/82318307
今日推荐