Groups
Groups
Sign in
Groups
Groups
嵌入式linux
Conversations
About
Send feedback
Help
Linux系统攻略:Apache与Tomcat整合技巧(cpu 占有率高)
15 views
Skip to first unread message
stan8688
unread,
Dec 3, 2007, 8:30:52 PM
12/3/07
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to 嵌入式linux
Linux系统攻略:Apache与Tomcat整合技巧
发布时间:2007.12.04 06:18 来源:赛迪网 作者:sixth
监控CPU平均值,SSH到Linux服务器后,键入uptime可以分别显示1分钟前、5分钟前、10分钟前CPU的使用率,该数值越接近0越好。
监控内存与交换分区使用率,SSH到Linux服务器后,键入free -m可以显示内存及交换分区使用率,如果内存使用率超过90%且交换空间占用率
超过50%,证明系统有问题。(至少有内存泄露现象)
监控硬盘使用率,SSH到Linux服务器后,键入df -h可以人性化查看硬盘使用率,超过90%需要及时清理无用资料及日志
监控CPU及各进程CPU与内存占用率,SSH到Linux服务器后,键入top -cs可以按照CPU与内存使用率查看详细进程占用资源的分配
监控Apahce连接数,SSH到Linux服务器后,键入ps -ef | grep httpd | wc -l可以查看当时的Apache,这个
要根据Apache连接数设定看,如果超过设定80%,证明不稳定。
PostFix处理办法
运行状况 tail -f /var/log/maillog 查看postfix邮件服务器运行情况.
启动PostFix
service httpd start
service mysqld start
service postfix start
service courier-authlib start
service dovecot start
service spamassassin start
service MailScanner start
service saslauthd start
启动邮件服务所需的相关服务
重启PostFix
service httpd start
postfix restart
不重启服务器,只重启POSTFIX
Tomcat处理办法,Tomcat日志在其安装目录下的logs文件夹里,可以查看Tomcat日志查询问题所在。
关闭Tomcat进程,在Tomcat安装目录下的bin目录中键入. /shutdown.sh & kill -9 $(ps -ef |
grep java | awk '{print $2}') 可以杀死所有Tomcat进程,然后再键入./startup.sh即可重新启动
Tomcat
Apache与Tomcat整合
1、将jakarta-tomcat-connectors-1.2.15-src.tar.gz传到服务器并解压得到jakarta-tomcat-
connectors-1.2.15-src
2、到jakarta-tomcat-connectors-1.2.15-src/jk/native目录下
[root@localhost native]# ./configure --with-apxs=/usr/sbin/apxs
[root@localhost native]# make
[root@localhost native]# su -c 'make install'
mod_jk2.so被自动拷贝到目录/usr/lib/httpd/modules/mod_jk.so下
3、让apache加载mod_jk
[root@localhost conf]# vi /etc/httpd/conf/httpd.conf
加入如下代码
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule jk_module modules/mod_jk.so
JkWorkersFile /etc/httpd/conf/workers.properties
# Static files in the examples webapp are served by apache
Alias / /home/cviepanel/java/jakarta-tomcat-5.0.28/webapps/
4、在/etc/httpd/conf中加入文件workers.properties
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=8009
worker.worker1.lbfactor=1
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.reclycle_timeout=300
Reply all
Reply to author
Forward
0 new messages