系统安装按照1# CentOS 6.7 x64 最小化安装
Apache/PHP/MariaDB环境按照2# CentOS 6.7 x64 Apache/PHP/Mariadb环境搭建
更新Python
#CentOS6.7x64默认使用Python2.6,我把它更新成了2.7 [root@centos2src]#wgethttp://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2 [root@centos2src]#tar-jxvfPython-2.7.3.tar.bz2 [root@centos2src]#cdPython-2.7.3 [root@centos2Python-2.7.3]#./configure--prefix=/usr/local/python2.7 [root@centos2Python-2.7.3]#make&&makeinstall [root@centos2Python-2.7.3]#mv/usr/bin/python/usr/bin/python2.6.6 [root@centos2Python-2.7.3]#ln-s/usr/local/python2.7/bin/python2.7/usr/bin/python [root@centos2Python-2.7.3]#python-V
下载、安装Subversion
相关软件在junlins_lnamp里面的src/subversion文件夹里含有,也可以单独下载
[root@centos2subversion]#wgethttps://mirrors.junlins.site/subversion/expat-2.1.0.tar.gz [root@centos2subversion]#wgethttps://mirrors.junlins.site/subversion/scons-2.4.1.tar.gz [root@centos2subversion]#wgethttps://mirrors.junlins.site/subversion/serf-1.3.8.tar.bz2 [root@centos2subversion]#wgethttps://mirrors.junlins.site/subversion/sqlite-amalgamation-3071501.zip [root@centos2subversion]#wgethttps://mirrors.junlins.site/subversion/sqlite-autoconf-3080500.tar.gz [root@centos2subversion]#wgethttps://mirrors.junlins.site/subversion/subversion-1.9.3.tar.gz #解压软件包 [root@centos2subversion]#tarzxfexpat-2.1.0.tar.gz [root@centos2subversion]#tarzxfscons-2.4.1.tar.gz [root@centos2subversion]#tarxfserf-1.3.8.tar.bz2 [root@centos2subversion]#unzipsqlite-amalgamation-3071501.zip [root@centos2subversion]#tarzxfsqlite-autoconf-3080500.tar.gz [root@centos2subversion]#tarzxfsubversion-1.9.3.tar.gz #安装软件包 [root@centos2subversion]#cdexpat-2.1.0 [root@centos2expat-2.1.0]#./configure--prefix=/usr/local/expat&&make&&makeinstall [root@centos2expat-2.1.0]#cd../scons-2.4.1 [root@centos2scons-2.4.1]#pythonsetup.pyinstall [root@centos2scons-2.4.1]#cd../serf-1.3.8 [root@centos2serf-1.3.8]#sconsPREFIX=/usr/local/serfAPR=/usr/local/apache/bin/apr-1-configAPU=/usr/local/apache/bin/apu-1-configinstall [root@centos2serf-1.3.8]#cd../sqlite-autoconf-3080500 [root@centos2sqlite-autoconf-3080500]#./configure--prefix=/usr/local/sqlite&&make&&makeinstall [root@centos2sqlite-autoconf-3080500]#cd../sqlite-amalgamation-3071501 [root@centos2sqlite-amalgamation-3071501]#mkdir-p../subversion-1.9.3/sqlite-amalgamation [root@centos2sqlite-amalgamation-3071501]#\cp-a./sqlite3.c../subversion-1.9.3/sqlite-amalgamation/ [root@centos2sqlite-amalgamation-3071501]#cd../subversion-1.9.3 [root@centos2subversion-1.9.3]#./configure--prefix=/usr/local/subversion--with-apxs=/usr/local/apache/bin/apxs--with-apr=/usr/local/apache/bin/apr-1-config--with-apr-util=/usr/local/apache/bin/apu-1-config--with-sqlite=/usr/local/sqlite--with-zlib--enable-maintainer-mode--with-serf=/usr/local/serf [root@centos2subversion-1.9.3]#make&&makeinstall [root@centos2subversion-1.9.3]#echo"/usr/local/serf/lib">>/etc/ld.so.conf&&echo"/usr/local/subversion/lib">>/etc/ld.so.conf&&ldconfig [root@centos2subversion-1.9.3]#echo"exportPATH=/usr/local/subversion/bin:$PATH">/etc/profile.d/subversion.sh [root@centos2subversion-1.9.3]#source/etc/profile.d/subversion.sh #配置Subversion #创建subversion版本库目录 [root@centos2subversion]#mkdir/data/subversion #配置Subversion启动脚本 [root@centos2subversion]#wgethttps://mirrors.junlins.site/subversion/Subversion-init [root@centos2subversion]#cpSubversion-init/etc/init.d/subversion [root@centos2subversion]#chmod+x/etc/init.d/subversion [root@centos2subversion]#chkconfig--addsubversion [root@centos2subversion]#chkconfig--level235subversionon
创建版本库(svn协议)
#版本库创建 [root@centos2~]#svnadmincreate/data/subversion/svn [root@centos2~]#mkdir-p/data/subversion/svn-folder/data/subversion/svn-folder/trunk/data/subversion/svn-folder/branches/data/subversion/svn-folder/tags [root@centos2~]#svnimport/data/subversion/svn-folderfile:///data/subversion/svn-m"Creatingbasicdirectorystructure" #用户权限管理 [root@centos2~]#sed-i's/#anon-access=read/anon-access=read/'/data/subversion/svn/conf/svnserve.conf [root@centos2~]#sed-i's/#auth-access=write/auth-access=write/'/data/subversion/svn/conf/svnserve.conf [root@centos2~]#sed-i's/#password-db=passwd/password-db=passwd/'/data/subversion/svn/conf/svnserve.conf [root@centos2~]#sed-i's/#authz-db=authz/authz-db=authz/'/data/subversion/svn/conf/svnserve.conf [root@centos2~]#sed-i's/#realm=MyFirstRepository/realm=SVNRepository/'/data/subversion/svn/conf/svnserve.conf [root@centos2~]#echo"svn=12345">>/data/subversion/svn/conf/passwd [root@centos2~]#echo"[repo:/]">>/data/subversion/svn/conf/authz [root@centos2~]#echo"svn=rw">>/data/subversion/svn/conf/authz
重启Subverison
[root@centos2~]#servicesubversionrestart
使用svn协议访问Subversion
地址:svn://172.21.35.102/svn
用户名:svn
密码:12345
创建版本库(http协议)
#版本库创建 [root@centos2~]#svnadmincreate/data/subversion/http [root@centos2~]#mkdir-p/data/subversion/http-folder/data/subversion/http-folder/trunk/data/subversion/http-folder/branches/data/subversion/http-folder/tags [root@centos2~]#svnimport/data/subversion/http-folderfile:///data/subversion/http-m"Creatingbasicdirectorystructure" #用户权限管理 [root@centos2~]#htpasswd-c/data/svnwebpasswdhttp #输入http库http用户的密码,这里使用12345 [root@centos2~]#cat>/data/svnwebaccess<<EOF [groups] [http:/] http=rw EOF #Apache配置 #日志管理 [root@centos2~]#mkdir/data/wwwlogs/subversion [root@centos2~]#chown-Rwww:www/data/wwwlogs/subversion #为apache添加mod_dav_svn和mod_authz_svn模块 [root@centos2~]#cp-r/usr/local/subversion/libexec/*/usr/local/apache/modules/ [root@centos2~]#echo"LoadModuledav_svn_modulemodules/mod_dav_svn.so">>/usr/local/apache/conf/httpd.conf [root@centos2~]#echo"LoadModuleauthz_svn_modulemodules/mod_authz_svn.so">>/usr/local/apache/conf/httpd.conf [root@centos2~]#chown-Rwww:www/data/subversion/http [root@centos2~]#chown-Rwww:www/data/subversion/http-folder [root@centos2~]#cat>/usr/local/apache/conf/vhost/subversion.conf<<EOF <VirtualHost*:8080> ServerAdminwalter.jia@junlins.com ServerNamesubversion.test.com ErrorLog"/data/wwwlogs/subversion/error_subversiong_test_com_apache.log" CustomLog"/data/wwwlogs/subversion/access_subversion_test_com_apache.log"common <Location/> DAVsvn SVNParentPath/data/subversion AuthTypeBasic AuthName"HTTPSubversion" AuthUserFile/data/svnwebpasswd AuthzSVNAccessFile/data/svnwebaccess Requirevalid-user </Location> </VirtualHost> EOF [root@centos2~]#echo"Listen8080">>/usr/local/apache/conf/httpd.conf
关闭防火墙、重启Apache
[root@centos2~]#serviceiptablesstop [root@centos2~]#servicehttpdrestart
使用http协议访问Subversion
地址:http://172.21.35.102:8080/http
用户名:http
密码:12345