分类: LINUX
2011-01-26 15:31:18
3、安装mysql,编译或者yum都OKlinux# /etc/init.d/mysqld start linux# chkconfig --level 345 mysqld on linux# mysqladmin -u root password 123456 linux# mysql -u root -p mysql> create database auth; mysql> use auth; mysql> CREATE TABLE users ( -> user_name CHAR(30) NOT NULL, -> user_passwd CHAR(20) NOT NULL, -> PRIMARY KEY (user_name) -> ); mysql> GRANT SELECT -> ON auth.users -> TO svn@localhost -> IDENTIFIED BY 'svnpasswd'; mysql> flush privileges; mysql> INSERT INTO users VALUES ('xw2014', ENCRYPT('xw2014passwd')); mysql> INSERT INTO users VALUES ('reader', ENCRYPT('readerpasswd')); mysql> exit
4、配置Apachelinux# vi /etc/httpd/conf.d/svn.confDAV svn SVNParentPath /var/www/svn AuthzSVNAccessFile /var/www/svn/auth/authz AuthName "Please Login.." AuthType Basic AuthMYSQLEnable on AuthMySQLUser svn AuthMySQLPassword "svnpasswd" AuthMySQLDB auth AuthMySQLUserTable users AuthMySQLNameField user_name AuthMySQLPasswordField user_passwd require valid-user 5、产生ssl证书linux# cd /etc/pki/tls/ linux# rm private/localhost.key -f linux# openssl genrsa 1024 > private/localhost.key Generating RSA private key, 1024 bit long modulus .......................................................................++++++ ..............++++++ e is 65537 (0x10001)linux# cd certs/ linux# openssl req -utf8 -new -key /etc/pki/tls/private/localhost.key -x509 -days 365 -out /etc/pki/tls/certs/localhost.crt -set_serial 0 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) [GB]:CN State or Province Name (full name) [Berkshire]:Shanghai Locality Name (eg, city) [Newbury]:Shanghai Organization Name (eg, company) [My Company Ltd]:PPliveOrganizational Unit Name (eg, section) []:Operation Common Name (eg, your name or your server's hostname) []:SerweiXu Email Address []:xw2014@sina.com6、配置SVN的验证文件linux# vi /var/www/svn/auth/authz [puppet:/] xw2014 = rw reader = r * =7、重启apachesh /etc/init.d/httpd restart8、访问
chinaunix网友2011-03-09 11:30:22
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com