一、准备工作
1.更新yum源
# yum -y update
2.sftp上传如下文件:
jdk-7u65-linux-i586.tar.gz
mysql57-community-release-el6-11.noarch.rpm
apache-tomcat-7.0.85.tar.gz
svnadmin-3.0.5.zip
二、JDK安装及配置
具体安装及配置过程可以参考博客(CI系列之一:JDK安装及配置)
三、开放防火墙端口80(Apache服务对外访问端口)、8080(Tomcat服务默认对外访问端口)
具体开放端口的过程可以参考博客(CI系列之二:MySQL安装及配置)中开放3306端口的详细过程。
四、安装及配置Tomcat
1.切换到安装目录
# cd /usr/local
2.解压apache-tomcat-7.0.85.tar.gz
# tar -zxvf apache-tomcat-7.0.85.tar.gz
3.删除ROOT目录的所有文件,war包需要解压到ROOT目录下,不然会有些功能不能使用
# cd /usr/local/apache-tomcat-7.0.85/webapps/ROOT
# rm -rf *
五、MySQL安装及配置
具体开放端口的过程可以参考博客(CI系列之二:MySQL安装及配置)
六、Apache安装及配置
1.查看已安装的Apache服务
# rpm -qa | grep httpd
httpd-2.2.15-60.el6.centos.6.x86_64
httpd-tools-2.2.15-60.el6.centos.6.x86_64
2.卸载已安装的Apache服务
# rpm -e --nodeps httpd-2.2.15-60.el6.centos.6.x86_64
# rpm -e --nodeps httpd-tools-2.2.15-60.el6.centos.6.x86_64
3.安装
# yum -y install httpd httpd-devel
4.配置
# vi /etc/httpd/conf/httpd.conf
ServerName localhost:80
5.启动
# service httpd start
6.访问
http://192.168.2.141
7.设置Apache服务开机自启和查看是否设置成功
# chkconfig httpd on // 设置开机自启
# chkconfig --list httpd // 查看是否设置成功
七、svn和mod_dav_svn安装及配置
1.安装svn和mod_dav_svn
# yum -y install mod_dav_svn subversion
2.查看是否设置成功
# svn --version
3.配置SVN
# cd /usr/local
# mkdir svn
# cd svn
# touch authz
# touch passwd.http
# vi /etc/httpd/conf.d/subversion.conf
DAV svn
SVNListParentPath on
SVNParentPath /usr/local/svn
AuthType Basic
AuthName "Subversionrepositories"
AuthUserFile /usr/local/svn/passwd.http
AuthzSVNAccessFile /usr/local/svn/authz
Require valid-user
RedirectMatch ^(/usr/local/svn)$ $1/
4.重启httpd服务
#service httpd restart
八、部署svnadmin
1.解压svnadmin-3.0.5.zip
# cd /usr/local
# unzip svnadmin-3.0.5.zip
# mv svnadmin-3.0.5/ svnadmin
2.创建数据库并运行SQL文件进行初始化
# mysql -uroot -p
> create database `svnadmin` default character set utf8 collate utf8_general_ci;
> use svnadmin;
> source /usr/local/svnadmin/db/mysql5.sql;
> source /usr/local/svnadmin/db/lang/en.sql
3.部署war包到ROOT根目录
# cd /usr/local/svnadmin-3.0.5.war /usr/local/apache-tomcat-7.0.85/webapps/ROOT
# unzip svnadmin-3.0.5.war
4.配置数据库连接
# cd WEB-INF
# vi jdbc.properties
MySQL.jdbc.driver=com.mysql.jdbc.Driver
MySQL.jdbc.url=jdbc:mysql://localhost:3306/svnadmin?characterEncoding=utf-8
MySQL.jdbc.username=root
MySQL.jdbc.password=******
5.启动Tomcat
# cd /usr/local/apache-tomcat-7.0.85/bin/
# ./startup.sh
6.查看运行日志,检测运行情况
# cd /usr/local/apache-tomcat-7.0.85/logs/
# tail -f catalina.out
7.访问SVNAdmin
http://192.168.2.141:8080