在路上 ……

Linux系统运维与架构

一,安装操作系统,没什么特别的,我装了桌面和开发包,还有老开发包
安装完成后验证下面三个包是否存在
rpm -qa|grep compat-libstdc++

compat-libstdc++-33-3.2.3-47.3.i386.rpm
compat-libstdc++-33-3.2.3-47.3.x86_64.rpm
compat-libstdc++-296-2.96-132.7.2.i386.rpm

二,安装JDK
一定要去下载IBM 1.4.2 for AMD64/EM64T的JDK,下载完,安装
然后可以创建一个link,方便调用
ln -s /opt/IBMJava2-amd64-142 /opt/jdk
三,设置系统环境变量
修改/etc/profile,增加下面的内容

export JAVA_HOME=/opt/jdk
export DB2USELOCALJRE=TRUE
export RPM_FORCE_NPTL=1

四,解压缩安装包到指定目录。我解压到了/DB2_64目录下,自动生成了335_ESE_LNXAMD26_64_NLV目录
进入安装包的目录
cd /DB2_64/335_ESE_LNXAMD26_64_NLV
经过很多次尝试,都无法使用图形界面安装,所以我开始使用命令行安装
安装包自带的JDK有问题,进入db2/linux26目录
mv java java.orig
ln -s /opt/IBMJava2-amd64-142 java
这样使用我们自己安装的64bit的JDK
然后安装数据库软件
[root@test linux26]# ./db2_install -p DB2.ESE

IBM_db2msen81...
Preparing... ##################################################
IBM_db2msen81 ##################################################
IBM_db2cliv81...
Preparing... ##################################################
IBM_db2cliv81 ##################################################
IBM_db2icw81...
Preparing... ##################################################
IBM_db2icw81 ##################################################
IBM_db2ldap81...
Preparing... ##################################################
IBM_db2ldap81 ##################################################
IBM_db2wmsa81...
Preparing... ##################################################
IBM_db2wmsa81 ##################################################
IBM_db2cucs81...
Preparing... ##################################################
IBM_db2cucs81 ##################################################
IBM_db2conv81...
Preparing... ##################################################
IBM_db2conv81 ##################################################
IBM_db2secl81...
Preparing... ##################################################
IBM_db2secl81 ##################################################
IBM_db2sesm81...
Preparing... ##################################################
IBM_db2sesm81 ##################################################
IBM_db2icuc81...
Preparing... ##################################################
IBM_db2icuc81 ##################################################
IBM_db2icut81...
Preparing... ##################################################
IBM_db2icut81 ##################################################
IBM_db2jhen81...
Preparing... ##################################################
IBM_db2jhen81 ##################################################
IBM_db2repl81...
Preparing... ##################################################
IBM_db2repl81 ##################################################
IBM_db2sp81...
Preparing... ##################################################
IBM_db2sp81 ##################################################
IBM_db2chen81...
Preparing... ##################################################
IBM_db2chen81 ##################################################
IBM_db2adt81...
Preparing... ##################################################
IBM_db2adt81 ##################################################
IBM_db2adts81...
Preparing... ##################################################
IBM_db2adts81 ##################################################
IBM_db2xmls81...
Preparing... ##################################################
IBM_db2xmls81 ##################################################
IBM_db2cj81...
Preparing... ##################################################
IBM_db2cj81 ##################################################
IBM_db2dc81...
Preparing... ##################################################
IBM_db2dc81 ##################################################
IBM_db2dwcm81...
Preparing... ##################################################
IBM_db2dwcm81 ##################################################
IBM_db2fs81...
Preparing... ##################################################
IBM_db2fs81 ##################################################
IBM_db2inst81...
Preparing... ##################################################
IBM_db2inst81 ##################################################
IBM_db2wbdb81...
Preparing... ##################################################
IBM_db2wbdb81 ##################################################
IBM_db2xml81...
Preparing... ##################################################
IBM_db2xml81 ##################################################
IBM_db2jdbc81...
Preparing... ##################################################
IBM_db2jdbc81 ##################################################
IBM_db2ca81...
Preparing... ##################################################
IBM_db2ca81 ##################################################
IBM_db2rte81...
Preparing... ##################################################
IBM_db2rte81 ##################################################
IBM_db2conn81...
Preparing... ##################################################
IBM_db2conn81 ##################################################
IBM_db2crte81...
Preparing... ##################################################
IBM_db2crte81 ##################################################
IBM_db2das81...
Preparing... ##################################################
IBM_db2das81 ##################################################
IBM_db2dj81...
Preparing... ##################################################
IBM_db2dj81 ##################################################
IBM_db2engn81...
Preparing... ##################################################
IBM_db2engn81 ##################################################
IBM_db2smpl81...
Preparing... ##################################################
IBM_db2smpl81 ##################################################
IBM_db2djx81...
Preparing... ##################################################
IBM_db2djx81 ##################################################
IBM_db2inx81...
Preparing... ##################################################
IBM_db2inx81 ##################################################
IBM_db2pext81...
Preparing... ##################################################
IBM_db2pext81 ##################################################
IBM_db2essg81...
Preparing... ##################################################
IBM_db2essg81 ##################################################
IBM_db2cc81...
Preparing... ##################################################
IBM_db2cc81 ##################################################
IBM_db2icc81...
Preparing... ##################################################
IBM_db2icc81 ##################################################
IBM_db2icms81...
Preparing... ##################################################
IBM_db2icms81 ##################################################
The installation logfile can be found in /tmp/db2_install_log.5273.
db2_install program completed successfully.

安装了一堆的RPM后,软件就安装好了
五,下面开始安装后的数据库手工配置
1,建立用户和组
groupadd db2grp1
groupadd db2fgrp1
groupadd dasadm1
useradd -g db2grp1 -m -d /home/db2inst1 -p “” db2inst1
useradd -g db2fgrp1 -m -d /home/db2fenc1 -p ““ db2fenc1
useradd -g dasadm1 -m -d /home/dasusr1 -p “” dasusr1
注:以上三个用户密码均为空,用su命令切换到相应用户下时,用passwd命令设置即可

2,创建实例
首先我们使用以下命令创建管理服务器实例
/opt/IBM/db2/V8.1/instance/dascrt -u dasusr1

SQL4406W The DB2 Administration Server was started successfully.
DBI1070I Program dascrt completed successfully.

接着使用以下命令创建数据库实例 db2inst1
/opt/IBM/db2/V8.1/instance/db2icrt -u db2fenc1 db2inst1

DBI1070I Program db2icrt completed successfully.

3,创建共享库链接
/opt/IBM/db2/V8.1/cfg/db2ln

4,设置DB2 实例环境变量
用su命令切换到db2实例所用者用户终端
su - db2inst1
db2set DB2_EXTENDED_OPTIMIZATION=ON
db2set DB2_DISABLE_FLUSH_LOG=ON
db2set AUTOSTART=YES
db2set DB2_STRIPED_CONTAINERS=ON
db2set DB2_HASH_JOIN=Y
db2set DB2COMM=tcpip
db2set DB2_PARALLEL_IO=*
db2set DB2CODEPAGE=1386

5,设置服务端口
[db2inst1@review root]$ db2
然后在DB2的提示符下输入
update database manager configuration using svcename server1
设置服务名为server1
然后get database manager configuration,检查一下参数
其中让我比较郁闷的就是JDK_PATH参数,居然设的不对,搞得数据库安装好后图形化管理工具无法使用
下面是我机器上执行的结果,以供参考!

(c) Copyright IBM Corporation 1993,2002
Command Line Processor for DB2 SDK 8.2.2
You can issue database manager commands and SQL statements from the command 
prompt. For example:
db2 => connect to sample
db2 => bind sample.bnd
For general help, type: ?.
For command help, type: ? command, where command can be
the first few keywords of a database manager command. For example:
? CATALOG DATABASE for help on the CATALOG DATABASE command
? CATALOG for help on all of the CATALOG commands.
To exit db2 interactive mode, type QUIT at the command prompt. Outside 
interactive mode, all commands must be prefixed with 'db2'.
To list the current command option settings, type LIST COMMAND OPTIONS.
For more detailed help, refer to the Online Reference Manual.
db2 => update database manager configuration using svcename server1
DB20000I The UPDATE DATABASE MANAGER CONFIGURATION command completed 
successfully.
db2 => get database manager configuration
Database Manager Configuration
Node type = Enterprise Server Edition with local and remote clients
Database manager configuration release level = 0x0a00
CPU speed (millisec/instruction) (CPUSPEED) = 3.070238e-07
Communications bandwidth (MB/sec) (COMM_BANDWIDTH) = 1.000000e+02
Max number of concurrently active databases (NUMDB) = 8
Data Links support (DATALINKS) = NO
Federated Database System Support (FEDERATED) = NO
Transaction processor monitor name (TP_MON_NAME) =
Default charge-back account (DFT_ACCOUNT_STR) =
Java Development Kit installation path (JDK_PATH) = /opt/IBMJava2-142
Diagnostic error capture level (DIAGLEVEL) = 3
Notify Level (NOTIFYLEVEL) = 3
Diagnostic data directory path (DIAGPATH) = /home/db2inst1/sqllib/db2dump
Default database monitor switches
Buffer pool (DFT_MON_BUFPOOL) = OFF
Lock (DFT_MON_LOCK) = OFF
Sort (DFT_MON_SORT) = OFF
Statement (DFT_MON_STMT) = OFF
Table (DFT_MON_TABLE) = OFF
Timestamp (DFT_MON_TIMESTAMP) = ON
Unit of work (DFT_MON_UOW) = OFF
Monitor health of instance and databases (HEALTH_MON) = ON
SYSADM group name (SYSADM_GROUP) = DB2GRP1 
SYSCTRL group name (SYSCTRL_GROUP) = 
SYSMAINT group name (SYSMAINT_GROUP) = 
SYSMON group name (SYSMON_GROUP) =
Client Userid-Password Plugin (CLNT_PW_PLUGIN) = 
Client Kerberos Plugin (CLNT_KRB_PLUGIN) = 
Group Plugin (GROUP_PLUGIN) = 
GSS Plugin for Local Authorization (LOCAL_GSSPLUGIN) = 
Server Plugin Mode (SRV_PLUGIN_MODE) = UNFENCED
Server List of GSS Plugins (SRVCON_GSSPLUGIN_LIST) = 
Server Userid-Password Plugin (SRVCON_PW_PLUGIN) = 
Server Connection Authentication (SRVCON_AUTH) = NOT_SPECIFIED
Database manager authentication (AUTHENTICATION) = SERVER
Cataloging allowed without authority (CATALOG_NOAUTH) = NO
Trust all clients (TRUST_ALLCLNTS) = YES
Trusted client authentication (TRUST_CLNTAUTH) = CLIENT
Bypass federated authentication (FED_NOAUTH) = NO
Default database path (DFTDBPATH) = /home/db2inst1
Database monitor heap size (4KB) (MON_HEAP_SZ) = 90
Java Virtual Machine heap size (4KB) (JAVA_HEAP_SZ) = 2048
Audit buffer size (4KB) (AUDIT_BUF_SZ) = 0
Size of instance shared memory (4KB) (INSTANCE_MEMORY) = AUTOMATIC
Backup buffer default size (4KB) (BACKBUFSZ) = 1024
Restore buffer default size (4KB) (RESTBUFSZ) = 1024
Sort heap threshold (4KB) (SHEAPTHRES) = 20000
Directory cache support (DIR_CACHE) = YES
Application support layer heap size (4KB) (ASLHEAPSZ) = 15
Max requester I/O block size (bytes) (RQRIOBLK) = 32767
Query heap size (4KB) (QUERY_HEAP_SZ) = 1000
Workload impact by throttled utilities(UTIL_IMPACT_LIM) = 10
Priority of agents (AGENTPRI) = SYSTEM
Max number of existing agents (MAXAGENTS) = 400
Agent pool size (NUM_POOLAGENTS) = 200(calculated)
Initial number of agents in pool (NUM_INITAGENTS) = 0
Max number of coordinating agents (MAX_COORDAGENTS) = (MAXAGENTS - NUM_INITAGENTS)
Max no. of concurrent coordinating agents (MAXCAGENTS) = MAX_COORDAGENTS
Max number of client connections (MAX_CONNECTIONS) = MAX_COORDAGENTS
Keep fenced process (KEEPFENCED) = YES
Number of pooled fenced processes (FENCED_POOL) = MAX_COORDAGENTS
Initial number of fenced processes (NUM_INITFENCED) = 0
Index re-creation time and redo index build (INDEXREC) = RESTART
Transaction manager database name (TM_DATABASE) = 1ST_CONN
Transaction resync interval (sec) (RESYNC_INTERVAL) = 180
SPM name (SPM_NAME) = 
SPM log size (SPM_LOG_FILE_SZ) = 256
SPM resync agent limit (SPM_MAX_RESYNC) = 20
SPM log path (SPM_LOG_PATH) =
TCP/IP Service name (SVCENAME) = server1
Discovery mode (DISCOVER) = SEARCH
Discover server instance (DISCOVER_INST) = ENABLE
Maximum query degree of parallelism (MAX_QUERYDEGREE) = ANY
Enable intra-partition parallelism (INTRA_PARALLEL) = NO
No. of int. communication buffers(4KB)(FCM_NUM_BUFFERS) = 4096
Number of FCM request blocks (FCM_NUM_RQB) = AUTOMATIC
Number of FCM connection entries (FCM_NUM_CONNECT) = AUTOMATIC
Number of FCM message anchors (FCM_NUM_ANCHORS) = AUTOMATIC
Node connection elapse time (sec) (CONN_ELAPSE) = 10
Max number of node connection retries (MAX_CONNRETRIES) = 5
Max time difference between nodes (min) (MAX_TIME_DIFF) = 60
db2start/db2stop timeout (min) (START_STOP_TIME) = 10

6,编辑/etc/services文件,增加服务端口

DB2_db2inst1 60000/tcp
DB2_db2inst1_1 60001/tcp
DB2_db2inst1_2 60002/tcp
DB2_db2inst1_END 60003/tcp
server1 50000/tcp # DB2 connection service port

这里增加的server1这一行就是刚才设置的服务名

7,修改DBM参数
db2 update dbm cfg using SVCENAME server1

8,现在可以启动DB2了
[db2inst1@review ~]$ db2start

05/24/2006 21:48:56 0 0 SQL1063N DB2START processing was successful.
SQL1063N DB2START processing was successful.

9,创建数据库
进入DB2的命令行

db2 => create database TEST
DB20000I The CREATE DATABASE command completed successfully.

10,基本上差不多了,最好重起一下
先把DB2停了了
db2stop
回到root用户,重起系统
shutdown -r now


安装mod_fastcgi

tar zxvf mod_fastcgi-2.4.2.tar.gz
cd mod_fastcgi-2.4.2

修改mod_fastcgi.c程序源文件
找到如下这段

if (fcgi_util_fs_get_by_id(r->filename, uid, gid))
{
r->handler = FASTCGI_HANDLER_NAME;
return OK;
}

将if语句修改为

if (r->handler == NULL && fcgi_util_fs_get_by_id(r->filename, uid, gid))

然后使用apxs方式编译模块

/usr/local/apache_new/bin/apxs -o mod_fastcgi.so -c *.c
/usr/local/apache_new/bin/apxs -i -a -n fastcgi mod_fastcgi.so

模块就安装好了,然后在apache配置文件中,mod_gzip配置部分,增加如下一行:

mod_gzip_item_include handler fastcgi-script

今天的天气可真是好啊,没了,想不出来再写什么别的了!


在linux下,我把运行jfreechart相应的包jfreechart-0.9.18.jar、jcommon-0.9.3.jar等已经copy到tomcat的common/lib下,但是,程序运行还是提示如下错误:

java.lang.NoClassDefFoundError
org.jfree.chart.axis.Axis.<init>(Axis.java:180)
at org.jfree.chart.axis.CategoryAxis.<init>(CategoryAxis.java:137)
at org.jfree.chart.axis.CategoryAxis3D.<init>(CategoryAxis3D.java:78)
at org.jfree.chart.ChartFactory.createBarChart3D(ChartFactory.java:507)

解决的办法是:
编辑/etc/profile文件,在最后加入export CATALINA_OPTS='-Djava.awt.headless=true'
即可


参考链接
http://dev.csdn.net/develop/article/18/18432.shtm
http://www-900.ibm.com/developerWorks/cn/wsdd/library/techarticles/yangyaping0307/waslinux.shtml

出现这个问题的主要原因是SUN的JDK中默认带的font.properties不适合于我使用的系统平台
我的linux是Red Hat Enterprise Linux AS 3,默认系统语言LANG=en_us

首先我们需要将需要用到的字体文件拷贝到/usr/share/fonts目录下
字体文件可以从安装了中文字体的linux上拷过来
例如:我需要使用的是简体中文,那就要将/usr/share/fonts目录下的zh_CN全部拷到我的linux的相同目录下

然后运行一下下面这段小程序判断Linux下使用的字体属性

public class PrintLocale {
public static void main(String[] args) {
System.out.println(System.getProperty("user.language"));
System.out.println(System.getProperty("user.region"));
System.out.println(System.getProperty("file.encoding"));
System.out.println(System.getProperty("os.version"));
}
}

我这里的运行结果是
en
null
ISO-8859-1
2.4.21-4.EL

在Java平台中,字体配置信息主要定义于font.properties系列文件中,存放于JRE/lib目录下。
其中定义了五种平台无关的逻辑字体:Serif, SansSerif, Monospaced, Dialog和DialogInput,
每一个JVM的实现,都必须包含这五种字体。另外,还定义了逻辑字体跟实际字体的映射等信息。
为了支持不同的操作系统版本和Locale,font.properties包含了附带不同后缀的多个版本。
从Sun的文档"Adding Fonts to the Java Runtime"[参见参考文献1]中,我们可以得知:
在英文环境下,字体属性由无后缀的font.properties 定义。为了一些操作系统的特殊问题,
字体属性文件的名字可以加入操作系统的版本号作为后缀。例如,Solaris 2.5.1 不支持 TrueType 字体,
所以字体属性文件font.properties.5.5.1 将只包含 F3 字体。
在大多数操作系统中,版本后缀的值由System.getProperty("os.version")来确定。
如果环境是日文、韩文、简体中文或繁体中文,就必须使用相应于特定环境的 font.properties 文件。
这些文件可以通过文件名后边加上相应的国家或者locale后缀识别,格式为font.properties.<locale>。
该<locale>实际上由<language>_<region>_<encoding>三部分构成。
而<language>、<region>和<encoding>分别对应了系统属性(由System.getProperty方法返回的字符串)"user.language"、"user.region"和"file.encoding"。
而这个font.properties.<locale>名也可以跟操作系统的版本结合使用。
概括的讲,Java按照以下顺序搜索字体属性文件:

font.properties.<language>_<region>_<encoding>.<osVersion>
font.properties.<language>_<region>_<encoding>
font.properties.<language>_<region>.<osVersion>
font.properties.<language>_<region>
font.properties.<language>_<encoding>.<osVersion>
font.properties.<language>_<encoding>
font.properties.<language>_<osVersion>
font.properties.<language>
font.properties.<encoding>.<osVersion>
font.properties.<encoding>
font.properties.<osVersion>
font.properties

根据上面的小程序的结果,可以判断我的linux使用的字体配置信息文件的文件名应该为font.properties.en
(当然,我没有写得很严格,目的是为了能更好的匹配,如果你的系统language是zh_CN,那你的字体配置信息文件的文件名就应该为font.properties.zh_CN)
在编辑字体配置信息文件之前,我们需要做以下工作
打开/usr/share/fonts/zh_CN/TrueType 下面的 font.dir文件,将其中我需要用的字体的名字copy出来,
例如:-misc-ZYSong18030-medium-r-normal--0-0-0-0-c-0-iso10646-1
然后按照java的字体规则改为 -misc-ZYSong18030-medium-r-normal---%d---c--iso10646-1,记住这个字体的名字,我们下面将会用到

然后我们就编辑这个配置文件,你可以将JDK自带的配置文件copy一份,然后修改修改
我比较偷懒,就是这样做的 cp font.properties.zh_CN.Redhat8.0 font.properties.en
然后编辑它,将其中的字体名全部替换成 -misc-ZYSong18030-medium-r-normal---%d---c--iso10646-1
在文件的最后加上appendedfontpath=/usr/share/fonts/zh_CN/TrueType
要不然JDK/jre是找不到你的字体文件的
我修改好的font.properties.en如下:

# @(#)font.properties.zh.Redhat.linux 1.4 02/06/10
#
# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
#

# Component Font Mappings
#
serif.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
serif.italic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
serif.bold.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
serif.bolditalic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
sansserif.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
sansserif.italic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
sansserif.bold.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
sansserif.bolditalic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
monospaced.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
monospaced.italic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
monospaced.bold.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
monospaced.bolditalic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialog.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialog.italic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialog.bold.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialog.bolditalic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialoginput.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialoginput.italic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialoginput.bold.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
dialoginput.bolditalic.0=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
# Missing Glyph Character
#
default.char=274f

# Component Font Character Encodings
#
fontcharset.serif.0=sun.io.CharToByteISO8859_1
fontcharset.serif.1=sun.awt.motif.CharToByteX11GBK
fontcharset.sansserif.0=sun.io.CharToByteISO8859_1
fontcharset.sansserif.1=sun.awt.motif.CharToByteX11GBK
fontcharset.monospaced.0=sun.io.CharToByteISO8859_1
fontcharset.monospaced.1=sun.awt.motif.CharToByteX11GBK
fontcharset.dialog.0=sun.io.CharToByteISO8859_1
fontcharset.dialog.1=sun.awt.motif.CharToByteX11GBK
fontcharset.dialoginput.0=sun.io.CharToByteISO8859_1
fontcharset.dialoginput.1=sun.awt.motif.CharToByteX11GBK
# Exclusion Ranges
#

# XFontSet Information
#
fontset.serif.plain=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.serif.italic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.serif.bold=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.serif.bolditalic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.sansserif.plain=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.sansserif.italic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.sansserif.bold=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.sansserif.bolditalic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.monospaced.plain=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.monospaced.italic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.monospaced.bold=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.monospaced.bolditalic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.dialog.italic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.dialog.bold=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.dialog.bolditalic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.dialog.plain=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.dialoginput.italic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.dialoginput.bold=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.dialoginput.bolditalic=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1
fontset.dialoginput.plain=-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1

#fontset.default=
#-b&h-lucida-medium-r-normal-sans-*-%d-*-*-p-*-iso10646-1,
#-tlc-song-medium-r-normal--*-%d-*-*-c-*-gbk-0

fontset.default=
-misc-ZYSong18030-medium-r-normal--*-%d-*-*-c-*-iso10646-1

appendedfontpath=/usr/share/fonts/zh_CN/TrueType

然后编辑/etc/profile文件设置环境变量JAVA_FONTS为中文TrueType字体所在目录

export JAVA_FONTS=/usr/share/fonts/zh_CN/TrueType

最后使profile生效,然后重起tomcat
应该就OK啦


Typecho 强力驱动