Top_bar_btn_squeeze
走了,新的坑:http://amsz.yo2.cn/ 

阿姆斯壮 2007-07-06 00:10 发表评论

环境:Linux AS4、Apache2.2、PHP 4.4.7、DokuWiki-2007-05-24

Apache的安装见前文

PHP

  1. 下载php-4.4.7.tar.gz,解压
  2. ./configure --with-apxs2=$APACHE_HOME/bin/apxs
  3. make & make install
  4. cp php.ini-dist &PHP_HOME/etc/php.ini

DokuWiki

  1. 下载dokuwiki-2006-11-06.tgz,解压
  2. 为apache添加rewrite模块:
    cd $APACHE_HOME/modules/mappers
    $APACHE_HOME/bin/apxs -i -a -c mod_rewrite.c
  3. 检查httpd.conf中是否已经加入:LoadModule rewrite_module libexec/mod_rewrite.so
  4. 配置apache的httpd.conf
    Alias /wiki "/local/xsun/servers/dokuwiki"
    <Directory "$DokuWiki_HOME">
    Allow from all 

    AddType application/x-httpd-php .php .phtml
    AddType application/x-httpd-php-source .phps
    RewriteEngine on

    RewriteBase /wiki

    RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
    RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1  [QSA,L]
    RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1
    &id=$2  [QSA,L]
    RewriteRule ^$                        doku.php  [L]
    RewriteCond %{REQUEST_FILENAME}       !-f
    RewriteCond %{REQUEST_FILENAME}       !-d
    RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
    RewriteRule ^index.php$               doku.php
    php_value auto_prepend_file "$DokuWiki_HOME/prepend.php"
    </Directory>
  5. $APACHE_HOME/bin/apachectl start

DokuWiki 安全配置

在$DokuWiki_HOME目录下创建prepend.php,和apache的配置文件对应,在执行会预先加载
<?php
define('DOKU_CONF','$DokuWiki_HOME/conf/');
define('DOKU_INC','$DokuWiki_HOME');
?>

然后将$DokuWiki_HOME目录下的文件夹都移出,例如$Wiki_HOME
ln -s $DokuWiki_HOME/lib $Wiki_HOME/lib
在$DokuWiki_HOME/conf/local.php文件中添加:$conf['savedir'] = '$Wiki_HOME/data';
在浏览器中打开install.php,配置完后将这个文件删除

下面是我配置过的文件:
local.php:
$conf['title'] = 'My Wiki';
$conf['useacl'] = 1;
$conf['superuser'] = '@admin';
$conf['userewrite'] = '1';
$conf['useslash'] = 1;
$conf['sepchar'] = '-';
$conf['openregister'] = '0';

 $conf['savedir'] = '/local/xsun/wiki/data';
@include(DOKU_CONF.'local.protected.php');

users.auth.php:
test:61e7250f72098cf2602541ffbaf66e59:LALALA:pepsixp@gmail.com:admin,user

acl.auth.php:
*               @ALL          1
*               @user         8



阿姆斯壮 2007-06-14 22:13 发表评论

PEPSIXP = PEPSI + XP = 百事可乐 + 极限编程 = 一个爱喝百事可乐,向往加入敏捷团队的程序员
冰云的敏捷团队建设看得我心直痒痒,貌似看到了一个程序员的天堂。有的团队成天忙忙碌碌,进度缓慢Bug大堆还浪费了自己大好的年华;有的团队嘻嘻哈哈,却有着极高的工作效率,这就是环境带来的差异。

女怕嫁错郎,男怕入错行,老话没错的!写在公司又一同志离职当天晚上。



阿姆斯壮 2007-06-13 00:08 发表评论
IDEA 6.0.4 不能跑Junit4.2 - ISSUES
IDEA 6.0.5 不能跑Junit4.3 - ISSUES

Intellij IDEA总是慢一拍,所以最高版本的配置就是:IDEA 6.0.5 + Junit4.2

阿姆斯壮 2007-04-04 14:43 发表评论

主表有两个字段映射到副表,可以取得唯一记录,但这条记录不定存在,这两个字段需要做条件过滤,就这个状况。

Hibernate Annotation 配置的注意点:

  • 需要映射字段的@Column属性设为insertable = false, updatable = false,
    • 不产生列重复的异常 
    • 在hql解析的时候,自动合并相同的列(参考)
  • 类必须implements Serializable,不然会抛ClassCaseException(郁闷4个小时 -_-!)
HQL
select  s from ScopeProjection s  left   join fetch s.overridewhere s.hubsite=ands.companyabbr=?

CODE
@Entity
@SequenceGenerator(name
= " SEQ_GEN " , sequenceName = " SCOPEPROJECTIONSEQ " )
public   class  ScopeProjection  implements  Serializable {
    
private  Integer id;
    
private  String hubsite;
    
private  String companyabbr;
    
private  ScopeProjectionOverride override;

    @Id
    @Column(name 
=   " PROJECTIONID " )
    @GeneratedValue(strategy 
=  GenerationType.AUTO, generator  =   " SEQ_GEN " )
    
public  Integer getId() {
        
return  id;
    }

    
public   void  setId(Integer id) {
        
this .id  =  id;
    }

    @Column(name 
=   " HUBSITENAME " , nullable  =   false , insertable  =   false , updatable  =   false )
    
public  String getHubsite() {
        
return  hubsite;
    }

    
public   void  setHubsite(String hubsite) {
        
this .hubsite  =  hubsite;
    }

    @Column(name 
=   " COMPANYABBREVIATION " , nullable  =   false , insertable  =   false , updatable  =   false )
    
public  String getCompanyabbr() {
        
return  companyabbr;
    }

    
public   void  setCompanyabbr(String companyabbr) {
        
this .companyabbr  =  companyabbr;
    }
    
    @OneToOne(cascade 
=  CascadeType.PERSIST)
    @JoinColumns ({
        @JoinColumn(name 
=   " COMPANYABBREVIATION " , referencedColumnName  =   " COMPANYABBREVIATION " ),
        @JoinColumn(name 
=   " HUBSITENAME " , referencedColumnName  =   " HUBSITENAME " )
    })
    
public  ScopeProjectionOverride getOverride() {
        
return  override;
    }

    
public   void  setOverride(ScopeProjectionOverride override) {
        
this .override  =  override;
    }
}

@Entity
@SequenceGenerator(name
= " SEQ_GEN " , sequenceName = " SCOPEOVERRIDESEQ " )
public   class  ScopeProjectionOverride  implements  Serializable {
    
private  Integer id;
    
private  String companyabbr;
    
private  String hubsitename;

    @Id
    @Column(name 
=   " OVERRIDEID " )
    @GeneratedValue(strategy 
=  GenerationType.AUTO, generator  =   " SEQ_GEN " )
    
public  Integer getId() {
        
return  id;
    }

    
public   void  setId(Integer id) {
        
this .id  =  id;
    }

    @Column(name 
=   " COMPANYABBREVIATION " )
    
public  String getCompanyabbr() {
        
return  companyabbr;
    }

    
public   void  setCompanyabbr(String companyabbr) {
        
this .companyabbr  =  companyabbr;
    }

    
public  String getHubsitename() {
        
return  hubsitename;
    }

    
public   void  setHubsitename(String hubsitename) {
        
this .hubsitename  =  hubsitename;
    }
}


阿姆斯壮 2007-02-01 23:55 发表评论

创建

  1. mkdir /etc/svn/repos1
  2. svnadmin create /etc/svn/repos1
  3. svn import file:///etc/svn/repos1  --message "init" // 导入当前目录下所以文件
    svn import /local/mydir/ file:///etc/svn/repos1  --message "init" // 导入指定目录下所以文件

查看

  • svn list --verbose file:///etc/svn/repos1/
  • svnlook info /etc/svn/repos1/
  • svnlook tree /etc/svn/repos1/ --show-ids

Apache权限控制

${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 
/etc/svn/repos1
SVNListParentPath on

AuthType Basic
AuthName 
"MY SVN Repository"
AuthUserFile 
/etc/svn/repos1/passwd.conf
AuthzSVNAccessFile 
/etc/svn/repos1/authz.conf
Require vaild-user
</Location>

创建用户和密码:${apache}/bin/htpasswd /etc/svn/repos1/authz.comf user1

authz.conf的配置:
[groups]
group1 
= user1
group2 
= user1,user2

[
/]
* = r

[project1
:/path1]
@group1 = rw

[project1
:/path2]
@group2 = rw

取出:svn co file:///etc/svn/report1

另外需要修改两个地方,不然无法提交修改的文件:

  1. chown -R sysuser:sysuser /etc/svn/report1
    chmod -R 700 /etc/svn/report1
  2. 在${apache}/conf/httpd.conf中找到:
    User daemon
    Group daemon
    改为
    User sysuser
    Group sysuser
    以root用户启动apache后,自动切换到sysuser身份运行


阿姆斯壮 2006-12-21 13:38 发表评论

环境:SunOS 5.9 Generic、Apache-2.2.3、Subversion-1.4.2

Apache

  1. 下载httpd-2.2.3.tar.gz,解压
  2. 检查path是否加入了:/usr/ccs/bin,这是我make报错的根源,之后就一马平川了
  3. $ ./configure --enable-dav --enable-so --prefix=/usr/local/apache2/
  4. $ make;make install
  5. 修改/usr/local/apache2/conf/httpd.conf中的ServerName的配置,写上服务器的IP地址和端口号,例如ServerName  12.34.56.78:80
  6. 进入bin目录启动(需要root),# ./apachectl start
  7. 打开浏览器http://ip_address/,等待测试页"It works!"的出现 :_)

Subversion

  1. 下载neon-0.26.2.tar.gz,解压
  2. $ ./configure --prefix=/usr/local/neon; make; make install
  3. 下载subversion-1.4.2.tar.gz,解压
  4. $ ./configure --prefix=/usr/local/subversion --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apache2 --with-apr-util=/usr/local/apache2 --with-neon=/usr/local/neon --with-ssl --with-zlib
  5. $ make;make install
  6. 修改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 /home/svnroot/
    </Location>
  7. 创建仓库:
    $ mkdir /home/svnroot/
    $ cd /usr/local/subversion/bin
    $ ./svnadmin create /home/svnroot/test
    $ ./svn import /home/user/import file:///home/svnroot/test –m "import files test"
  8. 重启Apache
    $ ./usr/local/apache2/bin/apachectl restart
    打开浏览器:http://localhost/svn/test ,应该能看到些什么东西


阿姆斯壮 2006-12-04 13:16 发表评论
升级了一下ubuntu,记录一下
  1. 激活root用户:
    sudo passwd root
  2. 修改源:
    sudo gedit /etc/apt/sources.list
    删除所有内容并添加如下信息(江苏省常州市电信):
    deb http://ubuntu.cn99.com/ubuntu/ edgy main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu/ edgy-security main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu/ edgy-updates main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu/ edgy-proposed main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu/ edgy-backports main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu-cn/ edgy main restricted universe multiverse
  3. 升级系统:
    sudo apt-get update
    sudo apt-get dist-upgrade
  4. 设置本地local环境:
    sudo dpkg-reconfigure locales
  5. 安装中文语言支持:
    do apt-get install language-pack-gnome-zh language-pack-gnome-zh-base language-pack-zh language-pack-zh-base language-support-zh
  6. 安装中文字体:
    sudo apt-get install ttf-arphic-ukai ttf-arphic-uming
  7. 安装编译环境:
    sudo apt-get install build-essential
  8. 更改 GRUB 菜单内开机系统的预设值
    sudo vi /boot/grub/menu.lst
    修改 ... default 0 ...
好了,注销一下电脑,再次登入后按 Ctrl + 空格键(激活输入法) 应该可以使用,并且整个界面都是中文的了。

阿姆斯壮 2006-11-12 00:52 发表评论
Links for the day
Links for the day
Pages:      1 2 Next

sponsor
time tracking harvest

Harvest - Simple time tracking, powerful reporting.

Suprss
(Subscribe to this page via RSS!)