最近的一些事儿

Posted by 猪头小队长 | 简单生活 | Thursday 31 January 2008 17:56
  1. 后天晚上回家,大后天就到家了,嘻嘻。这可是花高价买的票。
  2. 移动硬盘盒坏了,花了60元整了个新的。现在的硬盘这是便宜。160G的移动硬盘400多块钱。
  3. 虚拟主机空间又换了,这下比较远,整到国外去了。原来的梦游的主机其实也是错,只是空间不够用了,正好碰上这个独立IP、不限空间的便宜的主机。哈哈。不过有两个问题:一是访问速度没有原来快了,二是服务器时间不同,stupid的lifetype博客系统对时区支持不够好。
  4. 换虚拟主机的顺便,把lifetype升级到了1.2.6。升级的过程嗷嗷简单,新装一个1.2.6,然后把旧系统的数据按新结构拷贝到新表中。省的用他的升级包,麻烦。
  5. 基金赔的厉害,买了9000块钱的基金,已经亏了1069.63了。蛤蟆世道啊~

要休假了

Posted by smily | 简单生活 | Thursday 31 January 2008 17:53

明天开始正式休假了,不过这个假期,也很奔波。要去老公家和我家。
幸好买到了卧铺,虽然是比较差的车,不过,也比硬座强多了。

blog的虚拟主机换了,速度也变慢了许多。

很久不频繁的写blog,都没啥可说的了。

在出发之前,要看个长江7号。虽然有人评价不好,也有很多人评价不错呢。

对了,士兵突击,真是不错,虽然我看的晚,但是喜爱的心,绝对不比老凸迷差哦。

恩。祝我和老公有个愉快的假期吧,难得的长假,而且是我们同步休的。呵呵

混沌的人生

Posted by smily | 简单生活 | Monday 28 January 2008 13:19

昨晚看杂志,有句话非常之有道理,在此记录一下:

人生都是混沌的,虽然真理只有一个,但通常情况是,不同的人,各执一词,各过一生。

随意,太随意

Posted by smily | 简单生活 | Thursday 24 January 2008 15:14

“哥哥”是个让人感觉安全的词;

“姐姐”是个让人感觉温暖的词;

可是我越发的觉得这两个词实在令人难以琢磨;

如果你叫一个人哥哥,他可以是你的亲哥哥,可以是你的bf,可以是你的lg,可以是朋友,可以是暧昧的关系…

如果你叫一个人姐姐,她可以是你的亲姐姐,可以是你的gf,可以是朋友,可以是暧昧的关系…

呵呵,有趣。

不过,5年前开始,我就知道了,姐姐,不是谁都配做的。

如果看不懂,请参考标题。

一周年纪念

Posted by smily | 简单生活 | Wednesday 16 January 2008 19:05

呵呵,结婚一周年了,早上刚到公司,就接到前台电话:有人给您送花。。。

于是:

2008-1-16 10:39:20 smily 猪头小队长 哈哈
2008-1-16 10:39:25 smily 猪头小队长 好感动呀。
2008-1-16 10:39:28 smily 猪头小队长 都哭呢
2008-1-16 10:39:30 smily 猪头小队长 哈哈
2008-1-16 10:39:44 猪头小队长 smily 哦,不奇怪,主要是你太容易哭呢
2008-1-16 10:39:48 猪头小队长 smily 哈哈

Linux下安装Apache2、SSL、Subversion

Posted by 猪头小队长 | 胡言乱语 | Tuesday 15 January 2008 17:11

重新安装了一下最新版本的SVN,把操作过程记录下来。

1、准备材料

[root@test]# pwd
/usr/local
[root@test]#  ll
-rw-r–r–   1 root root   6028951 Sep  6 19:31 httpd-2.2.6.tar.gz
-rw-r–r–   1 root root   3354792 Jan 15 15:11 openssl-0.9.8g.tar.gz
-rw-r–r–   1 root root   6337805 Dec 20 17:29 subversion-1.4.6.tar.gz
-rw-r–r–   1 root root   2899269 Dec 20 17:29 subversion-deps-1.4.6.tar.gz

这些东西可以到ApacheOpenSSHSubversion的网站上去下载。

2、安装OpenSSH

[root@test]# pwd
/usr/local
[root@test]# tar zxvf openssl-0.9.8g.tar.gz
[root@test]# cd openssl-0.9.8g
[root@test]# ./config shared
[root@test]# make
[root@test]# make test
[root@test]# make install
[root@test]# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
[root@test]# /sbin/ldconfig

openssl已经安装到/usr/local/ssl下面了 

3、安装Apache

[root@test]# pwd
/usr/local
[root@test]# tar zxvf httpd-2.2.6.tar.gz 
[root@test]# cd httpd-2.2.6
[root@test]# ./configure –enable-dav –enable-so –prefix=/usr/local/apache –with-ssl=/usr/local/ssl –enable-ssl
[root@test]# make
[root@test]# make install

安装Apache比较容易,安装完之后,验证一下也可以,就是启动一下Apache看看是否安装成功。一般这一步都不会出什么问题。

4、安装SVN

[root@test]# pwd
/usr/local
[root@test]# tar zxvf subversion-1.4.6.tar.gz
[root@test]# tar zxvf subversion-deps-1.4.6.tar.gz
[root@test]# cd subversion-1.4.6
[root@test]# ./configure –with-apxs=/usr/local/apache/bin/apxs
               –prefix=/usr/local/subversion –with-apr=/usr/local/apache
               –with-apr-util=/usr/local/apache –with-ssl –with-zlib
               –without-berkeley-db –enable-maintainer-mode
[root@test]# make
[root@test]# make install

这里面的参数是有一些讲究的:

  • –with-apr 和 –with-apr-util 一定要加上,不然会因为版本的问题导致编译失败,deps里面的apr和apr-util是0.9.17版本和0.9.15版本的,而Apache2需要1.x版本的,所以在这里要指定他们的路径。
  • –without-berkeley-db 不使用BDB来存储数据,那么就只能使用FSFS了,具体的区别去Google查一下就可以了,而且使用FSFS备份起来非常容易。

接下来,验证一下svn是否安装成功:

[root@test]# pwd
/usr/local/subversion/bin
[root@test]# ./svnserve –version
svnserve, version 1.4.6 (r28521)
   compiled Jan 15 2008, 13:41:55

Copyright (C) 2000-2007 CollabNet.
Subversion is open source software, see http://subversion.tigris.or
This product includes software developed by CollabNet (http://www.C

The following repository back-end (FS) modules are available:

* fs_fs : Module for working with a plain file (FSFS) repository.

5、创建SVN库

把所有的数据仓库都放在/var/svn/repositories下面,先创建一个数据仓库test,修改权限以使用Apache来访问,Apache是使用daemon.daemon来启动的。

[root@test]# mkdir /var/svn/repositories
[root@test]# ./svnadmin create /var/svn/repositories/test
[root@test]# chown daemon.daemon -R /var/svn/repositories

6、配置Apache、SSL以启动SVN服务

先生成https服务所需要的 server.key 和 server.crt:

[root@test]# openssl req -new -x509 -days 30
-keyout /usr/local/apache/conf/server.key
-out /usr/local/apache/conf/server.crt
-subj '/CN=www.SimpleLife.cn Certificate'
Generating a 1024 bit RSA private key
…………………….++++++
……………………………………….++++++
writing new private key to '/usr/local/apache/conf/server.key'
Enter PEM pass phrase:******
Verifying - Enter PEM pass phrase:******

 注意记住密码,在启动httpd服务时会用到。

然后配置一下Apache(httpd.conf) ,注意有下面的配置:

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /svn>
    DAV svn
    SVNParentPath /var/svn/repositories
    AuthzSVNAccessFile /var/svn/authz.conf
    AuthType Basic
    AuthName "simplelife.cn"
    AuthUserFile /var/svn/authfile
    Require valid-user
</Location>

 
Include conf/extra/httpd-ssl.conf 

 这里面有三个路径:

  • SVNParentPath SVN仓库的上一级路径,所有的库都放在这个目录下。
  • AuthzSVNAccessFile  SVN的访问权限设置
  • AuthUserFile 用户认证文件,也就是用户名和密码的配置文件

先创建一个用户:

[root@test]# pwd
/usr/local/apache/bin
[root@test]# ./htpasswd /var/svn/authfile javor
New password: ******
Re-type new password: ******
Adding password for user javor

为这个用户设置SVN权限:

[root@test]# pwd
/var/svn/
[root@test]# more authz.conf
[/] 
javor=rw

7、启动服务

先启动https服务:期间要输入创建key时的密码:

[root@test]# pwd
/usr/local/apache/bin
[root@test]# ./httpd -k start -DSSL
Apache/2.2.6 mod_ssl/2.2.6 (Pass Phrase Dialog)
Some of your private key files are encrypted for security reasons.
In order to read them you have to provide the pass phrases.

Server www.simplelife.cn:443 (RSA)
Enter pass phrase:******

OK: Pass Phrase Dialog successful.

 浏览器访问:https://www.simplelife.cn/svn/test,应该能看到svn库了

 

[root@test]# pwd
/usr/local/apache/bin
[root@test]# ./apachectl start

 浏览器访问:http://www.simplelife.cn/svn/test

8、其他

  • 要建多个库,在/var/svn/repositories下创建就可以了,通过更改URL后面的库名就可以访问
  • 要备份库,直接将/var/svn/repositories下对应的文件夹打包就可以了,这就是使用fsfs的好处 

Linux下安装Apache2、SSL、Subversion

Posted by 猪头小队长 | 程序设计 | Tuesday 15 January 2008 17:04

重新安装了一下最新版本的SVN,把操作过程记录下来。

1、准备材料

[root@test]# pwd
/usr/local
[root@test]#  ll
-rw-r–r–   1 root root   6028951 Sep  6 19:31 httpd-2.2.6.tar.gz
-rw-r–r–   1 root root   3354792 Jan 15 15:11 openssl-0.9.8g.tar.gz
-rw-r–r–   1 root root   6337805 Dec 20 17:29 subversion-1.4.6.tar.gz
-rw-r–r–   1 root root   2899269 Dec 20 17:29 subversion-deps-1.4.6.tar.gz

这些东西可以到ApacheOpenSSHSubversion的网站上去下载。

2、安装OpenSSH

[root@test]# pwd
/usr/local
[root@test]# tar zxvf openssl-0.9.8g.tar.gz
[root@test]# cd openssl-0.9.8g
[root@test]# ./config shared
[root@test]# make
[root@test]# make test
[root@test]# make install
[root@test]# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf
[root@test]# /sbin/ldconfig

openssl已经安装到/usr/local/ssl下面了 

3、安装apache

[root@test]# pwd
/usr/local
[root@test]# tar zxvf httpd-2.2.6.tar.gz 
[root@test]# cd httpd-2.2.6
[root@test]# ./configure –enable-dav –enable-so –prefix=/usr/local/apache –with-ssl=/usr/local/ssl –enable-ssl
[root@test]# make
[root@test]# make install

安装Apache比较容易,安装完之后,验证一下也可以,就是启动一下Apache看看是否安装成功。

 3、安装SVN

[root@test]# pwd
/usr/local
[root@test]# tar zxvf subversion-1.4.6.tar.gz 
[root@test]# tar zxvf sub

Linux下安装Apache、Subversion

Posted by 猪头小队长 | 程序设计 | Tuesday 15 January 2008 14:40

重新安装了一下最新版本的SVN,把操作过程记录下来。

1、准备材料

[root@test]# pwd
/usr/local
[root@test]#  ll
-rw-r–r–   1 root root   6028951 Sep  6 19:31 httpd-2.2.6.tar.gz
-rw-r–r–   1 root root   6337805 Dec 20 17:29 subversion-1.4.6.tar.gz
-rw-r–r–   1 root root   2899269 Dec 20 17:29 subversion-deps-1.4.6.tar.gz

这些东西可以到Apache的网站上和Subversion的网站上去下载。

 2、安装apache

[root@test]# pwd
/usr/local
[root@test]# tar zxvf httpd-2.2.6.tar.gz 
[root@test]# cd /usr/local/httpd-2.2.6
[root@test]# ./configure –enable-dav –enable-so –prefix=/usr/local/apache
[root@test]# make
[root@test]# make install

安装Apache比较容易,安装完之后,验证一下也可以,就是启动一下Apache看看是否安装成功。

 3、安装SVN

[root@test]# pwd
/usr/local
[root@test]# tar zxvf subversion-1.4.6.tar.gz 
[root@test]# tar zxvf subversion-deps-1.4.6.tar.gz 
[root@test]# cd /usr/local/subversion-1.4.6
[root@test]# ./configure –with-apxs=/usr/local/apache/bin/apxs 
               –prefix=/usr/local/subversion –with-apr=/usr/local/apache 
               –with-apr-util=/usr/local/apache –with-ssl –with-zlib 
               –without-berkeley-db –enable-maintainer-mode
[root@test]# make
[root@test]# make install

 这里面这些配置有些讲究:

  • –with-apr 和 –with-apr-util 一定要加上,不然会因为版本的问题导致编译失败,deps里面的apr和apr-util是0.9.17版本和0.9.15版本的,而Apache2需要1.x版本的,所以在这里要指定他们的路径。
  • –without-berkeley-db 不使用BDB来存储数据,那么就只能使用FSFS了,具体的区别去Google查一下就可以了,而且使用FSFS备份起来非常容易。

 接下来验证一下,是否SVN安装成功了:

[root@test]# pwd
/usr/local/subversion/bin
[root@test]# ./svnserve –version
svnserve, version 1.4.6 (r28521)
   compiled Jan 15 2008, 13:41:55

Copyright (C) 2000-2007 CollabNet.
Subversion is open source software, see http://subversion.tigris.or
This product includes software developed by CollabNet (http://www.C

The following repository back-end (FS) modules are available:

* fs_fs : Module for working with a plain file (FSFS) repository.

 4、创建SVN库

 把SVN的仓库放到/var/svn/repositories目录下,在此创建一个库,名叫test

[root@test]# mkdir /var/svn/repositories
[root@test]# ./svnadmin create /var/svn/repositories/test
[root@test]# chown daemon.daemon -R /var/svn/repositories

 
5、配置Apache以启动SVN服务

修改一下Apache的配置(/usr/local/apache/conf/httpd.conf):

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /svn>
    DAV svn
    SVNParentPath /var/svn/repositories
    AuthzSVNAccessFile /var/svn/authz.conf
    AuthType Basic
    AuthName "simplelife.cn"
    AuthUserFile /var/svn/authfile
    Require valid-user
</Location>

 注意Location里面,有三个配置的路径:

  • SVNParentPath SVN仓库的上一级目录,所有的SVN仓库都在/var/svn/repositories下面
  • AuthzSVNAccessFile SVN的访问权限设置,设置哪些用户可以访问哪些SVN库
  • AuthUserFile 用户认证,基于Apache来验证用户名和密码

 创建一个新用户:

[root@test]# pwd
/usr/local/apache/bin
[root@test]# ./htpasswd /var/svn/authfile javor
New password: ******
Re-type new password: ******
Adding password for user javor

 为此用户赋予权限:

[root@test]# pwd
/var/svn/
[root@test]# more authz.conf
[/] 
javor=rw

 6、启动服务

 其他Apache即可以启动SVN服务

[root@test]# pwd
/usr/local/apache/bin
[root@test]# ./apachectl start

 浏览器访问:http://www.simplelife.cn/svn/test,注意替换中间的服务器地址为自己的服务器地址。

 7、其他

  • 要建多个库,在/var/svn/repositories下创建就可以了,通过更改URL后面的库名就可以访问
  • 要备份库,直接将/var/svn/repositories下对应的文件夹打包就可以了,这就是使用fsfs的好处

2008年的第一次加班

Posted by smily | 简单生活 | Sunday 13 January 2008 16:30

拖着疲惫的身体来到公司,毫无力气。还被招商银行气着了。这是一次悲惨的加班。
昨晚,看了一会《断臂山》,没看完,1点左右睡觉,2点被吵醒,挣扎起来,吃了点药,决定睡觉,可惜,3点疼醒,坐着,到6点。睡着。9点,起床,浑身疲惫,无力,干活。
还是说点高兴的事:今天是小亮同学的生日,祝福一下,祝她08年顺心如意。