SmileFace
与java一起走过的日子
posts - 41,  comments - 8,  trackbacks - 0
I am trying to run wireshark in linux using sudo, but was told: i am not in the sudoer files. So I must edit this file to add my own user into this file. Steps as follows:

1. su to root:  su-
 2. open sudoers:  visudo /etc/sudoers
3. add my user name:  testuser ALL=(ALL) NOPASSWD:ALL
    This lines means that the user "testuser" can execute from ALL terminals, acting as ALL (any) users, and run ALL (any) command.

The detail is in paper:  http://www.go2linux.org/sudoers-how-to






posted @ 2009-08-28 04:28 SmileFace 阅读(225) | 评论 (0)编辑 收藏
In order to supports internationalization (I18N), on Tomcat some additional configuration is necessary. You must
ensure that Tomcat's URI encoding is set to UTF-8. You can do this by editing the Tomcat configuration file
conf/server.xml and adding URIEncoding=”UTF-8” to each connector element, as shown below:

<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" debug="0"
acceptCount="100" connectionTimeout="20000"
disableUploadTimeout="true"
URIEncoding="UTF-8" />

And make sure you do this for every connectort.
posted @ 2009-08-20 13:45 SmileFace 阅读(274) | 评论 (0)编辑 收藏
I planned to install Roller in my centOS which need tomcat6. But centos5.3 has tomcat5 in it's yum. So I have to install tomcat6 using other way. I searched and found this good install guide in:
     http://cloudservers.mosso.com/index.php/CentOS_-_Tomcat_6 ( or http://de0ris.blogspot.com/2008/08/installing-tomcat-6x-on-centos-5.html )
which give detail instructions. I choose some important part and paste here in case for late use.

1.  install appache ant:  (note: download and put the tar file in /usr/share first )
   tar -xzf apache-ant-1.7.1-bin.tar.gz



2. install tomcat:(note: download and put the tar file in /usr/share first )



tar -xzf apache-tomcat-6.0.18.tar.gz

3.  create a symbolic link for Ant so other applications can easily find it. Be sure to select the correct version when you create your link.
ln -s /usr/share/apache-ant-1.7.1/bin/ant /usr/bin

4. set JAVA_HOME:
cd /usr/share/apache-tomcat-6.0.18/bin

vi catalina.sh

enter insert mode. Enter the following:

JAVA_HOME=/usr/java/jdk1.6.0_14

Test:
cd /usr/share/apache-tomcat-6.0.18/bin

./startup.sh

5.Automating atartup:   Right now Tomcat will not start up on it's own so we need to create a startup script for this. To do this:
cd /etc/init.d

vi tomcat

Press i to enter insert mode and paste in the following:

#!/bin/bash

# chkconfig: 234 20 80

# description: Tomcat Server basic start/shutdown script

# processname: tomcat

JAVA_HOME=/usr/java/jdk1.6.0_14

export JAVA_HOME

TOMCAT_HOME=/usr/share/apache-tomcat-6.0.18/bin

START_TOMCAT=/usr/share/apache-tomcat-6.0.18/bin/startup.sh

STOP_TOMCAT=/usr/share/apache-tomcat-6.0.18/bin/shutdown.sh

start() {

echo -n "Starting tomcat: "

cd $TOMCAT_HOME

${START_TOMCAT}

echo "done."

}

stop() {

echo -n "Shutting down tomcat: "

cd $TOMCAT_HOME

${STOP_TOMCAT}

echo "done."

}

case "$1" in

start)

start

;;

stop)

stop

;;

restart)

stop

sleep 10

start

;;

*)

echo "Usage: $0 {start|stop|restart}"

esac

exit 0

Be sure to change the following items in the above file:

* JAVA_HOME path

* TOMCAT_HOME path

* START_TOMCAT path

* STOP_TOMCAT path

Once you have those changes made, save the file and quit.

Now we need to change the permissions on the file.

chmod 755 tomcat

We need to set the script to start with other system services and set the runlevels.

chkconfig --add tomcat

chkconfig --level 234 tomcat on

You can verify that it is listed by typing chkconfig --list tomcat.

tomcat         	0:off	1:off	2:on	3:on	4:on	5:off	6:off

Test your shutdown and startup script.

sudo /sbin/service tomcat stop

sudo /sbin/service tomcat start

Tomcat 6 should now be installed under CentOS.

    



posted @ 2009-08-20 13:12 SmileFace 阅读(696) | 评论 (0)编辑 收藏
1.Agile model driven development(AMDD): focus on model

2.Extreme programmning: focus on full development life cycle.

3.Jconsole: c:\program files\java\jdk1.6.0_14\bin\jconsole, which could dectect the memory issue, class loading, garbage collection...
posted @ 2009-08-20 01:43 SmileFace 阅读(120) | 评论 (0)编辑 收藏
一看书名就知道又是一本通俗易懂的书。果不其然,而且比想象的更有意思(我想是简单的缘故吧)。

书里只是很简单的提及了一些网络的基本概念和运作原理,似乎各个方面都有覆盖,但是因为描述的很浅显,所以建议给:
1 想大致了解DNS,ARP,router等网络知识的人;
2 有闲但是对于网络感兴趣的人;

其实不错,无聊的时候翻翻,解闷!

posted @ 2009-08-19 14:08 SmileFace 阅读(147) | 评论 (0)编辑 收藏
centos

0. /sbin/ifconfig

1. mysql :

   *remove: yum -y remove mysql mysql-server
   *insatll: yum -y install mysql mysql-server
 
   *check: chkconfig --list | grep mysql
  
   *Set to Start on Boot:
       chkconfig mysqld on

   *start service:
       service --status-all
       service mysqld start
       check:  mysqladmin version    
 
   *setup root password:
    mysqladmin -u root password ***(this is new password)

    *run:
    mysql -u root -p

    *exit:
    \q

    *commands:ep t
    show databases;

    drop database ***;

2. Tomcat:

    *install:
        yum -y install tomcat5 tomcat5-webapps tomcat5-admin-webapps

    *You can find these packages using
        yum list available tomcat5*
        or
        yum search tomcat5

    *Start:
        service tomcat5 start
       
    view:   http://localhost:8080/.

    *location:r
         /usr/share/tomcat5 .
        *setting:
            "$CATALINA_HOME".

3. JDK:

     * Originally, centOS only install jre. so we need install jdk by ourselves.
     *To install from the command line:
$yum install java-1.6.0-openjdk-devel

You can also install all the OpenJDK 6 packages, including the API documentation, by using the wildcard java-1.6.0-openjdk*.

      *location:         /usr/lib/jvm...
      *check:  java -version
        






posted @ 2009-08-13 07:31 SmileFace 阅读(162) | 评论 (0)编辑 收藏

最近赋闲,借来这本书看。本来希望很大,期冀可以学到些东西。结果,事与愿违。

总的感觉:这书一般,不推荐给大家,尤其是对于有项目开发经验的人。在这个200多页的书里,作者罗列了项目开发方法,开发工具,开发环境等等。因为涉及内容太多,所以每个知识点都是一带而过,不过讲讲优点,缺点。所以感觉四不像。

如果你是个没有项目开发经验的人,想全面地了解目前web开发的基本过程,项目可能涉及的技术方面,可以看看。


下面是自己的一些读书笔记,你们可以掠过:

1.Agile model driven development(AMDD): focus on model

2.Extreme programmning: focus on full development life cycle.

3.Jconsole: c:\program files\java\jdk1.6.0_14\bin\jconsole, which could dectect the memory issue, class loading,

garbage collection...
 

Java profilers: analyze the heap for memory usage and leaks, CPU utilization, trace object and methods,determine performance bottlenecks...

4.Ant new feature:

      <exec command="date"/>

   Get:  fetch a file using HTTP GET.

      <get src="http://visualpatterns.com/comics/funny.gif" dest="funny.gif"  verbose="true"/>

   Sleep: pause processing.
 
 <sleep seconds="2"/>
 
   FTP: use FTP directly. The example transfe the files to ftp server automatically using windows scheduled tasks
 <ftp server="mirror.kernel.org"
      action="get"
      remotedir=...> </ftp>

   MAIL: ...

5. JMX: my thought: I can use it to track how many user signed into, and so on.

6.unchecked exception: do not need to be caught by the code. Checked exception require the code to either cathch the exception or throw it up the call chain using throws. "If  a client can reasonble to recover from an exception, make it a checked exception. If client cannot do anything to recover from the excepetion, make it unchecked"

posted @ 2009-07-25 07:38 SmileFace 阅读(198) | 评论 (0)编辑 收藏

在windows和fedora 4下都安装了postgresql,有2点体会:

1。windows下安装postgresql,最好在安装前先建立“limit”权限的用户postgres;当然,看见报错的时候再加也来的及呀;

2。在fedora 4 下安装,要么用rpm安装低版本的postgresql,要么用source逐步安装最新版本的。用rpm比较简单,不说了;
    如果安装source,不要到网上到处找帮助,直接在postgresql的网站上找到权威文档就行:http://www.postgresql.org/docs/8.2/static/installation.html。 我觉得很实用。按照它的步骤做下来,ok。 尤其是,注意看里面14.2中关于requirments的说明,在configure时记得使用--without-readline option,否则会出错的。

posted @ 2007-05-25 22:42 SmileFace 阅读(349) | 评论 (0)编辑 收藏
前天开始在fedora 4 下安装java的这一套开发环境,满以为很简单,后来发现里面还是有点小trick的,而且在网上并没有找到类似的完整讲解的文章,所以写出来共享。希望对大家有所帮助。

安装的版本: jdk1.5.0_11+Tomcat5.0.28+Eclipse3.2.2+Sysdeo3.2.1

说明:

1、fc4第一次有了自带的全套java开发环境,也就是说,如果你完全安装,那么jdk,tomcat和eclipse都是直接装好的。据说这是因为版权的原因不再使用sun的jdk,所以才会这样。但是却害苦了我。我遇到了一个接一个的问题。后来再网上搜了一遍,看了写文章,结论是:fc4自带的这套环境不能用,最好自己装。于是就有了我的子装过程和这片文章。注意:我遇到的问题主要来自sysdeo,如果你不使用这个插件,也许fc4的环境可以将就用。

2、安装jdk和tomcat需要是root用户,安装eclipse和sysdeo最好使用开发者自己的用户。

安装过程:

1 安装jdk:   参考文档:http://www.sitepoint.com/article/jakarta-tapestry

   su 到root用户:

    1.1 下载jdk-1_5_0_11-linux-i586-rpm.bin;
   1.2 要执行文件,须先change文件的perrmissions: chmod +x jdk-1_5_0_11-linux-i586-rpm.bin
  
    1.3 执行文件:./jdk-1_5_0_11-linux-i586-rpm.bin
    1.4 在etc/profile.d新建java.sh,如下:
  
     if ! echo ${PATH} | grep -q /usr/java/jdk1.5.0_11/bin ; then
      export PATH=/usr/java/jdk1.5.0_11/bin:${PATH}
    fi
    if ! echo ${PATH} | grep -q /usr/java/jdk1.5.0_11/jre/bin ; then
      export PATH=/usr/java/jdk1.5.0_11/jre/bin:${PATH}
    fi
    export JAVA_HOME=/usr/java/jdk1.5.0_11
    export CLASSPATH=.:/usr/java/jdk1.5.0_11/lib/tools.jar:/usr/java/jdk1.5.0_11/jre/lib/rt.jar
    
2.安装tomcat:我完全参考文档:http://linux-sxs.org/internet_serving/c140.html#INSTALL。这个文章很好,强烈推荐。

3、安装eclipse: 没有trick。
      3.1 su到普通的开发用户;
       3.2 unzip即可。
       3.3 ./eclipse即可启动。
4、安装sysdeo:
       因为在windows下这个插件用的很顺手,所以在linux下我也希望能接着用它。
       以普通用户身份下载,unzip,然后mv到eclips的plugins下,即可。
 
        重新启动eclipse,小猫的图标在。再在window/perferences下配置一下。运行,就出问题了。原因是:tomcat的启动只有root有权限,现在是普通用户的模式下,权限受限。solution:  让普通用户接管tomcat的权限。

       做法是:chown -R test:test  /opt/tomcat
   这里的 test:test是我自己的用户名和用户组,opt/tomcat是catalina_home。
   注意:如果这里的/opt/tomcat是sambolic link的话,真正的目录也需要chown。即,如果是opt/jarcartar_tomcat_1.5.0指向opt/tomcat,那么opt/jarcartar_tomcat_1.5.0也要chown。



这下应该就ok了。
posted @ 2007-05-25 11:32 SmileFace 阅读(408) | 评论 (0)编辑 收藏

<2007年5月>
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

常用链接

留言簿(2)

随笔分类

随笔档案

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜