目录
在Centos 7下部署svn并实现http访问及通过web进行可视化管理,部署内容包括httpd、Subversion、iF.SVNAdmin三部分内容。(注:按文档执行时,执行命令请手动输入)
#yum install httpd -y
#httpd -version (查看httpd是否安装)
#vim /etc/httpd/conf/httpd.conf (修改端口为9090)
#service start httpd (启动httpd进行测试)
在浏览器中访问http://ip:9090/,能打开一下页面则httpd服务正常。(此时可能因为防火墙限制,导致无法访问,此时需打开防火墙设置开发9090端口,详细参考防火墙设置)
安装svn模型及svn时需先停止httpd。
# service stop httpd
#yum install mod_dav_svn subversion -y
# svnserve --version (查看svn模型是否安装)
在/etc/httpd/modules/查看是否多出两个模型文件
#ls /etc/httpd/modules/ | grep svn
svn的httpd配置
#vim /etc/httpd/conf.modules.d/10-subversion.conf
<Location /svn> //svn的httpd命名,访问http地址时使用的上下文根
DAV svn
SVNParentPath /data/svn //代码仓库的父目录
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /data/svn/passwd //定义用户文件位置
AuthzSVNAccessFile /data/svn/authz //定义验证文件位置
Require valid-user
</Location>
创建文件夹及文件
#mkdir /data/svn
(#mkdir /data/svn/{test,svnconfig} -pv ,该命令可按层级创建多个文件夹)
#touch /data/svn/{passwd,authz}
#chmod -R 777 /data/svn
由于iF.SVNAdmin是基于php的应用,运行iF.SVNAdmin需要安装php。
#yum install php -y
#php -v (查看php是否安装)
下载iF.SVNAdmin
#wget http://sourceforge.net/projects/ifsvnadmin/files/svnadmin-1.6.2.zip
#unzip svnadmin-1.6.2.zip
#mv iF.SVNAdmin-stable-1.6.2/ /var/www/html/svnadmin (移动iF.SVNAdmin到httpd下)
#chmod 777 -R /var/www/html/svnadmin/data/
#chown -R apache:apache /var/www/html/svnadmin
启动httpd,在web端配置iF.SVNAdmin
#systemctl start httpd
访问web页面,http://ip:9090/svnadmin
图一
图(一)为参数说明,与图一相同
图(一)
至此,完成部署配置。
完成以上配置后,访问http://ip:9090/svn/santbbd_2020 (/svn为配置svn的httpd中的<Location /svn>)
安装软件
yum install 软件名称
yum install 软件名称 -y (-y表示安装过程中需要确认的,默认为yes)
卸载软件
yum remove 软件名称
yum remove 软件名称 -y (-y表示安装过程中需要确认的,默认为yes)
更新软件
yum update 软件名称
列出所有可安装的软件包
yum list
列出所有可更新的软件包
yum list updates
列出所有已安装的软件包
yum list installed
列出所有可更新的软件包信息
yum info updates
列出所有已安裝的软件包信息
yum info installed
# service firewalld start
# firewall-cmd --permanent --add-port=9090/tcp
# firewall-cmd --reload
firewall防火墙命令详解
查看firewall服务状态
systemctl status firewalld
出现Active: active (running)切高亮显示则表示是启动状态。
出现 Active: inactive (dead)灰色表示停止,看单词也行。
查看firewall的状态
firewall-cmd --state
开启firewall服务
service firewalld start
重启firewall服务
service firewalld restart
关闭firewall服务
service firewalld stop
查看防火墙规则
firewall-cmd --list-all
查询端口是否开放
firewall-cmd --query-port=8080/tcp
开放端口
firewall-cmd --permanent --add-port=8080/tcp
移除端口
firewall-cmd --permanent --remove-port=8080/tcp
重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload
#systemctl enable httpd
#systemctl enable firewalld
systemctl命令详解
下面以nfs服务为例:
启动nfs服务
systemctl start nfs-server.service
设置开机自启动
systemctl enable nfs-server.service
停止开机自启动
systemctl disable nfs-server.service
查看服务当前状态
systemctl status nfs-server.service
重新启动某服务
systemctl restart nfs-server.service
查看所有已启动的服务
systemctl list -units --type=service