subversion+openssl+apache 安装
下载源代码:到各自的官方网站下载相应的源代码的tar.gz包,解包后准备编译安装: subversion官网:http://subversion.tigris.org 下载:subversion-1.6.3.tar.gz 和 subversion-deps-1.6.3.tar.gz注:其中 subversion-deps-1.6.3.tar.gz 包含有apr、ap
下载源代码:
到各自的官方网站下载相应的源代码的tar.gz包,解包后准备编译安装:
subversion官网:http://subversion.tigris.org 下载:subversion-1.6.3.tar.gz 和 subversion-deps-1.6.3.tar.gz
注:其中 subversion-deps-1.6.3.tar.gz 包含有apr、apr-util等,就无需再去网上下载。
sqlite官网:http://www.sqlite.org/ 下载sqlite-3.6.16.tar.gz
Apache2地址:http://www.apache.org/ *版本:httpd-2.2.11.tar.gz
openssl地址:http://www.openssl.org *版本:openssl-0.9.8k.tar.gz
一、安装apache+openssl
1.#编译安装openssl
shell> cd /downloads
shell> wget http://www.openssl.org/source/openssl-0.9.8k.tar.gz
shell> tar zxvf openssl-0.9.8k.tar.gz
编译安装openssl,这个软件主要是用来生成证书:
shell> cd openssl-0.9.8k
shell> ./config --prefix=/usr/local/openssl
shell> make && make install
链接openssl命令:
shell> cd /usr/local/bin
shell> ln -s /usr/local/openssl/bin/openssl openssl
2.#编译安装apache
shell> cd /downloads
shell> tar zxvf httpd-2.2.11.tar.gz
shell> cd httpd-2.2.11
shell> ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --enable-ssl --enable-dav --enable-mods-shared=all --with-ssl=/usr/local/openssl/ #注:--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ 前提是先安装apr和apr-util源码包
shell> make && make install
注意:--prefix指定安装目录,注意一定要加--enable-so是核心能够装载DSO和--enable-dav是安装mod_dav_svn.so跟mod_authz_svn.so这两个模块
3.#生成证书
shell> cd /usr/local/apache/conf
生成服务器私钥:
shell> openssl genrsa -des3 -out server.key 1024
生成服务器证书请求,并按要求填些相关证书信息:
shell> openssl req -new -key server.key -out server.csr
签证:
shell> openssl x509 -req -days 700 -in server.csr -signkey server.key -out server.cert
4.#修改配置文件
修改 /usr/local/apache/conf/httpd.conf配置文件
#Include conf/extra/httpd-ssl.conf 去掉注释
修改 /usr/local/apache/conf/extra/httpd-ssl.conf配置文件
#SSLCertificateFile "/usr/local/apache/conf/server.crt" 改为--> SSLCertificateFile "/usr/local/apache/conf/server.cert"
5.#启动Apache2。
shell> /usr/local/apache/bin/apachectl start
二、安装subversion 及其所需插件
1.#解压subversion源码包
#解压 subversion 以及其附属包 subversion-deps
shell> tar xvzf subversion-1.6.3.tar.gz
shell> tar xvzf subversion-deps-1.6.3.tar.gz
shell> cd Subversion-1.6.3
2.#安装apr源码包
shell> cd apr
shell> ./configure --prefix=/usr/local/apr
shell> make && make install
3.#安装apr-util源码包
shell> cd ../apr-util
shell> ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
shell> make && make install
4.#安装sqlite源码包
shell> cd /downloads/
shell> tar zxvf sqlite-3.6.16.tar.gz
shell> cd sqlite-3.6.16
shell> ./configure --prefix=/usr/local/sqlite
shell> make && make install
5.#安装subversion源码包
shell> cd /downloads/
shell> tar zxvf subversion-1.6.3.tar.gz
shell> cd subversion-1.6.3
shell> ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache/bin/apxs --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-sqlite=/usr/local/sqlite --without-berkeley-db --with-ssl
shell> make && make install
三、配置subversion
1.#创建账号密码文件
shell> mkdir /data
shell> mkdir /data/svn
shell> htpasswd –c /data/svn/passwd.conf apache
输入密码,两次确认
注意:第一次设置用户密码要加入 –c 这个参数
2.#创建资料库
首先要创建一个资料库(我使用单资料库的方式),使用svnadmin增加资料库
shell> cd /usr/local/subversion/bin
shell> ./svnadmin create /data/svn/svnroot
到svnroot下看是不是多了文件,多了就是说明创建成功
3.#修改httpd.conf文件
打开apache的conf/httpd.conf,安装subversion后,apache的conf/httpd.conf文件会自动增加了模块
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
在httpd.conf末尾添加
<Location /svn>
DAV svn
SVNPath /data/svn/svnroot
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /data/svn/passwd.conf
Require valid-user
</Location>
4.#导入数据到资料库
shell> cd /usr/local/subversion/bin
shell> /usr/local/subversion/bin/svn import /要导入的目录 file:///data/svn/svnroot -m “说明文字”
重新打开浏览器,输入地址http://服务器ip/svn,输入用户名密码,出现
5.#启动svnserve服务
shell> /usr/local/subversion/bin/svnservr -r -d /data/svn/svnroot
6.#分配用户和权限
shell> cd /data/svn/svnroot
shell> vim conf/svnserve.conf
#去掉下面两行注释
#password-db = passwd
#authz-db = authz
#添加用户名和密码
shell> vim conf/passwd
#修改用户的权限
shell> vim conf/authz
修改如下
[/]
yangwm = rw
sulc = rw
更多推荐
所有评论(0)