2007年2月9日星期五

在APACHE2+PHP4+Mysql4环境下安装DMS

 Install DMS in the environment of APACHE2+PHP4+Mysql4 
[root@devtest1 src]# rpm -q httpd
httpd-2.0.52-28.ent.centos4
[root@devtest1 src]# rpm -q php
php-4.3.9-3.22
[root@devtest1 src]# rpm -q php-mysql
php-mysql-4.3.9-3.22
[root@devtest1 src]# mysqladmin --version
mysqladmin  Ver 8.41 Distrib 4.1.20, for redhat-linux-gnu on i686
 
KnowledgeTree (Document Management System) Install
   First, you must make sure PHP need Mysql support. You may need run this commond "yum install php-mysql"
   or you can get a rpm packet such as php-mysql-4.3.9-3.i386.rpm and run "rpm -ivh php-mysql-4.3.9-3.i386.rpm" to make mysql support PHP
 
    KnowledgeTree is a professional document management system, and it can manage documents easily.  The following is installation procedures:
Downlad KnowledgeTree from http://www.sourceforge.net/projects/kt-dms, and extract it to a destination, and copy it to /var/www/html/dms.
Change /var/www/html/dms/var to Apache's running user
       #chown �CR apache.apache /var/www/html/dms/var
Set database and other settting, such as database, config and so on.
       #vi /var/www/html/dms/config/config.ini
Import database schema
          #cd /var/www/html/dms   
          # mysql -p dms < sql/mysql/install/structure.sql
          # mysql -p dms < sql/mysql/install/data.sql
          # mysql -p dms < sql/mysql/install/user.sql
Install some index tools for special document index.
      # wget http://www.45.free.net/~vitus/software/catdoc
      #tar -zxf catdoc-0.94.2.tar.gz
      #cd catdoc-0.94.2
      #./configure
      #make 
      #make install 
      After compiling, copy all commands from /usr/local/bin to /usr/bin
      #wget ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/contrib/pstotext-1.9.tar.gz
      #tar xzf pstotext-1.9.tar.gz
      #cd pstotext-1.9
      #make
      After compiling, copy all commands from /usr/local/bin[or current path]to /usr/bin
Check environment by http://localhost/dms/setup, if errors appear, please modify /etc/php.ini file.
      if you modify the php.ini file, you need restart apache service such as #/etc/rc.d/init.d/httpd restart
 
Default user is admin/admin
Visit DMS home page, the default account name is admin and password is admin.
 
Reference:
http://www.ktdms.com/
Welcome to contact me by email zhuheng1229@gmail.com
 

朱恒
2007-02-09

2007年2月8日星期四

Linux上 安装 Bugzilla2.20

        Linux上 安装 Bugzilla
先安装mysql4.1.22在CENT OS 4.2
[root@devtest1 conf]# mysqladmin  --version
mysqladmin  Ver 8.41 Distrib 4.1.22, for pc-linux-gnu on i686
--------------------------------------------------------------
# cd /usr/local/src
# groupadd mysql
# useradd -g mysql mysql
# tar -xzf mysql-standard-4.1.22-pc-linux-gnu-i686.tar.gz
# mv mysql-standard-4.1.22-pc-linux-gnu-i686 /usr/local/mysql
# cd /usr/local/mysql
# cp support-files/my-medium.cnf /etc/my.cnf
# bin/mysql_install_db --user=mysql
# chown -R root  .
# chown -R mysql var
# chgrp -R mysql .
# bin/mysqld_safe --user=mysql &
修改/etc/profile,把bin加入PATH,然后#source /etc/profile
默认的安装是没有密码的,添加之
#mysqladmin -u root password your_password
添加DBD::mysql
在Unix中安装Perl模块最简单的方法是使用CPAN模块。例如:
# perl -MCPAN -e shell
cpan> install DBI
cpan> install DBD::mysql
接下来安装Bugzilla,DBD::mysql安装成功的前提下才能安装bugzilla,否则bugzilla是不可能安装成功的。
Bugzilla Install Procedure
这篇文档由同事Jacky Chan写的,有些粗略,欢迎电子邮件交流zhuheng1229@gmail.com
Description:
     The symbol "BUGZILLA_HOME" is the publication directory for bugzilla, such as "/usr/local/apache2/htdoc/bugzilla" or "/var/www/html/bugzilla".
    The symbol "APACHE_HOME" is the install directory for apache, such as "/usr/local/apache2".
 
1 Download BUGZILLA_TAR_FILE from "www.bugzilla.org" and extract this tar file.
        #tar zxpvf  bugzilla-2.20rc2.tar.gz
        #mv bugzilla-2.20rc2   BUGZILLA_HOME
2 Check the Perl modules then install required modules
       #cd BUGZILLA_HOME
       #./checksetup.pl
          Install required modules according to error messages.
3 Create a database for bugzilla and modify "localconfig" file under bugzilla. 
           Login into mysql system and create a database with name 'bugzilla'.
             # mysql �Cu root �Cpxxxx
            mysql>  create database bugzilla;
            mysql> exit
           Modify localconfig file under bugzilla home.
             #cd BUGZILLA_HOME
           # vi localconfig
             Modify this file as following.
              $db_host = 'mysql_hostname';          # where is the database?
             $db_name = bugzilla;                  # name of the SQL database
             $db_user = 'mysql_user';              # root
             $db_pass = 'password';                #your_password
             $db_sock = '/var/lib/mysql/mysql.sock';  //or '/tmp/mysql.sock'
4 Create database schema and administrator for bugzilla.
   #./checksetup.pl
   Input administrator email, real name and password, please write down password for administrator.
5 Modify Apache's configuration for bugzilla
   #vi APACHE_HOME/conf/httpd.conf
      Add following code:
      <Directory "/var/www/html/bugzilla">
     AddHandler cgi-script .cgi
     Options +Indexes +ExecCGI
     DirectoryIndex index.cgi
     AllowOverride Limit
      </Directory>
6 Restart Apache web server and test bugzilla.
     #service httpd restart
      Open a browser and visit this URL: http://localhost/bugzilla, and login as admin.
7 Bug graphs if you have installed perl graph module
#crontab �Ce
 Linux will open vi editor, and input following code:
   5 0 * * * cd /var/html/www/bugzilla ; ./collectstats.pl
Please Shift+ZZ to save cron info.
 

Some question about smmsp problem, such as error as following:
WARNING: RunAsGid for MSP ignored, check group ids (egid=48, want=51)
We should change smmsp's group to apache group.
First edit /etc/passwd, and add user smmsp.
      smmsp:x:15716:48::/var/spool/clientmqueue:/bin/sh
Then execute following command:
     # usermod -g 48 smmsp
And you can change /var/spool/clientmqueue directory mode to 777:
#chmod �CR 777 /var/spool/clientmqueue
And you should add apache user to /etc/mail/trusted-users file.
 

朱恒
2007-02-08

2007年2月6日星期二

我的春天一直有你

 
 
 
今天看到一句话,让我笑了一下:早起的鸟儿有虫吃,早起的虫儿被鸟吃.哈哈,努力哦,不要被吃就行啦



新年祝福短信免费发

Linux 命令 我的痛

一个命令,一场灾难
今天我犯了一个大错。我在一台应用程序服务器上运行了一个可以让我铭记一辈子的命令
#chown -R ver.ftp  /
我本意是给ftp组下的ver用户的home路径改在根目录下,没想到酿成了大错。
我虽然用其他办法
{#chown -R root.root /
   #chmod -R 777 /usr/local/apache2/htdocs 
}
暂时的弥补了这个错误,可是这个错误还是让我难过。
以后在服务器上运行的命令一定要先在其他机器上测试过才能用。
不然不小心就会酿成大错的。
 
 
 

     朱恒
2007-02-06
Henry Zhu
QQ:284841013
MSN:ksharp1229@hotmail.com
Email:zhuheng1229@gmail.com
Homepage:http://ksharp.anyp.cn
 
 

2007年2月4日星期日

写于立春

又一个春天来临。
妹妹QQ上面的个性签名依然没有改"又是一年冬天"。
可是今天是和冬天挥别的日子,因为今天立春。
终于决定静下心来好好想想。一年之计在于春,我想给今年做一个计划了。今年有很多事情要做,其中最重要的一件是婚姻。如果可以,我想娶妹妹回家。
还是担心工作,我要好好的多学习,不要只顾着玩,评估自己的时候,没有把握,不能确定自己是否有一门足以吃饭的本事,这是一件很悲哀的事情,我意识到了,而且我必须去面对,去改变它。想--计划--去做--检查。如果有想法,就应该去试试做一个计划,然后去实现,然后反思自己,这样才能进步。如果总是停留在想,而不去做,最后的我也必然是一事无成。不要过于羡慕别人现在怎么样怎么样,而是要正视自己现在怎么样怎么样。既然我没有办法回到过去,那么至少我应该把握今天,把握未来。
立志是一件在什么时候都不算晚的事情。我现在很明确的告诉自己。我要继续以前的梦想。
好好学习,好好工作,好好去爱。
 
 

朱恒
2007-02-05

清除XP垃圾文件脚本,另存为free.bat

@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系统LJ完成!
echo 好好学习--好好生活--好好工作--好好去爱
echo. & pause
 

     KsharP
2007-02-04
Henry Zhu
QQ:284841013
MSN:ksharp1229@hotmail.com
Email:zhuheng1229@gmail.com
Homepage:http://ksharp.anyp.cn
 
 

2007-2-4 linux 学习笔记

1.如果我想查看某个gz文件里面都有什么文件,而又不想解压缩的话,可以用
zcat flie.tar.gz | cpio �Clist 
 
2.mkdir -p一次创建多个目录
例如:
mkdir -p temp/{a,b,c}
ls temp
a b c
大括号({})中是要创建的目录名,以逗号(,)隔开,注意不能空格(或者如果真的需要空格的话,用转义符(\))。
大括号可以嵌套,例如:
mkdir -p temp{a/{a1,a2},b,c/{c1,c2}}
tree temp
temp
|-- a
| |-- a1
| `-- a2
|-- b
`-- c
|-- c1
`-- c2
 
3.tar -C指定解压缩的目录
tar -C 可以指定要将文件解压缩的目录。这个在gentoo安装手册上已经学到了:) 
 
4.用&&和||组合命令
cmd1 && cmd2 cmd2只有在cmd1成功执行后才会执行。
cmd1 || cmd2 cmd2只有在cmd1失败后才会执行。 
 
5.用{}和()执行批量命令
例如:
( cd temp; VAR=$PWD; cd; tar jxvf temp.tar.bz2 -C $VAR ) | less
temp
temp/a
...
echo $VAR
注意,括号和命令以及命令和命令之间要有空格。
使用大括号({})组合命令的话,最后一个命令后面要跟随分号(;)。
下面的命令等价于上面的命令:
 
{ cd temp; VAR=$PWD; cd; tar jxvf temp.tar.bz2 -C $VAR; } | less
 
还有一点可能跟unix下不太一样,文章中说如果()中有定义变量,不会影响到当前的shell,而{}则会影响到,我在linux下测
试没有出现这种情况,定义的变量都不会影响当前的shell。 
 
6.用grep -c来统计匹配的行数
grep -c 的作用类似grep | wc -l,不同的是,如果是查找多个文件,grep -c会统计每个文件匹配的行数,每行一个文件的
列出来,而wc -l 则列出总的统计数字。
另外grep -c 要比 grep | wc -l快一点。 
grep -o加wc -l统计所有的匹配
如果一行有多个匹配的话,grep -c只能记为一行,用grep -o | wc -l就会统计匹配的次数。 
 
 
 
 
               朱恒
        zhuheng1229@sohu.com
          2007-02-04