??xml version="1.0" encoding="utf-8" standalone="yes"?>天堂a√中文在线,成年人在线观看视频,成人在线观看avhttp://www.aygfsteel.com/envoydada/category/32100.htmlzh-cnWed, 18 Dec 2013 04:56:34 GMTWed, 18 Dec 2013 04:56:34 GMT60扩容kvm虚拟机镜像磁盘空?/title><link>http://www.aygfsteel.com/envoydada/archive/2013/12/18/407732.html</link><dc:creator>Derek.Guo</dc:creator><author>Derek.Guo</author><pubDate>Wed, 18 Dec 2013 04:22:00 GMT</pubDate><guid>http://www.aygfsteel.com/envoydada/archive/2013/12/18/407732.html</guid><wfw:comment>http://www.aygfsteel.com/envoydada/comments/407732.html</wfw:comment><comments>http://www.aygfsteel.com/envoydada/archive/2013/12/18/407732.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/envoydada/comments/commentRss/407732.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/envoydada/services/trackbacks/407732.html</trackback:ping><description><![CDATA[<div>1. Shutdown the instance<br /><br /> <div>2. Get current image information<br /> <span style="background-color: #99ccff; font-size: 13px;"># virt</span><span style="background-color: #99ccff; font-size: 13px;">-</span><span style="background-color: #99ccff; font-size: 13px;">filesystems </span><span style="background-color: #99ccff; font-size: 13px;">--</span><span style="font-size: 13px; color: #0000ff; background-color: #99ccff;">long</span><span style="background-color: #eeeeee; font-size: 13px;"> </span><span style="background-color: #99ccff; font-size: 13px;">--</span><span style="background-color: #99ccff; font-size: 13px;">parts </span><span style="background-color: #99ccff; font-size: 13px;">--</span><span style="background-color: #99ccff; font-size: 13px;">blkdevs </span><span style="background-color: #99ccff; font-size: 13px;">-</span><span style="background-color: #99ccff; font-size: 13px;">h </span><span style="background-color: #99ccff; font-size: 13px;">-</span><span style="background-color: #99ccff; font-size: 13px;">a windows2003.img</span><span style="background-color: #eeeeee; font-size: 13px;"><br /> </span> <div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> -->Name       Type       MBR  Size  Parent<br /> /dev/sda1  partition  07   4.0G  /dev/sda<br /> /dev/sda2  partition  0f   1.0K  /dev/sda<br /> /dev/sda5  partition  07   6.0G  /dev/sda<br /> /dev/sda   device     -    10G   -</div> </div><br /><div>3. virt-rezise<br /><div><span style="background-color: #99ccff;"># qemu-img create -f raw new.img 25G<br /></span><div><span style="background-color: #99ccff;"># virt-resize --expand /dev/sda1 old.img new.img</span></div></div></div></div><img src ="http://www.aygfsteel.com/envoydada/aggbug/407732.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/envoydada/" target="_blank">Derek.Guo</a> 2013-12-18 12:22 <a href="http://www.aygfsteel.com/envoydada/archive/2013/12/18/407732.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>分布式文件系lGlusterfshttp://www.aygfsteel.com/envoydada/archive/2013/08/09/402633.htmlDerek.GuoDerek.GuoFri, 09 Aug 2013 08:00:00 GMThttp://www.aygfsteel.com/envoydada/archive/2013/08/09/402633.htmlhttp://www.aygfsteel.com/envoydada/comments/402633.htmlhttp://www.aygfsteel.com/envoydada/archive/2013/08/09/402633.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/402633.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/402633.html###  Installing Gluster
wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo
yum install glusterfs{-fuse,-server}

# 查看gluster版本信息
glusterfs -V
# 启动停止服务
service glusterd start
service glusterd stop
# 存储L加入信Q存储?/div>
gluster peer probe fs-server-2
gluster peer probe fs-server-3
# 查看状?/div>
gluster peer status
# 五中cd的volume可以被创建:
    DistributedQ分布式P文g通过hash法随机的分布到由bricksl成的卷上?/div>
    ReplicatedQ复制式PcMraid1Qreplica数必ȝ于volume中brick所包含的存储服务器敎ͼ可用性高?/div>
    StripedQ条带式PcM与raid0Qstripe数必ȝ于volume中brick所包含的存储服务器敎ͼ文g被分成数据块Q以Round Robin的方式存储在bricks中,q发_度是数据块Q大文g性能好?/div>
    Distributed StripedQ分布式的条带卷Qvolume中brick所包含的存储服务器数必Lstripe的倍数(>=2?Q兼ֈ布式和条带式的功能?/div>
    Distributed ReplicatedQ分布式的复制卷Qvolume中brick所包含的存储服务器数必L replica 的倍数(>=2?Q兼ֈ布式和复制式的功能?/div>
# 创徏分布?/div>
gluster volume create gv0 fs-server-1:/data/gfs fs-server-2:/data/gfs
# 创徏复制?/div>
gluster volume create gv0 replica 2 fs-server-1:/data/gfs fs-server-2:/data/gfs
# 创徏条带?/div>
gluster volume create gv0 stripe 2 fs-server-1:/data/gfs fs-server-2:/data/gfs
# 启动?/div>
gluster volume start gv0
# 查看?/div>
gluster volume info gv0
#如果以后要添加服务器Q可以用add-brick命oQ?/div>
gluster volume add-brick gv0 fs-server-3:/data/gfs fs-server-4:/data/gfs
gluster volume remove-brick VOLNAME BRICK
注意Q当你给分布式复制卷和分布式条带卷中增加bricksӞ你增加的bricks的数目必L复制或者条带数目的倍数Q例如:你给一个分布式复制Lreplica?Q你在增加bricks的时候数量必Mؓ2???{?/div>
      当移除分布式复制h者分布式条带L时候,U除的bricks数目必须是replica或者stripe的倍数。例如:一个分布式条带Lstripe?Q当你移除bricks的时候必L2???{?/div>
#挂蝲glusterfs
mount -t glusterfs fs-server-1:/gv0 /mnt/gfs
mount -t nfs fs-server-1:/gv0 /mnt/gfs
mount -v -t nfs -o mountproto=tcp,vers=3 fs-server-1:/gv0 /mnt/gfs-nfs


Derek.Guo 2013-08-09 16:00 发表评论
]]>KVM虚拟机克隆网l问?/title><link>http://www.aygfsteel.com/envoydada/archive/2013/08/07/402525.html</link><dc:creator>Derek.Guo</dc:creator><author>Derek.Guo</author><pubDate>Wed, 07 Aug 2013 10:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/envoydada/archive/2013/08/07/402525.html</guid><wfw:comment>http://www.aygfsteel.com/envoydada/comments/402525.html</wfw:comment><comments>http://www.aygfsteel.com/envoydada/archive/2013/08/07/402525.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/envoydada/comments/commentRss/402525.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/envoydada/services/trackbacks/402525.html</trackback:ping><description><![CDATA[<span style="font-family: Monaco, Consolas, '"Lucida Console"', '"Courier New"', serif; font-size: 10pt; line-height: 21.59375px; background-color: #f7f7f7;">克隆KVM虚拟机时Q网卡启动报?br /> </span><span style="font-family: Monaco, Consolas, '"Lucida Console"', '"Courier New"', serif; font-size: 10pt; line-height: 21.59375px; background-color: #f7f7f7;">Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization<br /> </span><span style="font-family: Monaco, Consolas, '"Lucida Console"', '"Courier New"', serif; font-size: 10pt; line-height: 21.59375px; background-color: #f7f7f7;">查看</span><span style="font-family: Monaco, Consolas, '"Lucida Console"', '"Courier New"', serif; font-size: 10pt; line-height: 21.59375px; background-color: #f7f7f7;">/etc/udev/rules.d/70-persistent-net.rules文g<br /> </span> <div><span style="font-size: 10pt;">原来UDEVq里把克隆前的MAC当成了当前虚拟机的eth0 MACQ而重新生成的是eth1的MAC?/span></div> <span style="font-family: Monaco, Consolas, '"Lucida Console"', '"Courier New"', serif; font-size: 10pt; line-height: 21.59375px; background-color: #f7f7f7;">删除原虚拟机MAC地址行, 修改新MAC地址行的eth1为eth0; 同时修改ifcfg-eth0文g里的HWADDR为新MAC地址。重启网l或pȝ?/span><span style="font-family: Monaco, Consolas, '"Lucida Console"', '"Courier New"', serif; font-size: 12px; line-height: 21.59375px; background-color: #f7f7f7;"><br /> <br /> </span><img src ="http://www.aygfsteel.com/envoydada/aggbug/402525.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/envoydada/" target="_blank">Derek.Guo</a> 2013-08-07 18:14 <a href="http://www.aygfsteel.com/envoydada/archive/2013/08/07/402525.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用 sendfile() 提升|络文g发送性能http://www.aygfsteel.com/envoydada/archive/2011/12/29/367529.htmlDerek.GuoDerek.GuoThu, 29 Dec 2011 13:32:00 GMThttp://www.aygfsteel.com/envoydada/archive/2011/12/29/367529.htmlhttp://www.aygfsteel.com/envoydada/comments/367529.htmlhttp://www.aygfsteel.com/envoydada/archive/2011/12/29/367529.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/367529.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/367529.html

我们qx通过|络发送文件时会用到的两个pȝ调用Q?br />read(file, tmp_buf, len);
write(socket, tmp_buf, len);

调用q程C意囑֦下:

在用L间调?read() d文g时发生两ơ内存拷贝:

  1. DMA引擎文件读取到内核的文件缓冲区
  2. 调用q回用户I间时将内核的文件缓冲区的数据复制到用户I间的缓冲区

接着调用 write() 把数据写?socket Ӟ又发生了两次内存拯Q?/p>

  1. 用L间的~冲区的数据复制到内核的 socket ~冲?/li>
  2. 内?socket ~冲区的数据复制到网l协议引?/li>

也就是说Q在整个文g发送的q程中,发生了四ơ内存拷贝?br />然后Q数据读取到用户I间后ƈ没有做过M加工处理Q因此通过|络发送文件时Q根本没有必要把文g内容复制到用L间?/p>

于是引入?mmap()Q?br />tmp_buf = mmap(file, len);
write(socket, tmp_buf, len);

调用q程C意图:

  1. 调用 mmap() 时会文件直接读取到内核~冲区,q把内核~冲区直接共享到用户I间
  2. 调用 write() Ӟ直接内核缓冲区的数据复制到|络协议引擎

q样一来,少了用L间和内核I间之间的内存复制了?br />q种方式会有个问题,当前q程在调?write() Ӟ另一个进E把文g清空了,E序׃报出 SIGBUS cd错误?/p>

Linux Kernel 2.1 引进?sendfile()Q只需要一个系l调用来实现文g发送?br />sendfile(socket, file, len);

调用q程C意图:

  1. 调用 sendfile() 时会直接在内核空间把文gd到内核的文g~冲?/li>
  2. 内核的文g~冲区的数据复制到内核的 socket ~冲Z
  3. 内核的 socket ~冲区的数据复制到网l协议引?/li>

从性能上看Q这U方式只是少了一个系l调用而已Q还是做?ơ拷贝操作?/p>

Linux Kernel 2.4 改进?sendfile()Q调用接口没有变化:
sendfile(socket, file, len);

调用q程C意图:

  1. 调用 sendfile() 时会直接在内核空间把文gd到内核的文g~冲?/li>
  2. 内核?socket ~冲Z保存的是当前要发送的数据在内核的文g~冲Z的位|和偏移?/li>
  3. DMA gather copy 内核的文g~冲区的数据复制到网l协议引?/li>

q样只剩下2ơ拷贝啦?/p>

在许?http server 中,都引入了 sendfile 的机Ӟ?nginx、lighttpd {,它们正是利用 sendfile() q个Ҏ来实现高性能的文件发送的?/p>



Derek.Guo 2011-12-29 21:32 发表评论
]]>Web服务器性能/压力试工具http_load、webbench、ab、Siege(?http://www.aygfsteel.com/envoydada/archive/2011/03/15/346300.htmlDerek.GuoDerek.GuoTue, 15 Mar 2011 03:47:00 GMThttp://www.aygfsteel.com/envoydada/archive/2011/03/15/346300.htmlhttp://www.aygfsteel.com/envoydada/comments/346300.htmlhttp://www.aygfsteel.com/envoydada/archive/2011/03/15/346300.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/346300.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/346300.html一、http_load

E序非常,解压后也不到100K

http_load以ƈ行复用的方式q行Q用以测试web服务器的吞吐量与负蝲。但是它不同于大多数压力试?/p>

P它可以以一个单一的进E运行,一般不会把客户机搞歅R还可以试HTTPScȝ|站h?/p>

下蝲地址Q?a style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #3e62a6; outline-width: 0px; outline-style: initial; outline-color: initial; ">http://soft.vpser.net/test/http_load/http_load-12mar2006.tar.gz
安装很简?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> #tar zxvf http_load-12mar2006.tar.gz
#cd http_load-12mar2006
#make && make install

命o格式Qhttp_load  -p q发讉Kq程?nbsp; -s 讉K旉  需要访问的URL文g

参数其实可以自由l合Q参C间的选择q没有什么限制。比如你写成http_load -parallel 5 -seconds

300 urls.txt也是可以的。我们把参数l大家简单说明一下?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> -parallel ?p Q含义是q发的用戯E数?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> -fetches ?f Q含义是总计的访问次?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> -rate    ?p Q含义是每秒的访问频?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> -seconds?s Q含义是总计的访问时?/p>

准备URL文gQurllist.txtQ文件格式是每行一个URLQURL最好超q?0Q?00个测试效果比较好.文g格式

如下Q?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> http://www.vpser.net/uncategorized/choose-vps.html
http://www.vpser.net/vps-cp/hypervm-tutorial.html
http://www.vpser.net/coupons/diavps-april-coupons.html
http://www.vpser.net/security/vps-backup-web-mysql.html
例如Q?/p>

http_load -p 30 -s 60  urllist.txt
参数了解了,我们来看q行一条命令来看看它的q回l果
命oQ? ./http_load -rate 5 -seconds 10 urls说明执行了一个持l时?0U的试Q每U的频率??/p>

49 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds5916 mean bytes/connection4.89274

fetches/sec, 28945.5 bytes/secmsecs/connect: 28.8932 mean, 44.243 max, 24.488 minmsecs/first

-response: 63.5362 mean, 81.624 max, 57.803 minHTTP response codes: code 200 ?49 

l果分析Q?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> 1Q?9 fetches, 2 max parallel, 289884 bytes, in 10.0148 seconds
说明在上面的试中运行了49个请求,最大的q发q程数是2Q总计传输的数据是289884bytesQ运行的旉?0.0148U?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> 2Q?916 mean bytes/connection说明每一q接q_传输的数据量289884/49=5916
3Q?.89274 fetches/sec, 28945.5 bytes/sec
说明每秒的响应请求ؓ4.89274Q每U传递的数据?8945.5 bytes/sec
4Qmsecs/connect: 28.8932 mean, 44.243 max, 24.488 min说明每连接的q_响应旉?8.8932 msecs

Q最大的响应旉44.243 msecsQ最的响应旉24.488 msecs
5Qmsecs/first-response: 63.5362 mean, 81.624 max, 57.803 min
6、HTTP response codes: code 200 ?49     说明打开响应面的类型,如果403的类型过多,那可?/p>

要注意是否系l遇C瓉?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> Ҏ说明Q?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> 试l果中主要的指标?fetches/sec、msecs/connect q个选项Q即服务器每U能够响应的查询ơ数Q?/p>

用这个指标来衡量性能。似乎比 apache的ab准确率要高一些,也更有说服力一些?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> Qpt-每秒响应用户数和response timeQ每q接响应用户旉?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> 试的结果主要也是看q两个倹{当然仅有这两个指标q不能完成对性能的分析,我们q需要对服务器的

cpu、menq行分析Q才能得出结?/p>

 

二、webbench

webbench是Linux下的一个网站压力测试工P最多可以模?万个q发q接L试网站的负蝲能力。下载地址可以到google搜,我这里给Z?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> 下蝲地址Q?a style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #3e62a6; outline-width: 0px; outline-style: initial; outline-color: initial; ">http://soft.vpser.net/test/webbench/webbench-1.5.tar.gz
q个E序更小Q解压后不到50KQ呵?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> 安装非常?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> #tar zxvf webbench-1.5.tar.gz
#cd webbench-1.5
#make && make install
会在当前目录生成webbench可执行文Ӟ直接可以使用?/p>

用法Q?/p>

webbench -c q发?-t q行试旉 URL
如:
webbench -c 5000 -t 120 http://www.vpser.net

三、ab
ab是apache自带的一Ƒ֊能强大的试工具
安装了apache一般就自带了,
用法可以查看它的说明

$ ./ab
./ab: wrong number of arguments
Usage: ./ab [options] [http://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make
-t timelimit Seconds to max. wait for responses
-p postfile File containing data to POST
-T content-type Content-type header for POSTing
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-i Use HEAD instead of GET
-x attributes String to insert as table attributes
-y attributes String to insert as tr attributes
-z attributes String to insert as td or th attributes
-C attribute Add cookie, eg. ‘Apache=1234. (repeatable)
-H attribute Add Arbitrary header line, eg. ‘Accept-Encoding: gzip’
Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-h Display usage information (this message)
参数众多Q一般我们用到的?n ?c
例如Q?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> ./ab -c 1000 -n 100 http://www.vpser.net/index.php

q个表示同时处理1000个请求ƈq行100ơindex.php文g.
四、Siege
一Ƒּ源的压力试工具Q可以根据配|对一个WEB站点q行多用Lq发讉KQ记录每个用h有请求过E的相应旉Qƈ在一定数量的q发讉K下重复进行?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> 官方Q?a style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #3e62a6; outline-width: 0px; outline-style: initial; outline-color: initial; ">http://www.joedog.org/
Siege下蝲Q?a style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: #3e62a6; outline-width: 0px; outline-style: initial; outline-color: initial; ">http://soft.vpser.net/test/siege/siege-2.67.tar.gz
解压Q?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> # tar -zxf siege-2.67.tar.gz
q入解压目录Q?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> # cd siege-2.67/
安装Q?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> #./configure ; make
#make install

使用
siege -c 200 -r 10 -f example.url
-c是ƈ发量Q?r是重复次数?url文g是一个文本,每行都是一个urlQ它会从里面随机讉K的?/p>

example.url内容:

http://www.licess.cn
http://www.vpser.net
http://soft.vpser.net

l果说明
Lifting the server siege… done.
Transactions: 3419263 hits //完成419263ơ处?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> Availability: 100.00 % //100.00 % 成功?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> Elapsed time: 5999.69 secs //d用时
Data transferred: 84273.91 MB //共数据传?4273.91 MB
Response time: 0.37 secs //相应用时1.65U:昄|络q接的速度
Transaction rate: 569.91 trans/sec //均每U完?569.91 ơ处理:表示服务器后
Throughput: 14.05 MB/sec //q_每秒传送数?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> Concurrency: 213.42 //实际最高ƈ发数
Successful transactions: 2564081 //成功处理ơ数
Failed transactions: 11 //p|处理ơ数
Longest transaction: 29.04 //每次传输所花最长时?br style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /> Shortest transaction: 0.00 //每次传输所花最短时?/p>

Derek.Guo 2011-03-15 11:47 发表评论
]]>
liunx下安装Subversionhttp://www.aygfsteel.com/envoydada/archive/2010/04/08/317711.htmlDerek.GuoDerek.GuoThu, 08 Apr 2010 05:37:00 GMThttp://www.aygfsteel.com/envoydada/archive/2010/04/08/317711.htmlhttp://www.aygfsteel.com/envoydada/comments/317711.htmlhttp://www.aygfsteel.com/envoydada/archive/2010/04/08/317711.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/317711.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/317711.html
 # tar –zvxf httpd-2.2.9.tar.gz
 # cd httpd
-2.2.9
 # .
/configure --prefix=/usr/local/apache2 --with-apr=/usr/local/apr/bin/apr-1-config --with-apr-util=/usr/local/apr/bin/apu-1-config 
  
--enable-modules=so /* DSO模式安装apache Q或 --enable-soQ?br />   --enable-dav --enable-maintainer-mode --enable-rewrite --enable-ssl
 # make
 # make install

安装SubversionQ?br />
 #tar –zvxf subversion-1.5.1.tar.gz
 #cd  subversion
-1.5.1
 #.
/configure --prefix=/usr/local/svn --with-apxs=/usr/local/apache/bin/apxs 
              
--with-apr=/usr/local/apr/bin/apr-1-config 
              
--with-apr-util=/usr/local/apr/bin/apu-1-config --enable-maintainer-mode
 #make
 #make install

 定一下svn有没有安装成?br />  #/usr/local/svn/bin/svnserve --version
 会看到相关版本信息!

配置服务器:
 (1). 创徏一个用P如:svnroot;
 (2). 以svnroot用户d
  
$mkdir /home/svnroot/repository
  $cd 
/usr/local/subversion/bin
  $.
/svnadmin create /home/svnroot/repository
  $ 
/usr/local/apache2/bin/htpasswd –c /home/svnroot/repository/passwprd.conf username "来创建的 会再要求输入两次密码
  $cd /home/svnroot/repository/test
  $ls 
-ll

  //看看是不是多了些文gQ如果是则说明Subversion安装成功?br />   //q条语句把路径/home/user/import下找到的文g导入C创徏的Subversion 仓库中去Q?br />   //提交后的修订版ؓ1?br />   $./svn import 你想要导入的文g位置 file:///home/svnroot/repository –m "注释"
  //不让其他人有该目录的权限
  $ chmod 700 /home/svnroot/repository

 (3). 修改Apache配置文g
  # cd /usr/local/apadche2/bin
  # vi /usr/local/apache2/conf/httpd.conf
  //在最下面d
  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/repository/ //svn父目?br />   SVNPath /home/svnroot/repository/test //与svn中bin中svnadmin创徏应一?否则会进不到目录
  #AuthzSVNAccessFile /home/svnroot/repository/authz.conf //权限配置文g
  AuthType Basic //q接cd讄
  AuthName "Subversion.zoneyump" //q接框提C?br />   AuthUserFile /home/svnroot/repository/passwprd.conf //用户配置文g
  Require valid-user //采用何种认证
  </Location>
  //其中authfile是通过"htpasswd来创建的那个密码文g
  //"Require valid-user"告诉apache在authfile中所有的用户都可以访问。如果没有它Q?br />   //则只能第一个用户可以访问新建库
 
  扑ֈ以下内容
  User daemon
  Group daemon
  把上q内Ҏ?
  User svnroot
  Group svnroot
 
  保存

 (4). dsvn用户
  创徏
  $htpasswd -c /home/svnroot/repository/authfile username
  会要求输两次密码
 
  ?home/svnroot/repository/conf会生?br />   authz passwd svnserve.conf
  $cd /home/svnroot/repository/conf
  $vi authz
  d如下
  [groups] /*q个表示组讄
  Admin=usr1,user2 /*q个表示admin组里的成员 user1,user2
  Develop=u1, u2 /*q个表示Develop组里的成员 u1,u2
  [www:/] /*q表C,仓库www的根目录下的讉K权限
  user1 = rw /*www仓库user1用户hd写权?br />   user2 = r /* www仓库userl用户具只有读权限
  @develop=rw /*q表C??develop的成员都hd权限
  [/] /*q个表示在所有仓库的根目录下
  * = r /*q个表示Ҏ有的用户都具有读权限
  注意Q在~辑authz文gӞ所有行都必要头写,不能有羃?br />
 (5). 重vApache
  #/usr/local/apache2/bin/apachectl –k restart

 (6). 启动svn服务
  #/usr/local/svn/bin/svnserve -d -r /home/svnroot/repository
  -d 表示?daemon 方式(后台q行)q行
  -r /svn/project 指定根目录是/home/svnroot/repository
  查服务器是否启动正常:
  #ps –ef|grep svnserve

 (7). 后序工作
  ?etc/profile的结设|一些svn启动时要做的工作
  # start apache server for svn
  /usr/sbin/apachectl start
  export SVN_EDITOR=vi

Derek.Guo 2010-04-08 13:37 发表评论
]]>
Window下配|SVN服务器与客户??http://www.aygfsteel.com/envoydada/archive/2008/07/29/218323.htmlDerek.GuoDerek.GuoTue, 29 Jul 2008 03:56:00 GMThttp://www.aygfsteel.com/envoydada/archive/2008/07/29/218323.htmlhttp://www.aygfsteel.com/envoydada/comments/218323.htmlhttp://www.aygfsteel.com/envoydada/archive/2008/07/29/218323.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/218323.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/218323.html 下蝲最新的svn服务?
svn-1.4.5-setup.rar
下蝲最新的svn客户?
TortoiseSVN-1.4.5.10425-win32-svn-1.4.5.rar
下蝲配置svn服务成window service自动q行的工?
SVNService.rar
步骤:
1.下蝲q安装svn1.4.5-setup.rar假设你安装在:G:\Program Files\Subversion目录下?br /> 2。徏立Repository,可以打开命oH口Q输入svnadmin create G:\SVNRoot\Projects\searchz,目录自己定?br /> 3.配置Repository,q入Repository目录Q这里是G:\SVNRoot\Projects\search,你会看到conf目录Q进入该目录Q你会看?br /> svnserver.conf和passwd两个文g.
对两个文件作如下修改:
svnserve.confWindow下配|SVN服务器与客户?/a>
[general]
### These options control access to the repository for unauthenticated
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file. Unless you specify a path starting with a /,
### the file's location is relative to the conf directory.
### Uncomment the line below to use the default password file.
password-db = passwd


含义?
未验证用hM权限 (如果把none修改为read是l予L?
已验证用L予写权限 (当然也能?
密码数据存放到passwd文g?
passwd
[users]
harry = harryssecret
sally = sallyssecret
weip=weip
注意最后passwd中的配置Q一个用户以行,?weip=weip表示用户名ؓweipQ密码ؓweip的一个用戗?4.启动subversion服务
两种方式启动:
(1).命o方式:svnserve -d -r G:\SVNRoot\Projects默认端口?690,如果不幸q个端口被别别的E序暂用Q可以通过选项 --
listem --port=l定端口.
(2)subversion服务:默认情况下蝲window service中视没有的,必须通过svnservice -install -d -r
G:\SVNRoot\ProjectsQ?svnservice必须和svnserve在同一个目录下)

再用net start svnservice来将其作为服务运行,打开控制面板扑ֈSVNServiceQ将其启动类型设|ؓ自动。这h务器的配|就架构好了?br /> 你现在可以用客户端的TortoiseSVN来访问刚刚配|的服务器了Qurl格式:
svn://ip地址/Repository?q里?svn://127.0.0.1/searchz.
客户端的单日常操?
要取得当前的最新版?SVN updated.
要修Ҏ新到SVNQ选择SVN submit卛_(谨慎的话先更新到最新版本后再提?.


Derek.Guo 2008-07-29 11:56 发表评论
]]>
Solarispȝq程的查看和理http://www.aygfsteel.com/envoydada/archive/2008/06/11/207028.htmlDerek.GuoDerek.GuoWed, 11 Jun 2008 01:34:00 GMThttp://www.aygfsteel.com/envoydada/archive/2008/06/11/207028.htmlhttp://www.aygfsteel.com/envoydada/comments/207028.htmlhttp://www.aygfsteel.com/envoydada/archive/2008/06/11/207028.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/207028.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/207028.html1、什么是q程Q?
q程Q可q发执行的程序在一定数据集合上的运行过E。进E即是资源分配的基本单位Q也是调度和分派的基本单位?

2、UNIX操作pȝq程调度法Q?
多反馈调度队列法?

3、进E状态:创徏、初始、就l(zd、静止)、执行、阻塞(zd、静止)、结束?

4、进E监控命令:
ps 命o和进E工?usr/proc/bin下的工具U?
可以ps和grep命ol合使用来搜索特定的信息?
5?usr/proc/bin的命令介l:
pstop 停止q程
prun pid 重新启动q程
ptime pid 使用微状态计进E时?
pwait pid {待指定的进E终?
pcred pid 昄可信?
pfiles pid 昄已打开文g的fstat 和fcntl 信息
pflags pid 昄每个lwp ?proc 跟踪标志,{待和持有信号量以及其他?
态信?
pldd pid 昄链接到每个进E的动态链接库
pmap pid 昄地址映射I间
psig pid 昄信号操作
pstack pid 昄每个lwp 的十六进制与W号堆跟t?
ptree pid 昄包含指定PID 的进E树
pwdx oid 昄当前工作目录

6、ps命o格式Q?
ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ] [ -u userlist ] [ -U userlist ] [ -G grouplist ] [ -p proclist ] [ -g pgrplist ] [ -s sidlist ]

7、常用的参数Q?
-e 输出所有进E报?
-f 在第一栏显CE所有者的名字(不是UID)。该选项关闭-l?#8211;t?#8211;s ?#8211;r 选项,打开-a 选项?
-l 产生一个长的输出报?只是不包含STIME 字段

8、ps -el的相兌出参数解释:
bash-2.05$ ps -el

F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD
19 T 0 0 0 0 0 SY ? 0 ? 0:16 sched
8 S 0 1 0 0 40 20 ? 151 ? ? 0:00 init
19 S 0 2 0 0 0 SY ? 0 ? ? 0:00 pageout
19 S 0 3 0 0 0 SY ? 0 ? ? 0:30 fsflush
8 S 0 377 1 0 40 20 ? 223 ? ? 0:00 sac
8 S 0 378 1 0 40 20 ? 224 ? console 0:00 ttymon
8 S 0 131 1 0 40 20 ? 289 ? ? 0:00 rpcbind

F 十六q制标志Q它们加h表示q程的当前状态。如下所qͼ
00 q程l止Q而且它们在进E表中的I间已释放?
01 pȝq程Q长d?
02 q程被父q程跟踪
04 q程被父q程跟踪而且已被停止
08 该进E无法被信号量唤?
10 该进E当前在内存中,而且被锁定直C个事件完?
20 q程不能被交换出

S q程当前状态,׃下字母之一昄Q?
O 当前正在处理器上q行
S 睡眠Q等待I/O事g完成
R q行l束
I I闲Q进E被创徏
Z 僉|。进E已l止
T ׃父进E跟t而停?
X {待更多的内?

UID q程所有者的用户ID
PID q程ID
PPID 父进EID
C q程的CPU使用情况Q即q程占CPU旉的百分比Q?
PRI q程优先权方案。较大的数表C低的优先?
NI q程的nice|该g优先权方案相兌。一个进E?#8220;nicer”意指降低该进E的优先权,以它不会用CPU的时?
SZ q程h的虚拟内存量。这是该pȝ对内存需求的一个好的指标?
TTY 启动q程Q或者父q程Q的l端。带问号的进E无控制l端Q通常为系l进E)
TIME 自进E启动以来占CPU旉总量
COMD 产生q程的命?

9、用ps报告?
查找属于一个用L许多相同的工作。Kill命ol止q程?ps -U username
查找TIME字段中占用了很多CPU旉的进E。这Lq程可能在死循环。ps -e
查找C字段,扑և不重要但占用了大量CPU旉的进E。如果该q程获取q多内存Q删除该q程。如果许多进E占用了大量内存Q则pȝ可能需要增加内存。ps -el
注意使用来多CPU旉的失控进E。可以通过使用-f选项查看q程启动旉QSTIME)以及通过查看TIME字段中的CPU旉总量来检失控进E?ps -f

10、删除进E?
在正帔R径无法l束时才使用删除命o?
#kill - signal pid
signalQ?7
signalQ?
2 中断
3 退?
4 非法指o
5 跟踪中断
6 Abort
7 EMT指oQEmulation竞争trapQ?
8 点格式的异常情?
9 killQ不能被捕获或忽略)
10 通道错误
11不合法的内存区段
12 错误pȝ调用
13 写入不可ȝq通管?
14 alarm clock
15 软gl束信号
16 用户定义的信?
17用户定义的信?
18 子进E状态被改变
19 甉|坏掉
20H口QWindow)的大被改变
21Urgent(紧急的Q?Socket Condition
22 PollableQ可查询的)event
23 停止
24 qL?
25 l箋执行
26 停止l端输入
27 停止l端输出
28 virtual Timer expired
29 Profiling time expired
30 过CPU旉
31 过文g大小限制
32 Socket I/O possible

有时即用kill命oQ但q程仍未被删除。最有可能的三种情况Q?
q程在退出前{待讑֤完成操作?
q程在等待由于NFS故障而导致的无法使用的资源。要删除此类q程Q输入kill -quit PID
q程为僵死进E,在ps报告的defunct的消息中昄。僵死进E是释放了所有资源,但未接受到父q程认的进E。只有收到确认才删除q程在进E表中的入口。下一ơ引导时僉|q程会被清除。僵死进E不影响pȝ性能Q不需要删除?

11、优先权控制?
使用priocntl命o可以Q?
昄或设|指定进E的调度?
昄pȝ调度E序的当前配|信?
执行带有指定调度参数的命?
每个q程都有不同的Q每U分配有各自不同的调度策略?
pȝ可能配置的包括Q?
pȝQSYS)
交互(IA)
实时(RT)
分式׃n(TS)
对于分式׃nU,用户提供的优先权范围为:-20~+20。一?
分时׃nq程的优先权Q用h式优先权Q是从父q程l承
而来。系l在分时调度表中查找用户模式优先权,加入M
nice值或q者priocntl优先权|用户提供Q,保证创徏的全
局优先权在0~59之间?
在默认配|中Q一个可q行的实时进E在M其它q程之前q行。实时进E用不当会Dpȝ性能急剧下降?
1. 昄q程U的基本信息Q进E或系l调度参敎ͼ:
输入priocntl -lq回?
2. 昄q程的全局优先U?
使用ps -ecl命o昄q程的全局优先权。全局优先权在PRI栏列?
3、指定进E的优先U:
输入priocntl -e -c class -m user -limit -p priority command - name回R
-e 执行命o
-c 指定U(默认选项是TSQ分时共享)或RIQ实Ӟ
-m 用户限制选项Q指?p选项提升或降低优先权的最大量?
-p 允许指定用户提供的优先权Q范围ؓ-20~+20?

4.更改分时׃nq程的调度参?
依照以下步骤更改分时׃nq程的调度参敎ͼ
1Q成U用戗?
2Q输入priocntl -s -m user -limit [-p priority] -i id type id -list回R?
-s允许讄用户优先权范围的上限
-m 用户限制选项Q指?p选项提升或降低优先权的最大量?
-p优先权命令名选项Q允许指定优先权?
-I id -type和id -list选项使用id -type和id -list的组合标识进E, id -
type指定idcdQ如PID或UID?
3Q输入ps -ecl|grep id -list回R?
4Q检查PRI栏的输出Q验证已l成功地更改了进E状态?
% priocntl -s -c RT -t 500 -p 20 myprog
% ps -ecl|grep myprog

5. 更改q程
依照以下步骤更改q程U:
1Q成U用戗?
2Q输入priocntl -s -c class -i id type id -list回R?
-s允许讄用户优先权范围的上限q更改优先权
-c 指定x改的q程UؓTSQ分时共享)U或RIQ实ӞU?
-I id -type和id -list选项使用id -type和id -list的组合标识进E, id -type指定id
cdQ如PID或UID?
3Q输入ps -ecl|grep id -list回R?
4Q检查PRI栏的输出Q验证已l成功地更改了进E状态?
注意Q必L用户或者在实时shell中操作,更改q程Uؓ非实时或者实时?

6、更改进E优先
使用nice命o可以提高或降低一个命令或q程的优先权?
不带参数使用该命令则默认nice值增4个单位,使进E优?
权降低?
注意Q必L用户才能?
/usr/bin/nice command -name(默认Q进E的优先权降?个单位)
/usr/bin/nice +10 command -nameQ进E的优先权降?0个单位)
/usr/bin/nice -10 command -nameQ进E的优先权增?0个单位)
/usr/bin/nice - -10 command -nameQnice 值减?0个单位,提高一个命令的优先权)

Derek.Guo 2008-06-11 09:34 发表评论
]]>
Solaris 操作pȝ的动态跟t工具Dtracehttp://www.aygfsteel.com/envoydada/archive/2007/09/29/149640.htmlDerek.GuoDerek.GuoSat, 29 Sep 2007 09:36:00 GMThttp://www.aygfsteel.com/envoydada/archive/2007/09/29/149640.htmlhttp://www.aygfsteel.com/envoydada/comments/149640.htmlhttp://www.aygfsteel.com/envoydada/archive/2007/09/29/149640.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/149640.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/149640.html       DTrace 是一个内|于 Solaris 中的全面的动态跟t工兗管理员和开发者可以用该工具Q在实时生pȝ上检查用L序及操作pȝ本n的行为?DTrace 允许您查看系l,以便了解其工作方式、在软g的多个层之间跟踪性能问题或找出导致异常行为的原因?

DTrace动态跟t指?br /> http://docs.sun.com/app/docs/doc/819-6959

Derek.Guo 2007-09-29 17:36 发表评论
]]>
Linux自启Tomcat,Solaris自启glassfishhttp://www.aygfsteel.com/envoydada/archive/2007/08/01/133838.htmlDerek.GuoDerek.GuoWed, 01 Aug 2007 09:31:00 GMThttp://www.aygfsteel.com/envoydada/archive/2007/08/01/133838.htmlhttp://www.aygfsteel.com/envoydada/comments/133838.htmlhttp://www.aygfsteel.com/envoydada/archive/2007/08/01/133838.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/133838.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/133838.htmlLinux:
      修改/etc/rc.local,增加

export JAVA_HOME=/usr/java/jdk1.5.0_09
/usr/local/src/tomcat5.5.20/bin/startup.sh


Solaris:
      在目?etc/rc2.d新增?#8220;S”开头的文gQ如Sglassfish,~辑文gd启动命o

asadmin start-domain domain1



Derek.Guo 2007-08-01 17:31 发表评论
]]>
JProfilerq程监控Tomcathttp://www.aygfsteel.com/envoydada/archive/2007/07/30/133285.htmlDerek.GuoDerek.GuoMon, 30 Jul 2007 03:53:00 GMThttp://www.aygfsteel.com/envoydada/archive/2007/07/30/133285.htmlhttp://www.aygfsteel.com/envoydada/comments/133285.htmlhttp://www.aygfsteel.com/envoydada/archive/2007/07/30/133285.html#Feedback1http://www.aygfsteel.com/envoydada/comments/commentRss/133285.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/133285.htmlWindows客户端的JProfilerq程监控Linux上的Tomcat

1.试环境

服务器:RedHat Linux 3.4.3-9.EL4Q内核版?2.6.9-5.ELQ,Tomcat5.5.20QSun JDK 1.5.0_09QJProfiler 4.3.2 for linuxQ安装包Qjprofiler_linux_4_3_2.shQ?
客户端:Windows XPQJProfiler 4.3.2 for windowsQ安装包Qjprofiler_windows_4_3_2.exeQ?

2.JProfiler软g下蝲地址 http://www.ej-technologies.com/

3.客户?JProfiler 安装 ?/strong>

4.服务器端 JProfiler 安装Q?/strong>
?jprofiler_linux_4.3.2.sh 上传到到服务器,假设路径?/opt/jprofiler

# cd /opt/jprofiler
# chmod +x *.sh
# ./jprofiler_linux_4.3.2.sh -c
按照提示来安装,提示都很单,不在多说。安装\径选择 /opt/jprofiler4

注意Q这里的 -c 意思是用字W方式来安装Q如果机器上没有 X 则加上该参数.

5.客户端连接配|?/strong>
1). q行 JProfiler 。第一ơ打开会有向导Q忽略它?
2). 选择 Session->Integration Wizard->New Remote Integratation
3). 选择 On a remote computerQPlatform of remote computer 选择 Linux x86/AMD 64QNext
4). 输入服务?IP QNext
5). 输入服务器上?jprofiler 的安装\径,?/opt/jprofiler4 Qnext
6). 选择服务器的 JDK 环境Q这里是QSunQ?.5.0QhotspotQnext
7). 输入端口Q这里是默认?8849Qnext
8). 选择启动模式Q这里选第一U?wait for a connection from the jprofiler GUIQnext
9). q里会列出需要在服务器端做的配置:

Integration type: [Generic application]
Selected JVM: Sun 
1.5.0 (hotspot)
Startup mode: Wait 
for JProfiler GUI

(
1) Please insert

-agentlib:jprofilerti=port=8849  -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar

into the start command of your remote application right after the java command.

(
2) Please add

/opt/jprofiler4/bin/linux-x86

to the environment variable LD_LIBRARY_PATH.

A remote session named Remote application on 
192.168.40.15 will be created that connects to a running instance of the remote application that is started with the modified start command.


6.服务器端的配|?br>
(1)修改pȝ环境配置文g /etc/profile ,增加

JPROFILER_HOME=/opt/jprofiler4/bin/linux-x86
export LD_LIBRARY_PATH
=$LD_LIBRARY_PATH:$JPROFILER_HOME


(2)修改TOMCAT启动文gcatalina.shQ添?agentlib:jprofilerti=port=8849  -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar 内容到CATALINA_OPTS中;
“-agentlib:jprofilerti=port=8849  -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar ” 此内容由客户端Y件生?/p>

CATALINA_OPTS="$CATALINA_OPTS -Xms128m -Xmx128m $JPDA_OPTS -agentlib:jprofilerti=port=8849  -Xbootclasspath/a:/opt/jprofiler4/bin/agent.jar"


7.Reboot Linux and startup Tomcat using startup.sh;
   The log of tomcat which is $CATALINA_HOME/logs/catalina.out will show:

 JProfiler> Protocol version 23
 JProfiler
> Using JVMTI
 JProfiler
> 32-bit library
 JProfiler
> Listening on port: 8849.
 JProfiler
> Native library initialized
 JProfiler
> Waiting for a connection from the  JProfiler GUI 

 

8.启动客户端Y?br>   点击jprofiler菜单 session>start center>Open Session
   Available session configurations中列Z刚才配置的连接,选中使用OK了!Q?/p>

9.The log of tomcat which is $CATALINA_HOME/logs/catalina.out will show:

 JProfiler> Using dynamic instrumentation
 JProfiler
> Time measurement: elapsed time
 JProfiler
> CPU profiling enabled
 JProfiler
> Hotspot compiler enabled
 JProfiler
> Starting org/apache/catalina/startup/Bootstrap 

 

10.当中断JProfilerq接?br>   The log of tomcat which is $CATALINA_HOME/logs/catalina.out will show:

 JProfiler> Disconnected. Waiting for reconnection.
 JProfiler
> Listening on port: 8849.


Derek.Guo 2007-07-30 11:53 发表评论
]]>
Glassfish的安?/title><link>http://www.aygfsteel.com/envoydada/archive/2007/07/24/132080.html</link><dc:creator>Derek.Guo</dc:creator><author>Derek.Guo</author><pubDate>Tue, 24 Jul 2007 08:32:00 GMT</pubDate><guid>http://www.aygfsteel.com/envoydada/archive/2007/07/24/132080.html</guid><wfw:comment>http://www.aygfsteel.com/envoydada/comments/132080.html</wfw:comment><comments>http://www.aygfsteel.com/envoydada/archive/2007/07/24/132080.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/envoydada/comments/commentRss/132080.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/envoydada/services/trackbacks/132080.html</trackback:ping><description><![CDATA[<h4><span style="color: red">Instructions to unbundle and configure GlassFish</span> </h4> <p>To install and configure GlassFish you need to have JDK 5 installed on your system. The configuration processing depends on Ant (1.6.5).  The bundle includes an Ant distribution that has been extended with tasks to facilitate developing Java EE 5 applications for the application server. </p> <ol> <li> <div style="border-right: #666666 1px solid; border-top: #666666 1px solid; border-left: #666666 1px solid; border-bottom: #666666 1px solid"> <ol> <li>Download one of the bundles to disk, set JAVA_HOME to JDK 5.<br /> <li>Run: <pre>% java -Xmx256m -jar <em>filename.jar</em></pre> This command will unbundle GlassFish and create a new directory structure rooted under a directory named 'glassfish'. <li> <pre>% cd glassfish</pre> <li>If you are using a machine with an operating system that is a derivative of UNIX(tm), set the execute permission for the Ant binaries that are included with the GlassFish bundle. <pre>% chmod -R +x lib/ant/bin</pre> <pre>% lib/ant/bin/ant -f setup.xml </pre> OR for Windows:<br /> <pre>% lib\ant\bin\ant -f setup.xml </pre> </li> </ol> </div> </li> </ol> <p>For GlassFish V2 with Clustering supported installation, just change step 4 from the above installation</p> <pre style="margin-left: 40px"> <div style="border-right: #666666 1px solid; border-top: #666666 1px solid; border-left: #666666 1px solid; border-bottom: #666666 1px solid"> <pre style="margin-left: 40px">% lib/ant/bin/ant -f setup-cluster.xml </pre> </div> OR  for Windows: <br /> </pre> <pre style="margin-left: 40px"> <div style="border-right: #666666 1px solid; border-top: #666666 1px solid; border-left: #666666 1px solid; border-bottom: #666666 1px solid"> <pre style="margin-left: 40px">% lib\ant\bin\ant -f setup-cluster.xml </pre> </div> </pre> <p>To get started with GlassFish, see the <a ><u><font color="#800080">quick start guide</font></u></a>.<br /> </p> <p><glassfish_install_dir>See </glassfish_install_dir><a ><u><font color="#0000ff">Configuring the Cluster/Load Balancer with GlassFish V2</font></u></a> for how to do the load balancing after creating Clusters on GlassFish V2.<a ></a></p> <h4><span style="color: red">Instructions to schedule and configure the auto-update feature</span></h4> <p>These steps assume that you have already unbundled and configured GlassFish. <p> <ol> <li>Change directory to where you have installed GlassFish. <li>Go to the updatecenter/bin subdirectory. <li>Run the updatecenter client script: <pre> <div style="border-right: #666666 1px solid; border-top: #666666 1px solid; border-left: #666666 1px solid; border-bottom: #666666 1px solid">% ./updatetool </div> </pre> <li>The GlassFish Update Center dialog window will be displayed at this time. Click on the "Preferences" tab. <li>To disable auto-update, set the "Update Schedule: Check for Updates" to "Never (Manual)". <li>You can also schedule updates by setting the desired date and time. </li> </ol> <p>For more information on data collection done by the auto-update feature, please visit the <a ><u><font color="#0000ff">GlassFish Usage Metrics</font></u></a> page.</p> <h3>Binary builds</h3> <p>The Open Sourcing Clustering features are included in this promotion.</p> <p><strong>Solaris SPARC Platform</strong> </p> <ul> <li><a ><u><font color="#0000ff">glassfish-installer-v2-b50g.jar</font></u></a>, size 70M </li> </ul> <p><strong>Solaris x86 Platform</strong></p> <ul> <li><a ><u><font color="#0000ff">glassfish-installer-v2-b50g-sunos_x86.jar</font></u></a> size 67M </li> </ul> <p><strong>Windows Platform</strong></p> <ul> <li><a ><u><font color="#0000ff">glassfish-installer-v2-b50g-windows.jar</font></u></a> size 63M </li> </ul> <p><strong>Linux Platform</strong></p> <ul> <li><a ><u><font color="#0000ff">glassfish-installer-v2-b50g-linux.jar</font></u></a> size 64M </li> </ul> <p><strong>MacOS Platform</strong></p> <ul> <li><a ><u><font color="#0000ff">glassfish-installer-v2-b50g-darwin.jar</font></u></a> size 67M </li> </ul> <h3>Source bundle</h3> <p>Source code for GlassFish is available in the bundle below. Some technologies are developed in other projects and only a binary version is available in the GlassFish project source tree. To find more information on where to find sources see this <a ><u><font color="#0000ff">page</font></u></a>.<br /> </p> <ul> <li><a ><u><font color="#0000ff">b50g source bundle</font></u></a><br /> </li> </ul> <img src ="http://www.aygfsteel.com/envoydada/aggbug/132080.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/envoydada/" target="_blank">Derek.Guo</a> 2007-07-24 16:32 <a href="http://www.aygfsteel.com/envoydada/archive/2007/07/24/132080.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>启动Solaris10-webminhttp://www.aygfsteel.com/envoydada/archive/2007/07/10/129316.htmlDerek.GuoDerek.GuoTue, 10 Jul 2007 04:50:00 GMThttp://www.aygfsteel.com/envoydada/archive/2007/07/10/129316.htmlhttp://www.aygfsteel.com/envoydada/comments/129316.htmlhttp://www.aygfsteel.com/envoydada/archive/2007/07/10/129316.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/129316.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/129316.htmlTo get it up and running, run the following as root:
# /usr/sfw/lib/webmin/setup.sh
# svcadm enable webmin


Derek.Guo 2007-07-10 12:50 发表评论
]]>
Linux pȝ的配|文?/title><link>http://www.aygfsteel.com/envoydada/archive/2006/12/07/86074.html</link><dc:creator>Derek.Guo</dc:creator><author>Derek.Guo</author><pubDate>Thu, 07 Dec 2006 05:21:00 GMT</pubDate><guid>http://www.aygfsteel.com/envoydada/archive/2006/12/07/86074.html</guid><wfw:comment>http://www.aygfsteel.com/envoydada/comments/86074.html</wfw:comment><comments>http://www.aygfsteel.com/envoydada/archive/2006/12/07/86074.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/envoydada/comments/commentRss/86074.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/envoydada/services/trackbacks/86074.html</trackback:ping><description><![CDATA[<blockquote><font size=2>?文说明了 Linux pȝ的配|文Ӟ在多用户、多d环境中,配置文g控制用户权限、系l应用程序、守护进E、服务和其它理d。这些Q务包括管理用户帐受分配磁盘配 额、管理电子邮件和新闻l,以及配置内核参数。本文还Ҏ配置文g的用和其所影响的服务的情况对目?Red Hat Linux pȝ中的配置文gq行了分cR?</font></blockquote> <p><a name=1><span id="wmqeeuq" class=atitle><font size=2>介绍 </font></span></a></p> <p><font size=2>每个 Linux E序都是一个可执行文gQ它含有操作码列表,CPU 执行这些操作码来完成特定的操作。例如,ls 命o是由 /bin/ls 文g提供的,该文件含有机器指令的列表Q在屏幕上显C当前目录中文g的列表时需要用这些机器指令?几乎每个E序的行为都可以通过修改光|文件来按照您的偏好或需要去定制?</font></p> <p><a name=N10045><span id="wmqeeuq" class=smalltitle><font size=2>Linux 中有没有一个标准的配置文g格式Q?</font></span></a></p> <p><font size=2>一句话Q没有。不熟悉 Linux 的用P一定)会感到沮丧,因ؓ每个配置文g看v来都象是一个要q接的新挑战。在 Linux 中,每个E序员都可以自由选择他或她喜Ƣ的配置文g格式。可以选择的格式很多,?/etc/shells 文gQ它包含被一个换行符分开?shell 的列表)Q到 Apache 的复杂的 /etc/httpd.conf 文g?</font></p> <p><a name=N1004E><span id="wmqeeuq" class=smalltitle><font size=2>什么是pȝ配置文gQ?</font></span></a></p> <p><font size=2>内核本n也可以看成是一?#8220;E序”。ؓ什么内栔R要配|文Ӟ内核需要了解系l中用户和组的列表,q而管理文件权限(x据权限判定特定用?QUNIX_USERSQ是否可以打开某个文gQ。注意,q些文g不是明确地由E序d的,而是ql库所提供的一个函数读取,q被内核使用。例如,E序 需要某个用LQ加密过的)密码时不应该打开 /etc/passwd 文g。相反,E序应该调用pȝ库的 getpw() 函数。这U函C被称为系l调用。打开 /etc/passwd 文g和之后查N个被h的用L密码都是由内核(通过pȝ库)军_的?</font></p> <p><font size=2>除非另行指定QRed Hat Linux pȝ中大多数配置文g都在 /etc 目录中。配|文件可以大致分Z面几c: </font></p> <p><font size=2><br></font></p> <br><br> <p><a name=2><span id="wmqeeuq" class=atitle><font size=2>讉K文g </font></span></a></p> <p><font size=2></font></p> <p><font size=2></font></p> <table style="WIDTH: 685px; HEIGHT: 129px" cellSpacing=0 width=685 border=1> <tbody> <tr> <td><strong><font size=2><em>/etc/host.conf</em> </font></strong></td> <td><font size=2>告诉|络域名服务器如何查找主机名。(通常?/etc/hostsQ然后就是名U服务器Q可通过 netconf 对其q行更改Q?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/hosts</em> </font></strong></td> <td><font size=2>包含Q本地网l中Q已知主机的一个列表。如果系l的 IP 不是动态生成,可以用它。对于简单的L名解析(点分表示法)Q在h DNS ?NIS |络名称服务器之前,/etc/hosts.conf 通常会告诉解析程序先查看q里?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/hosts.allow</em> </font></strong></td> <td><font size=2>请参?hosts_access 的联机帮助页。至由 tcpd d?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/hosts.deny</em> </font></strong></td> <td><font size=2>请参?hosts_access 的联机帮助页。至由 tcpd d?</font></td> </tr> </tbody> </table> <br><br><br> <p><a name=3><span id="wmqeeuq" class=atitle><font size=2>引导和登录/注销 </font></span></a></p> <p><font size=2></font></p> <p><font size=2></font></p> <table style="WIDTH: 698px; HEIGHT: 215px" cellSpacing=0 width=698 border=1> <tbody> <tr> <td><strong><font size=2><em>/etc/issue & /etc/issue.net</em> </font></strong></td> <td><font size=2>q些文g?mingettyQ和cM的程序)dQ用来向从终端(issueQ或通过 telnet 会话Qissue.netQ连接的用户昄一?#8220;welcome”字符丌Ӏ?它们包括几行声明 Red Hat 版本受名U和内核 ID 的信息。它们由 rc.local 使用?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/redhat-release</em> </font></strong></td> <td><font size=2>包括一行声?Red Hat 版本号和名称的信息。由 rc.local 使用?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/rc.d/rc</em> </font></strong></td> <td><font size=2>通常在所有运行别运行,U别作ؓ参数传送?例如Q要以图形(GraphicsQ模式(X-ServerQ引导机器,请在命o行运行下面的命oQ?<code><font face=新宋?init 5</font></code> 。运行?5 表示以图形模式引导系l?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/rc.d/rc.local</em> </font></strong></td> <td><font size=2>非正式的。可以从 rc、rc.sysinit ?/etc/inittab 调用?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/rc.d/rc.sysinit</em> </font></strong></td> <td><font size=2>通常是所有运行别的W一个脚本?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/rc.d/rc/rcX.d</em> </font></strong></td> <td><font size=2>?rc q行的脚本( <strong>X</strong> 表示 1 ?5 之间的Q意数字)。这些目录是特定“q行U别”的目录?当系l启动时Q它会识别要启动的运行别,然后调用该运行别的特定目录中存在的所有启动脚本。例如,pȝ启动旉常会在引导消息之后昄“entering run-level 3”的消息;q意味着 /etc/rc.d/rc3.d/ 目录中的所有初始化脚本都将被调用?</font></td> </tr> </tbody> </table> <br><br><br> <p><a name=4><span id="wmqeeuq" class=atitle><font size=2>文gpȝ </font></span></a></p> <p><font size=2>内核提供了一个接口,用来昄一些它的数据结构,q些数据l构对于军_诸如使用的中断、初始化的设备和内存l计信息之类的系l参数可能很有用。这个接口是作ؓ一个独立但虚拟的文件系l提供的Q称?/proc 文gpȝ。很多系l实用程序都使用q个文gpȝ中存在的值来昄pȝl计信息。例如,/proc/modules 文g列Dpȝ中当前加载的模块。lsmod 命od此信息,然后其以h们可以看懂的格式昄出来?下面表格中指定的 mtab 文g以同L方式d包含当前安装的文件系l的 /proc/mount 文g?</font></p> <p><font size=2></font></p> <table style="WIDTH: 663px; HEIGHT: 78px" cellSpacing=0 width=663 border=1> <tbody> <tr> <td><strong><font size=2><em>/etc/mtab</em> </font></strong></td> <td><font size=2>q将随着 /proc/mount 文g的改变而不断改变。换句话_文gpȝ被安装和卸蝲Ӟ改变会立卛_映到此文件中?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/fstab</em> </font></strong></td> <td><font size=2>列D计算机当?#8220;可以安装”的文件系l?q非帔R要,因ؓ计算机引导时运?<code><font face=新宋?mount -a</font></code> 命oQ该命o负责安装 fstab 的倒数W二列中带有“1”标记的每一个文件系l?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/mtools.conf</em> </font></strong></td> <td><font size=2>DOS cd的文件系l上所有操作(创徏目录、复制、格式化{等Q的配置?</font></td> </tr> </tbody> </table> <br><br><br> <p><a name=5><span id="wmqeeuq" class=atitle><font size=2>pȝ理 </font></span></a></p> <p><font size=2></font></p> <p><font size=2></font></p> <table style="WIDTH: 655px; HEIGHT: 400px" cellSpacing=0 width=655 border=1> <tbody> <tr> <td><strong><font size=2><em>/etc/group</em> </font></strong></td> <td><font size=2>包含有效的组名称和指定组中包括的用户。单一用户如果执行多个dQ可以存在于多个l中。例如,如果一?#8220;用户”?#8220;project 1”工程l的成员Q同时也是管理员Q那么在 group 文g中他的条目看h׃是这LQ?<code><font face=新宋?user: * : group-id : project1</font></code></font> </td> </tr> <tr> <td><strong><font size=2><em>/etc/nologin</em> </font></strong></td> <td><font size=2>如果?/etc/nologin 文g存在Qlogin(1) 只允许 root 用户q行讉K。它对其它用户昄此文件的内容q拒l其d?</font></td> </tr> <tr> <td><strong><font size=2><em>etc/passwd</em> </font></strong></td> <td><font size=2>请参?#8220;man passwd”。它包含一些用户帐号信息,包括密码Q如果未?shadow E序加密q)?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/rpmrc</em> </font></strong></td> <td><font size=2>rpm 命o配置。所有的 rpm 命o行选项都可以在q个文g中一赯|,q样Q当M rpm 命o在该pȝ中运行时Q所有的选项都会全局适用?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/securetty</em> </font></strong></td> <td><font size=2>包含讑֤名称Q由 tty 行组成(每行一个名Uͼ不包括前面的 /dev/Q,root 用户在这里被允许d?</font></td> </tr> <tr> <td><font size=2><strong><em>/etc/usertty</em> </strong><br><strong><em>/etc/shadow</em> </strong></font></td> <td><font size=2>包含加密后的用户帐号密码信息Q还可以包括密码时效信息。包括的字段有: </font> <ul> <li><font size=2>d?</font> <li><font size=2>加密后的密码 </font> <li><font size=2>?1970 q?1 ?1 日到密码最后一ơ被更改的天?</font> <li><font size=2>距密码可以更改之前的天数 </font> <li><font size=2>距密码必L改之前的天数 </font> <li><font size=2>密码到期前用戯警告的天?</font> <li><font size=2>密码到期后帐戯用的天?</font> <li><font size=2>?1970 q?1 ?1 日到帐号被禁用的天数 </font></li> </ul> </td> </tr> <tr> <td><strong><font size=2><em>/etc/shells</em> </font></strong></td> <td><font size=2>包含pȝ可用的可能的“shell”的列表?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/motd</em> </font></strong></td> <td><font size=2>每日消息Q在理员希望向 Linux 服务器的所有用户传达某个消息时使用?</font></td> </tr> </tbody> </table> <br><br><br> <p><a name=6><span id="wmqeeuq" class=atitle><font size=2>联网 </font></span></a></p> <p><font size=2></font></p> <p><font size=2></font></p> <table style="WIDTH: 661px; HEIGHT: 340px" cellSpacing=0 width=661 border=1> <tbody> <tr> <td><strong><font size=2><em>/etc/gated.conf</em> </font></strong></td> <td><font size=2>gated 的配|。只能被 gated 守护q程所使用?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/gated.version</em> </font></strong></td> <td><font size=2>包含 gated 守护q程的版本号?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/gateway</em> </font></strong></td> <td><font size=2>?routed 守护q程可选地使用?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/networks</em> </font></strong></td> <td><font size=2>列D从机器所q接的网l可以访问的|络名和|络地址。通过路由命o使用。允怋用网l名U?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/protocols</em> </font></strong></td> <td><font size=2>列D当前可用的协议。请参阅 NAGQ网l管理员指南QNetwork Administrators GuideQ和联机帮助c?C 接口?getprotoent。绝不能更改?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/resolv.conf</em> </font></strong></td> <td><font size=2>在程序请?#8220;解析”一?IP 地址时告诉内核应该查询哪个名U服务器?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/rpc</em> </font></strong></td> <td><font size=2>包含 RPC 指oQ规则,q些指oQ规则可以在 NFS 调用、远E文件系l安装等中用?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/exports</em> </font></strong></td> <td><font size=2>要导出的文gpȝQNFSQ和对它的权限?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/services</em> </font></strong></td> <td><font size=2>网l服务名转换为端口号Q协议。由 inetd、telnet、tcpdump 和一些其它程序读取。有一?C 讉K例程?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/inetd.conf</em> </font></strong></td> <td><font size=2>inetd 的配|文件。请参阅 inetd 联机帮助c?包含每个|络服务的条目,inetd 必须些网l服务控制守护进E或其它服务。注意,服务会q行Q但?/etc/services 中将它们注释掉了Q这样即使这些服务在q行也将不可用?格式为:<service_name></service_name><sock_type></sock_type> <proto></proto> <flags></flags><user></user><server_path></server_path><args></args></font></td> </tr> <tr> <td><strong><font size=2><em>/etc/sendmail.cf</em> </font></strong></td> <td><font size=2>邮gE序 sendmail 的配|文件。比较隐晦,很难理解?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/sysconfig/network</em> </font></strong></td> <td><font size=2>指出 NETWORKING=yes ?no。至由 rc.sysinit d?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/sysconfig/network-scripts/if*</em> </font></strong></td> <td><font size=2>Red Hat |络配置脚本?</font></td> </tr> </tbody> </table> <br><br><br> <p><a name=7><span id="wmqeeuq" class=atitle><font size=2>pȝ命o </font></span></a></p> <p><font size=2>pȝ命o要独占地控制pȝQƈ让一切正常工作。所有如 loginQ完成控制台用户w䆾验证阶段Q或 bashQ提供用户和计算Z间交互)之类的程序都是系l命令。因此,和它们有关的文g也特别重要。这一cd中有下列令用户和理员感兴趣的文件?</font></p> <p><font size=2></font></p> <table style="WIDTH: 678px; HEIGHT: 185px" cellSpacing=0 width=678 border=1> <tbody> <tr> <td><strong><font size=2><em>/etc/lilo.conf</em> </font></strong></td> <td><font size=2>包含pȝ的缺省引导命令行参数Q还有启动时使用的不同映象。您?LILO 引导提示的时候按 Tab 键就可以看到q个列表?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/logrotate.conf</em> </font></strong></td> <td><font size=2>l护 /var/log 目录中的日志文g?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/identd.conf</em> </font></strong></td> <td><font size=2>identd 是一个服务器Q它按照 RFC 1413 文档中指定的方式实现 TCP/IP 提议的标?IDENT 用户w䆾识别协议。identd 的操作原理是查找特定 TCP/IP q接q返回拥有此q接的进E的用户名。作为选择Q它也可以返回其它信息,而不是用户名。请参阅 identd 联机帮助c?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/ld.so.conf</em> </font></strong></td> <td><font size=2>“动态链接程?#8221;QDynamic LinkerQ的配置?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/inittab</em> </font></strong></td> <td><font size=2>按年代来Ԍq是 UNIX 中第一个配|文件。在一?UNIX 机器打开之后启动的第一个程序是 initQ它知道该启动什么,q是׃ inittab 的存在。在q行U别改变Ӟinit d inittabQ然后控制主q程的启动?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/termcap</em> </font></strong></td> <td><font size=2>一个数据库Q包含所有可能的l端cd以及q些l端的性能?</font></td> </tr> </tbody> </table> <br><br><br> <p><a name=8><span id="wmqeeuq" class=atitle><font size=2>守护q程 </font></span></a></p> <p><font size=2>守护q程是一U运行在非交互模式下的程序。一般来_守护q程d是和联网区域有关的:它们{待q接Q以侉K过q接提供服务。Linux 可以使用?Web 服务器到 ftp 服务器的很多守护q程?</font></p> <p><font size=2></font></p> <table style="WIDTH: 677px; HEIGHT: 124px" cellSpacing=0 width=677 border=1> <tbody> <tr> <td><strong><font size=2><em>/etc/syslogd.conf</em> </font></strong></td> <td><font size=2>syslogd 守护q程的配|文件。syslogd 是一U守护进E,它负责记录(写到盘Q从其它E序发送到pȝ的消息。这个服务尤其常被某些守护进E所使用Q这些守护进E不会有另外的方法来发出可能有问题存在的信号或向用户发送消息?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/httpd.conf</em> </font></strong></td> <td><font size=2>Web 服务?Apache 的配|文件。这个文件一般不?/etc 中。它可能?/usr/local/httpd/conf/ ?/etc/httpd/conf/ 中,但是要确定它的位|,您还需要检查特定的 Apache 安装信息?</font></td> </tr> <tr> <td><strong><font size=2><em>/etc/conf.modules or /etc/modules.conf</em> </font></strong></td> <td><font size=2>kerneld 的配|文件。有意思的是,kerneld q不?#8220;作ؓ守护q程?#8221;内核。它其实是一U在需要时负责“快?#8221;加蝲附加内核模块的守护进E?</font></td> </tr> </tbody> </table> <br><br><br> <p><a name=9><span id="wmqeeuq" class=atitle><font size=2>用户E序 </font></span></a></p> <p><font size=2>?LinuxQ和一般的 UNIXQ中Q有无数?#8220;用户”E序。最常见的一U用L序配|文件是 /etc/lynx.cfg。这是著名的文本览?lynx 的配|文件。通过q个文gQ您可以定义代理服务器、要使用的字W集{等?下面的代码样本展CZ lynx.cfg 文g的一部分Q修改这部分代码可以改变 Linux pȝ的代理服务器讄。缺省情况下Q这些设|适用于在各自?shell 中运?lynx 的所有用P除非某个用户通过指定 <code><font face=新宋?--cfg = "mylynx.cfg"</font></code> 重设了缺省的配置文g?</font></p> <p><br><a name=N10383><strong><font size=2>/etc/lynx.cfg 中的代理服务器设|?</font></strong></a><br></p> <table style="WIDTH: 661px; HEIGHT: 592px" cellSpacing=0 cellPadding=5 width=661 bgColor=#eeeeee border=1> <tbody> <tr> <td> <pre><code class=section> <font size=2>.h1 proxy<br>.h2 HTTP_PROXY<br>.h2 HTTPS_PROXY<br>.h2 FTP_PROXY<br>.h2 GOPHER_PROXY<br>.h2 NEWS_PROXY<br>.h2 NNTP_PROXY<br># Lynx version 2.2 and beyond supports the use of proxy servers that can act as<br># firewall gateways and caching servers. They are preferable to the older<br># gateway servers. Each protocol used by Lynx can be mapped separately using<br># PROTOCOL_proxy environment variables (see Lynx Users Guide). If you have<br># not set them externally, you can set them at run time via this configuration file.<br># They will not override external settings. The no_proxy variable can be used<br># to inhibit proxying to selected regions of the Web (see below). Note that on<br># VMS these proxy variables are set as process logicals rather than symbols, to<br># preserve lowercasing, and will outlive the Lynx image.<br>#<br>.ex 15<br>http_proxy:http://proxy3.in.ibm.com:80/<br>ftp_proxy:http://proxy3.in.ibm.com:80/<br>#http_proxy:http://penguin.in.ibm.com:8080<br>#ftp_proxy:http://penguin.in.ibm.com:8080/<br><br>.h2 NO_PROXY<br># The no_proxy variable can be a comma-separated list of strings defining<br># no-proxy zones in the DNS domain name space. If a tail substring of the<br># domain-path for a host matches one of these strings, transactions with that<br># node will not be proxied.<br>.ex<br>no_proxy:demiurge.in.ibm.com, demiurge </font> </code> <font size=2> </font> </pre> </td> </tr> </tbody> </table> <img src ="http://www.aygfsteel.com/envoydada/aggbug/86074.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/envoydada/" target="_blank">Derek.Guo</a> 2006-12-07 13:21 <a href="http://www.aygfsteel.com/envoydada/archive/2006/12/07/86074.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux下配|cvs服务?/title><link>http://www.aygfsteel.com/envoydada/archive/2006/11/16/81586.html</link><dc:creator>Derek.Guo</dc:creator><author>Derek.Guo</author><pubDate>Thu, 16 Nov 2006 10:42:00 GMT</pubDate><guid>http://www.aygfsteel.com/envoydada/archive/2006/11/16/81586.html</guid><wfw:comment>http://www.aygfsteel.com/envoydada/comments/81586.html</wfw:comment><comments>http://www.aygfsteel.com/envoydada/archive/2006/11/16/81586.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/envoydada/comments/commentRss/81586.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/envoydada/services/trackbacks/81586.html</trackback:ping><description><![CDATA[ <p>一 CVS<a target="_blank">服务?/a>的安装: <br />1。查看你的操作系l上是否安装了CVSQ?br />#> rpm -qa|grep cvs </p> <p>如果没有安装你可以在Redhat W?张光盘上扑ֈ<br /><br />2。徏立cvs用户l: </p> <p>#> groupadd cvs </p> <p>3。徏立cvsl的cvsroot用户和所属的目录Q?</p> <p>#> useradd -g cvs -G cvs –d /cvsroot cvsroot </p> <p>4。ؓcvsroot用户d密码Q?</p> <p>#> passwd cvsroot </p> <p>5。改?/cvsroot/ 的目录属性:</p> <p>#> chmod –R 770 /cvsroot </p> <p>6。改变用L陆n份: </p> <p>#> su cvsroot </p> <p>7。开始创建单个项目: </p> <p>#> cd /cvsroot <br />#> mkdir project1 <br />#>mkdir project2 <br />8。开始徏立仓库: </p> <p>#> cvs –d /cvsroot/project1 init <br />#> cvs –d /cvsroot/project2 init <br />#> chmod –R 770 ./project1/ ./project2/ </p> <p>9。徏立CVS服务启动文gQ我们用xinetd方式Q?</p> <p>#> [Crtl]+[d] 切换到root用户w䆾 <br />#> cd /etc/xinetd.d <br />#> vi cvspserver </p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <span style="COLOR: #000000">service cvspserver <br />{ <br />disable </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> no <br />flags </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> REUSE <br />socket_type </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> stream <br />wait </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> no <br />user </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> root <br />server</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">usr</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">bin</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">cvs <br />server_args</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">f </span> <span style="COLOR: #000000">--</span> <span style="COLOR: #000000">allow</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">root</span> <span style="COLOR: #000000">=/</span> <span style="COLOR: #000000">home2</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">cvsroot</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">project1 </span> <span style="COLOR: #000000">--</span> <span style="COLOR: #000000">allow</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">root</span> <span style="COLOR: #000000">=/</span> <span style="COLOR: #000000">home2</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">cvsroot</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">project2 pserver <br />log_on_failure </span> <span style="COLOR: #000000">+=</span> <span style="COLOR: #000000"> USERID <br />}</span> </div> <p>注:׃xinetd的server_args长度限制,当你惌行很多的单个仓库的时?可以q么做:</p> <p>#> vi cvspserver </p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <span style="COLOR: #000000">service cvspserver <br />{ <br />disable </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> no <br />flags </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> REUSE <br />socket_type </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> stream <br />wait </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> no <br />user </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> root <br />server </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">cvsroot</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">cvs.run <br />log_on_failure </span> <span style="COLOR: #000000">+=</span> <span style="COLOR: #000000"> USERID <br />}<br /><br /></span> </div> <p> </p> <p>~写cvs.run脚本 </p> <p>#> vi /cvsroot/cvs.run </p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">#</span> <span style="COLOR: #000000">!/</span> <span style="COLOR: #000000">bin</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">bash <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">usr</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">bin</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">cvs </span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">f <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #000000">--</span> <span style="COLOR: #000000">allow</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">root</span> <span style="COLOR: #000000">=/</span> <span style="COLOR: #000000">cvsroot</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">project1 <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #000000">--</span> <span style="COLOR: #000000">allow</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">root</span> <span style="COLOR: #000000">=/</span> <span style="COLOR: #000000">cvsroot</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">project2 <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" />pserver</span> </div> <p>#>chmod +x /cvsroot/cvs.run </p> <p>10。加入cvs服务Q?</p> <p>#>vi /etc/services </p> <p>cvspserver 2401/tcp #pserver cvs service <br />cvspserver 2401/udp #pserver cvs service <br />11。启动cvs服务Q?</p> <p>#> /etc/init.d/xinetd restart </p> <p>12。检查cvspserver服务是否已经启动Q?</p> <p>#> netstat -l |grep cvspserver <br />应该有如下结果: </p> <p>tcp 0 0 *:cvspserver *:* LISTEN </p> <p>二。CVS服务的用L理: </p> <p>上面我们已经建立了project1和project2两个CVS仓库Q下面我们分别给两个仓库建立cvs用户?</p> <p>13。创建可以登陆cvs<a target="_blank">服务?/a>的用户名和密码: </p> <p>#> su cvsroot <br />#> vi /cvsroot/project1/CVSROOT/passwd </p> <p>trotter:*****:cvsroot <br />mimi:*****:cvsroot </p> <p>#>vi /cvsroot/project2/CVSROOT/passwd </p> <p>trotter:*****:cvsroot <br />gary:*****:cvsroot </p> <p>q两个文件的意思是有trotterQmimiQgary三个cvs用户Qmimi拥有project1的用权限,gary拥有project2的用权限,trotter拥有project1和project2的用权限。登陆后的权限是cvsroot权限?br />注意Q这里的cvs用户和系l用h不同的?</p> <p>14?****为密码,׃下文件生成: </p> <p>#> vi /cvsroot/passwd.pl </p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <span style="COLOR: #000000">#</span> <span style="COLOR: #000000">!/</span> <span style="COLOR: #000000">usr</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">bin</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">perl <br />srand (time()); <br />my $randletter </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">; <br />my $salt </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> sprintf (</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">%c%c</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">, eval $randletter, eval $randletter); <br />my $plaintext </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> shift; <br />my $crypttext </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> crypt ($plaintext, $salt); <br />print </span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">${crypttext}</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">;</span> </div> <p>#>chmod a+x /cvsroot/passwd.pl </p> <p>15。如果你想生成一个密码是“123456”Q则Q?</p> <p>#> /cvsroot/passwd.pl “123456” </p> <p>回R卛_得到加密密码,用其替换passwd文g中的***** </p> <p>16。OkQcvs现在已经全部安装完成了,如果你想让一个用h有project1的权限,你就?cvsroot/project1/CVSROOT/passwd中给他加入一个用P如果你想让一个用户同时具有project1和project2的权限,你就l?cvsroot/project1/CVSROOT/passwd?cvsroot/project2/CVSROOT/passwd里给他加一个用户名和密码相同的用户卛_。最后,我们试用一下:</p> <p>#> cvs -d :pserver:trotter@192.168.1.200:/cvsroot/project1 login </p> <p>敲入命o回R后提C入trotter的密?你按照自p|的密码输入,如果没有什么错误信息出现就是成功了</p> <img src ="http://www.aygfsteel.com/envoydada/aggbug/81586.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/envoydada/" target="_blank">Derek.Guo</a> 2006-11-16 18:42 <a href="http://www.aygfsteel.com/envoydada/archive/2006/11/16/81586.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Apache + Tomcat*2集群 负蝲q(Linux环境)http://www.aygfsteel.com/envoydada/archive/2006/11/15/81196.htmlDerek.GuoDerek.GuoWed, 15 Nov 2006 03:06:00 GMThttp://www.aygfsteel.com/envoydada/archive/2006/11/15/81196.htmlhttp://www.aygfsteel.com/envoydada/comments/81196.htmlhttp://www.aygfsteel.com/envoydada/archive/2006/11/15/81196.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/81196.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/81196.htmlApache + Tomcat*2集群 负蝲qQLinux环境Q?/p>

说明Q一台apacheLQ两台tomcatL

安装JDK、安装Apache、安装Tomcat、配|Apache代理、配|Tomcat集群

一、安装JDKQ所有运行TomcatLQ即web服务器)
  1.下蝲JDK的bin包,如jdk-1_5_0_02-linux-i586.rpm.bin Q给其添加执行权限,执行#./jdk-1_5_0_02-linux-i586.rpm.bin , ?/p>

当前目录生成rpm安装包,同样l其d执行权限?再执?#rpm -ivh jdk-1_5_0_02-linux-i586.rpm 出现安装协议 ?lt;Enter>接受

卛_?br>  2.讄环境变量 #vi /etc/profile  在其最后加?/p>

        JAVA_HOME =/ usr / java / jdk1. 5 .0_02
        CLASSPATH
= .:$JAVA_HOME / lib:$JAVA_HOME / jre / lib
        PATH
= $PATH:$JAVA_HOME / bin:$JAVA_HOME / jre / bin
        export JAVA_HOME CLASSPATH PATH

     保存退?br>
  3.要JDK在所有的用户中用,可以q样Q?font color=#ff0000>vi /etc/profile.d/java.sh在新的java.sh中输入以下内容:
        #set java environment
        JAVA_HOME=/usr/java/jdk1.5.0_02
        CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
        PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
        export JAVA_HOME CLASSPATH PATH
     保存退出,然后ljava.sh分配权限Qchmod 755 /etc/profile.d/java.sh

二、安装ApacheQ访问代理主机)
  1.下蝲apache源代?http://archive.apache.org/dist/httpd/httpd-2.2.2.tar.gz

 解压~?tar fvxz httpd-2.2.2.tar.gz

  2.q入解压后的目录。进行配|:

. / configure  -- prefix =/ usr / apache  -- enable - module = most  -- enable - proxy  -- enable - proxy - ajp  -- enable - forward  -- enable - proxy - connect  -- enable - proxy - http  -- enable - so  -- enable - deflate  -- enable - headers  -- enable - include

上面的配|,用到了其他一些模块,说不定以后会用到Q如支持ssi的include模块?/p>

  3.~译Q编译如果不成功Q确认一下你的linux是否安装有编译所需要的c环境和其他需要的cdQ?br>    make

  4.安装 make install


  5.q入/usr/apache目录Q运行apache  ./apachectl -k start

      q行apache后,览一下是否运行正常?/p>

    关闭apache ./apachectl -k stop


   6.把apache作ؓlinux的启动就q行服务E序
     执行如下操作Qcp /usr/apache/bin/apachectl /etc/rc.d/init.d/httpd
     认linux以前安装的httpdQapacheQ不需要了Q你可覆盖掉以前apache的httpd文g?br>     chkconfig --add httpd
     q行linux的setupQ把httpd服务默认讑֮动运行?br>     到现在,你就可用另一U方式来启动、关闭apache了。如service httpd start


三、安装tomcatQWeb服务器)
    1.下蝲jakarta-tomcat-5.5.20.tar.gz
      tar zxf jakarta-tomcat-5.5.20.tar.gz 解压文g Q如解压?usr/local/Q?br>    2.讄环境变量 #vi /etc/profile  d
  CATALINA_HOME=/usr/local/jakarta-tomcat-5.5.30
  export CATALINA_HOME
      保存退?/p>

    3.修改JVM内存Q?bin/catalina.sh 文g
        在下# ----- Execute The Requested Command -----------------
            # Bugzilla 37848: only output this if we have a TTY
              if [ $have_tty -eq 1 ]; then
                 echo "Using CATALINA_BASE:   $CATALINA_BASE"
                 echo "Using CATALINA_HOME:   $CATALINA_HOME"
                 echo "Using CATALINA_TMPDIR: $CATALINA_TMPDIR"
                if [ "$1" = "debug" -o "$1" = "javac" ] ; then
                    echo "Using JAVA_HOME:       $JAVA_HOME"
                else
                   echo "Using JRE_HOME:       $JRE_HOME"
                fi
               fi
            d以下内容Q?/p>

                CATALINA_OPTS = " $CATALINA_OPTS -Xms256m -Xmx512m -XX:PermSize=32m  -XX:MaxPermSize=128m $JPDA_OPTS "

                JAVA_OPTS
= " $JAVA_OPTS -Djava.awt.headless=true "

                echo 
" Using CATALINA_OPTS: $CATALINA_OPTS "

                echo 
" Using JAVA_OPTS: $JAVA_OPTS "


    4.q行/usr/local/jakarta-tomcat-5.5.30/bin/startup.sh 启动tomcat服务?试是否正常
   
  

四、配|apache代理(适用mod_proxy_ajp.so)
    ~辑apache配置文g #vi /usr/apache/conf/httpd.conf
    1.配置proxy_ajp
 #加蝲解析模块Qwindows下,或linux采用动态加载模式下需配置。前面我们的linux~译时把下面的模块嵌入到了apache?nbsp;

       Q所以不用再加蝲Q?br> LoadModule proxy_module modules/mod_proxy.so
 LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
    2.配置文gd

 ProxyPass  /  balancer: // tomcatcluster/ lbmethod=byrequests stickysession=JSESSIONID nofailover=on timeout=5  maxattempts = 3
 ProxyPassReverse 
/  balancer: // tomcatcluster/

 
< Proxy balancer: // tomcatcluster >
    BalancerMember ajp: // 192.168.40.15:8009 smax=2 loadfactor=1  route=tomca t1
    BalancerMember ajp: // 192.168.71.106:8009 smax=2 loadfactor=2  route=tomc at2
  </ Proxy >

 

        以上说明请参见mod_proxy中文手册 http://www.6bee.com/tech/ApacheMenu/mod/mod_proxy.html
    3.其他说明

 1、apache对tomcat的支持历ԌapacheW?.1版本后,内置了proxy_ajpQ而jk2已经没h开发了Qjk则支持到apache?/p>

2.0.58版本?br>proxy_ajp配置较简单,但可配置性还不如jk2Q主要表现在proxy_ajp目前只支持配|到目录Q还不支持对文g名称的pattern模式?/p>

配(卌不能定义到只对jsp文g起作用)?/p>

 2、因为proxy_ajp的配|,q不支持Ҏ件名U的pattern模式匚wQ所以你要特别注意:
——尽量把jsp和静态文件和囄路径分不同的目录来管理;
——对于静态文件和囄路径Q如/imagesQ你可用“ProxyPass /images !”来禁止ProxyPassQ从而来让apache来直接处理图片的?/p>

求?br>——关于apache的ssiQ即shtmlQincludeQ与tomcat的集成时Qshtml文g不能处于ProxyPass的控制下Q即不能在ProxyPass目录Q?/p>

Q而shtml调用的jspdProxyPass有效控制下;


五、配|Tomcat负蝲均衡、集?br>    1.修改tomcat ?conf/server.xml ?lt;Engine>     
    L注释<Engine name="Standalone" defaultHost="localhost" jvmRoute="tomcat1">
        jvmRoute是tomcat路由标示Q由此区分两台tomcatLQ那么第二台改?br>            <Engine name="Standalone" defaultHost="localhost" jvmRoute="tomcat2">
    加上注释<Engine name="Catalina" defaultHost="localhost">
   
    2.修改tomcat ?conf/server.xml ?lt;Connector> 
    L注释<Connector port="8009"
               enableLookups="false" redirectPort="8443" debug="0"
               protocol="AJP/1.3" />
   

    3.修改tomcat ?conf/server.xml ?lt;Cluster>   

    <!--  
        
< Cluster className = " org.apache.catalina.cluster.tcp.SimpleTcpCluster "
                 managerClassName
= " org.apache.catalina.cluster.session.DeltaManager "
                 expireSessionsOnShutdown
= " false "
                 useDirtyFlag
= " true "
                 notifyListenersOnReplication
= " true " >

            
< Membership 
                className
= " org.apache.catalina.cluster.mcast.McastService "
                mcastAddr
= " 228.0.0.4 "
                mcastPort
= " 45564 "
                mcastFrequency
= " 500 "
                mcastDropTime
= " 3000 " />

            
< Receiver 
                className
= " org.apache.catalina.cluster.tcp.ReplicationListener "
                tcpListenAddress
= " auto "
                tcpListenPort
= " 4001 "
                tcpSelectorTimeout
= " 100 "
                tcpThreadCount
= " 6 " />

            
< Sender
                className
= " org.apache.catalina.cluster.tcp.ReplicationTransmitter "
                replicationMode
= " pooled "
                ackTimeout
= " 5000 " />

            
< Valve className = " org.apache.catalina.cluster.tcp.ReplicationValve "
                   filter
= " .*\.gif;.*\.js;.*\.jpg;.*\.png;.*\.htm;.*\.html;.*\.css;.*\.txt; " />
                   
            
< Deployer className = " org.apache.catalina.cluster.deploy.FarmWarDeployer "
                      tempDir
= " /tmp/war-temp/ "
                      deployDir
= " /tmp/war-deploy/ "
                      watchDir
= " /tmp/war-listen/ "
                      watchEnabled
= " false " />
                      
            
< ClusterListener className = " org.apache.catalina.cluster.session.ClusterSessionListener " />
        
</ Cluster >
        
-->

把上面的注释拿掉 ok 了!

4.在每个webapps应用?修改web.xml文g d元素<distributable/>

最后完工,重启tomcat,apahce试q负蝲Q新建jsp面
<%
Runtime lRuntime = Runtime.getRuntime();
out.println("*** BEGIN MEMORY STATISTICS ***<br/>");
out.println("Free  Memory: "+lRuntime.freeMemory()/1024/1024+"M<br/>");
out.println("Max   Memory: "+lRuntime.maxMemory()/1024/1024+"M<br/>");
out.println("Total Memory: "+lRuntime.totalMemory()/1024/1024+"M<br/>");
out.println("Available Processors : "+lRuntime.availableProcessors()+"<br/>");
out.println("*** END MEMORY STATISTICS ***");
%>
<br>
<%= request.getSession().getId() %>
攑օC台tomcat的ROOT目录中测?br>
再测试集?session复制)



Derek.Guo 2006-11-15 11:06 发表评论
]]>
RedHatl端中文q解决http://www.aygfsteel.com/envoydada/archive/2006/10/12/74758.htmlDerek.GuoDerek.GuoThu, 12 Oct 2006 03:54:00 GMThttp://www.aygfsteel.com/envoydada/archive/2006/10/12/74758.htmlhttp://www.aygfsteel.com/envoydada/comments/74758.htmlhttp://www.aygfsteel.com/envoydada/archive/2006/10/12/74758.html#Feedback0http://www.aygfsteel.com/envoydada/comments/commentRss/74758.htmlhttp://www.aygfsteel.com/envoydada/services/trackbacks/74758.html修改 / etc / sysconfig / i18n文gQ将其改成以下内容:

LANG = " zh_CN.GB18030 "
LANGUAGE = " zh_CN.GB18030:zh_CN.GB2312:zh_CN "
SUPPORTED = " zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en "
SYSFONT = " lat0-sun16 "



Derek.Guo 2006-10-12 11:54 发表评论
]]>
վ֩ģ壺 | ũ| | â| ƽɽ| | | | | | ·| Ȫ| | ҳ| ³ľ| ׸| | | | | ˱| ƽ| ʼ| | | | | | ɽ| | | | | ˮ| °| ³ƶ| | ƽ| ӱ| ǿ| |