Chinaunix首页 | 论坛 | 博客
  • 博客访问: 266091
  • 博文数量: 53
  • 博客积分: 2580
  • 博客等级: 少校
  • 技术积分: 509
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-29 10:02
文章分类

全部博文(53)

文章存档

2014年(1)

2013年(1)

2011年(14)

2010年(37)

我的朋友

分类: LINUX

2011-01-26 15:31:18

  puppet在前端加一个SVN,用来保存所有的配置文件和pp文件,做版本管理,是最优的方案。SVN部署如下:
1、安装SubVersion及相关软件
yum install subversion apr apr-util zlib httpd mod_dav_svn mysql-devel mod_auth_mysql mod_ssl
2、创建一个repository并导入一个项目
linux# mkdir /var/www/svn
linux# svnadmin create --fs-type fsfs /var/www/svn/puppet
linux# svn import /home/development/ file:///var/www/svn/puppet/ -m "init"
linux# chown -R apache.apache /var/www/svn/
linux# mkdir /var/www/svn/auth
linux# cp /var/www/svn/development/conf/authz /var/www/svn/auth/
3、安装mysql,编译或者yum都OK
linux# /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、配置Apache
linux# vi /etc/httpd/conf.d/svn.conf

    DAV 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]:PPlive
Organizational Unit Name (eg, section) []:Operation
Common Name (eg, your name or your server's hostname) []:SerweiXu
Email Address []:xw2014@sina.com
 
6、配置SVN的验证文件
linux# vi /var/www/svn/auth/authz
[puppet:/]
xw2014 = rw
reader = r
* =
7、重启apache  
sh /etc/init.d/httpd restart
 
8、访问
阅读(1932) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-03-09 11:30:22

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com