三.安装php
3.1 安装php,安装它是因为svnmanager需要
- cd /root/svn
- tar xvf php-5.3.18.tar.gz
- cd php-5.3.18
- ./configure --prefix=/opt/php \
- --with-apxs2=/opt/apache2/bin/apxs \
- --with-mysql=/opt/mysql \
- --enable-mbstring
- make && make install
- cp php.ini-production /etc/php.ini
- cd ..
- rm -Rf php-5.3.18
添加apache的php支持
- sed -i '/AddType application\/x-gzip .gz .tgz/a\
- AddType application/x-httpd-php .php' /opt/apache2/conf/httpd.conf
- sed -i 's@DirectoryIndex index.html@DirectoryIndex index.php index.html@g' /opt/apache2/conf/httpd.conf
启动apache测试
- rm -f /opt/apache2/htdocs/index.html
- echo '<?php
- phpinfo()
- ?>' > /opt/apache2/htdocs/index.php
- apachectl start
访问http://$IP/测试apache,php,mysql是否部署下确
四.安装subversion
4.1 解压安装subversion
- tar xf subversion-1.6.13.tar.bz2
- tar xf subversion-deps-1.6.13.tar.bz2
- cd subversion-1.6.13
- ./configure --prefix=/opt/subversion \
- --with-apxs=/opt/apache2/bin/apxs \
- --with-apr=/opt/apache2/bin/apr-1-config \
- --with-apr-util=/opt/apache2/bin/apu-1-config
- make && make install
- echo 'export PATH=$PATH:/opt/subversion/bin' > /etc/profile.d/svn.sh
- . /etc/profile.d/svn.sh
- cd ..
- rm -rf subversion-1.6.13
4.2 让apache与svn结合
- sed -i '/httpd-default.conf/a\
- Include conf/extra/httpd-svn.conf' /opt/apache2/conf/httpd.conf
- echo '
- <Location /svn>
- DAV svn
- SVNListParentPath On
- SVNParentPath /opt/svn_repos
- AuthType Basic
- AuthName "Subversion Repository"
- AuthUserFile /opt/subversion/conf/passwdfile
- AuthzSVNAccessFile /opt/subversion/conf/accessfile
- Require valid-user
- </Location> ' > /opt/apache2/conf/extra/httpd-svn.conf
4.3 创建提到的文件
- mkdir /opt/subversion/conf
- touch /opt/subversion/conf/passwdfile
- touch /opt/subversion/conf/accessfile
- mkdir /opt/svn_repos
4.4 创建一个repo,添加一个测试账户,配置权限,测试
- svnadmin create /opt/svn_repos/test/ ##创建一个repo
- chown -R apache:apache /opt/subversion/ ##我们通过apache来管理svn的
- chown -R apache:apache /opt/svn_repos/
- htpasswd -bm /opt/subversion/conf/passwdfile test "admin"
- echo '
- [test:/]
- * = r
- test = rw ' > /opt/subversion/conf/accessfile ##access文件是权限控制文件
4.5 重启apache测试
- apachectl restart
访问http://$IP/svn/test
输入账号,密码
如果看到test - Revision 0: / 证明没问题,继续
