我做的网站有时打开很慢什么原因,seo创业,兰州工业发展建设有限公司网站,空间设计主要做什么SVN服务器有2种运行方式#xff1a; 1、独立服务器 (例如#xff1a;svn://xxx.com/xxx)#xff1b; 2、借助apache (例如#xff1a;http://svn.xxx.com/xxx)#xff1b; 为了不依赖apache#xff0c;我选择第一种方式#xff1a;独立的svn服务器。SVN存储版本数据也…SVN服务器有2种运行方式 1、独立服务器 (例如svn://xxx.com/xxx) 2、借助apache (例如http://svn.xxx.com/xxx) 为了不依赖apache我选择第一种方式独立的svn服务器。SVN存储版本数据也有2种方式1、bdb 2、fsfs。 由于bdb方式在服务器中断时有可能锁住数据所以还是fsfs方式更安全一点我也选择这种方式。具体部署 1.下载subversion安装包 [rootserver ~]# cd /usr/local/src [rootserver src]# ls [rootserver src]# wget http://subversion.tigris.org/downloads/subversion-1.6.6.tar.gz [rootserver src]# wget http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.gz[rootserver src]# tar xfvz subversion-1.6.6.tar.gz [rootserver src]# tar xfvz subversion-deps-1.6.6.tar.gz [rootserver src]# cd subversion-1.6.6 [rootserver subversion-1.6.6]# 2.编译SVN首先检测系统有没有安装SSL [rootserver subversion-1.6.6]# find / -name opensslv.h [rootserver subversion-1.6.6]# 找不到就执行如下命令进行安装 [rootserver subversion-1.6.6]# yum install openssl [rootserver subversion-1.6.6]# yum install openssl-devel 安装之后用find / -name opensslv.h命令找到opensslv.h所在的目录即下列--with-openssl后面的路径编译[rootserver subversion-1.6.6]# find / -name opensslv.h /usr/include/openssl/opensslv.h[rootserver subversion-1.6.6]# ./configure --prefix/usr/local/svn --with-openssl/usr/include/openssl --without-berkeley-db注以svnserve方式运行不加apache编译参数。以fsfs格式存储版本库不编译berkeley-db。此时编译报如下错误configure: WARNING: unrecognized options: --with-openssl configure: Configuring Subversion 1.6.6 configure: creating config.nice checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in /usr/local/src/subversion-1.6.6: configure: error: no acceptable C compiler found in $PATH See config.log for more details. 说明没有安装gcc相关库使用如下命令安装gcc后再编译[rootserver subversion-1.6.6]# yum -y install gcc [rootserver subversion-1.6.6]# ./configure --prefix/usr/local/svn --with-openssl/usr/include/openssl --without-berkeley-db 最后出现下面WARNING直接忽略即可因为不使用BDB存储。 configure: WARNING: we have configured without BDB filesystem support You dont seem to have Berkeley DB version 4.0.14 or newer installed and linked to APR-UTIL. We have created Makefiles which will build without the Berkeley DB back-end; your repositories will use FSFS as the default back-end. You can find the latest version of Berkeley DB here:http://www.sleepycat.com/download/index.shtml 3.安装SVN 为避免出现以下错误error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory 先执行以下操作 1)、编辑/etc/ld.so.conf文件添加下面一行/usr/local/lib 2)、保存后运行ldconfig/sbin/ldconfig注ld.so.conf和ldconfig用于维护系统动态链接库。安装 [rootserver subversion-1.6.6]# make make install 安装完成执行以下命令测试 [rootserver subversion-1.6.6]# /usr/local/svn/bin/svnserve --versionsvnserve版本 1.6.6 (r40053) 编译于 Feb 15 201222:15:26 版权所有 (C) 2000-2009 CollabNet。 Subversion 是开放源代码软件请参阅 http://subversion.tigris.org/ 站点。 此产品包含由 CollabNet(http://www.Collab.Net/) 开发的软件。 下列版本库后端(FS) 模块可用: * fs_fs : 模块与文本文件(FSFS)版本库一起工作。 为了方便下操作下面将SVN的BIN添加到PATH编辑/etc/profile添加PATH/usr/local/svn/bin:$PATH 保存后使其立即生效source /etc/profile4.配置SVN建立版本库目录可建多个 [rootserver ~]# mkdir -p /home/svndata/repos #建立版本库[rootserver ~]# /usr/local/svn/bin/svnadmin create /home/svndata/repos #修改版本库配置文件 编辑/home/svndata/repos/conf/svnserve.conf内容修改为[general] anon-access none auth-access write password-db /usr/local/svn/conf/passwd.conf authz-db /usr/local/svn/conf/authz.conf realm repos 注意对用户配置文件的修改立即生效不必重启svn。在/usr/local/svn/下面新建conf目录并在/usr/local/svn/conf内新建passwd.conf和authz.conf文件 mkdir conf cd conf/touch passwd.conf touch authz.conf 添加用户及密码 [rootserver ~]# useradd wll[rootserver ~]# passwd wll 编辑/usr/local/svn/conf/passwd.conf添加如下代码并保存[users] wll 123456 配置svn用户访问权限编辑usr/local/svn/conf/authz.conf添加如下代码并保存 [groups] admin wll [/] admin rw # [repos:/abc/aaa] # king rw # [repos:/pass] # king svn 注意 * 权限配置文件中出现的用户名必须已在用户配置文件中定义。 * 对权限配置文件的修改立即生效不必重启svn。 用户组格式 [groups] , 其中1个用户组可以包含1个或多个用户用户间以逗号分隔。 版本库目录格式 [版本库:/项目/目录] 用户组名 权限 用户名 权限 其中方框号内部分可以有多种写法: [/],表示根目录及以下根目录是svnserve启动时指定的我们指定为/home/svndata[/]就是表示对全部版本库设置权限。 [repos:/] 表示对版本库repos设置权限 [repos:/abc] 表示对版本库repos中的abc项目设置权限 [repos:/abc/aaa] 表示对版本库repos中的abc项目的aaa目录设置权限 权限主体可以是用户组、用户或*用户组在前面加*表示全部用户。 权限可以是w、r、wr和空空表示没有任何权限。 建立启动svn的用户 [rootserver ~]# useradd svn [rootserver ~]# passwd svn 允许用户svn访问版本库 [rootserver ~]# chown -R svn:svn /home/svndata 启动svn [rootserver ~]# su - svn -c svnserve -d --listen-port 9999 -r /home/svndata 其中 su - svn 表示以用户svn的身份启动svn -d 表示以daemon方式后台运行运行 --listen-port 9999 表示使用9999端口可以换成你需要的端口。但注意使用1024以下的端口需要root权限 -r /home/svndata 指定根目录是/home/svndata。 5.将svn加入到开机启动编辑/etc/rc.d/rc.local文件加入如下启动命令 /usr/local/svn/bin/svnserve -d --listen-port 9999 -r /home/svndata 如果想停止svn则使用如下命令killall svnserve 如果想将svn作为服务在/etc/rc.d/init.d/目录下新建名为svn的文件并设置权限为755并添加如下代码 #!/bin/bash # build this file in /etc/rc.d/init.d/svn # chmod 755 /etc/rc.d/init.d/svn # centos下可以用如下命令管理svn: service svn start(restart/stop) SVN_HOME/home/svndata if [ ! -f /usr/local/svn/bin/svnserve ] then echo svnserver startup: cannot start exit fi case $1 in start) echo Starting svnserve... /usr/local/svn/bin/svnserve -d --listen-port 9999 -r $SVN_HOME echo Finished! ;; stop) echo Stoping svnserve... killall svnserve echo Finished! ;; restart) $0 stop $0 start ;; *) echo Usage: svn { start | stop | restart } exit 1 esac 6.连接SVN安装TortoiseSVN重启系统。启动TortoiseSVN并在地址栏中输入 svn://192.168.1.87:9999/repos 根据提示输入用户名与密码后就可以