安装subversion1.8和apache

[size=x-large]一.安装apr和apr-uti[/size]
wget http://mirror.bit.edu.cn/apache//apr/apr-1.4.8.tar.gz
tar zxvf apr-1.4.8.tar.gz
cd apr-1.4.8
./configure --prefix=/usr/local/apr
make && make install

验证:
#/usr/local/apr/bin/apr-1-config --version
1.4.8

wget http://mirrors.cnnic.cn/apache/apr/apr-util-1.5.2.tar.gz
tar zxvf apr-util-1.5.2.tar.gz
cd apr-util-1.5.2
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/
make && make install

验证:
#/usr/local/apr-util/bin/apu-1-config --version
1.5.2

[size=x-large]二.安装sqlite3[/size]
wget http://www.sqlite.org/2013/sqlite-autoconf-3080000.tar.gz
tar zxvf sqlite-autoconf-3080000.tar.gz
cd sqlite-autoconf-3080000
./configure
make && make install


[size=x-large]三.安装openssl[/size]
wget http://www.openssl.org/source/openssl-1.0.1.tar.gz
tar xzvf openssl-1.0.1.tar.gz
cd openssl-1.0.1
./config --prefix=/usr/local/openssl
make && make install


[size=x-large]四.安装apache http server 和ssl model[/size]
wget http://mirrors.cnnic.cn/apache//httpd/httpd-2.2.25.tar.gz
tar zxvf httpd-2.2.25.tar.gz
export LDFLAGS=-ldl
cd httpd-2.2.25
./configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --enable-modules=so --enable-dav --enable-maintainer-mode --enable-rewrite --enable-ssl --with-ssl=/usr/local/openssl
make && make install

设置开机启动
cp  /usr/local/apache2/bin/apachectl /etc/init.d/httpd
#编辑/etc/init.d/httpd,在第二行增加如下内容
#chkconfig: 2345 85 35
chkconfig httpd on


通过service httpd start启动服务,正常情况下会提示启动成功,通过在其他电脑上打开浏览器浏览这台服务器IP的80端口服务,如果出现It works 字样,恭喜您,安装成功

如果出现
[color=red]httpd: Could not reliably determine the server’s fully qualified domain name,[/color]
只需要编辑httpd.conf 将里面的
#ServerName www.example.com:80注释去掉即可,,并改成ServerName 127.0.0.1:80

[size=x-large]五.安装zlib[/size]
wget  http://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
tar -xvzf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make && make install



[size=x-large]六.安装subversion1.8[/size]

wget http://mirror.esocc.com/apache/subversion/subversion-1.8.4.tar.gz
tar zxvf subversion-1.8.4.tar.gz
mkdir -p ./subversion-1.8.4/sqlite-amalgamation
cp ./sqlite-autoconf-3080000/sqlite3.c ./subversion-1.8.4/sqlite-amalgamation
cd subversion-1.8.4
./configure --prefix=/opt/svn/subversion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr-util/bin/apu-1-config --with-zlib --enable-maintainer-mode
make && make install

验证:
#/opt/svn/subversion/bin/svnserve --version
svnserve, version 1.8.4 (r1534716)

[size=x-large]七、整合Apache[/size]
拷贝模块
cp /opt/svn/subversion/libexec/mod_authz_svn.so /usr/local/apache2/modules/
cp /opt/svn/subversion/libexec/mod_dav_svn.so /usr/local/apache2/modules/

编辑http.conf文件
vi /usr/local/apache2/conf/httpd.conf
在最后面增加如下内容

#加载整合svn所需so文件
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

<Location />
DAV svn
SVNParentPath /opt/svn/data/ #svn 根目录
SVNListParentPath On
SVNAutoversioning On
SVNReposName "svn"
AuthzSVNAccessFile /opt/svn/subversion/conf/authz.conf #目录分组权限
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /opt/svn/subversion/conf/passwd.conf #密码验证文件
Require valid-user
</Location>



[size=x-large]八、配置Subversion[/size]
[size=large]1)建立svn版本库目录[/size]
mkdir -p /opt/svn/data/repos

可以多建版本库目录,这里我的目录是repos

[size=large]2)建立svn版本库 [/size]
svnadmin create /opt/svn/data/repos 

因为apache的线程使用的用户是daemon
chown -R daemon /opt/svn/data/repos
chmod -R 755 /opt/svn/data/repos


[size=large]3)建立本地访问控制文件[/size]
/usr/local/apache2/bin/htpasswd -c /opt/svn/subversion/conf/passwd.conf  username

然后输入密码即可,默认是MD5加密的
添加新用户
/usr/local/apache2/bin/htpasswd  /opt/svn/subversion/conf/passwd.conf  username1 


[size=large]4)建立本地项目控制文件[/size]
touch /opt/svn/subversion/conf/authz.conf
本例authz.conf内容为:

[groups]
#<groupname1>=<username1>,<username2>
admin=username

#[<versionLib>:projectName/directory]
#@<groupsname>=<authorities>
#<username>=<authorities>

[/]
@admin = rw
#指定用户组成员可以读写根目录所有应用

[repos:/abc/aaa]
username1= rw
#指定用户username1可以读写:/abc/aaa目录的文件


[size=large]测试连接[/size]
1)启动apache
/usr/local/apache2/bin/apachectl start

2)再浏览器访问http://192.168.1.100/repos
#本例服务器ip是[color=blue]192.168.1.100[/color]
使用刚才创建的权限用户名与密码登录即可访问

[size=x-large]九.安装neon[/size]

wget http://www.webdav.org/neon/neon-0.29.6.tar.gz
tar zxvf neon-0.29.6.tar.gz
cd neon-0.29.6
./configure --prefix=/usr/local/neon
make && make install


[size=x-large]十、配置https[/size]
1:生成证书私钥
[code="xml"]
#128位rsa算法生成密钥
# openssl genrsa 1024 > server.key
Generating RSA private key, 1024 bit long modulus
.....++++++
......++++++
e is 65537 (0x10001)
[/code]
2.填写凭证申请书
被问及Common Name的时候,请输入你的web服务器的hostname 例如:SVN-SERVER.
被问及A challenge password的时候,直接按回车继续。否则每次你运行/usr/local/httpd/apachectl start启动服务器的时候你都要输入密码。这也就意味着如果你的服务器因为某些原因重新启动了,除非你在服务器旁手动敲入了密码,否则你的web服务器就不会启动
[code="xml"]
# openssl req -new -key server.key > server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [XX]:CN
State or Province Name (full name) []:beijing
Locality Name (eg, city) [Default City]:beijing
Organization Name (eg, company) [Default Company Ltd]:none
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:SVN-SERVER
Email Address []:

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
[/code]

3:生成web证书

openssl req -x509 -days 365 -key server.key -in server.csr > server.crt


4:添加相关证书文件

cp ./server.crt /usr/local/apache2/conf
cp ./server.key /usr/local/apache2/conf


5.编辑httpd.conf
取消httpd.conf下面这句之前的'#',以启用ssl支持
Include conf/extra/httpd-ssl.conf


6.设置httpd-ssl.conf文件

cd /usr/local/apache2/conf/extra
vim httpd-ssl.conf
SSLCertificateFile "/usr/local/apache2/conf/server.crt"
SSLCertificateKeyFile "/usr/local/apache2/conf/server.key"


7.强制通过SSL方式访问svn服务
同时在httpd.conf 的<Location />配置里增加
SSLRequireSSL
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值