在做Glassfish安装之前,补Haproxy的日志输出(前面一篇给忘记了!)
#vim /var/log/haproxy.log (创建Haproxy的日志文件)
#vim /etc/syslog.conf (添加 local3.* /var/log/haproxy.log)
#vim /etc/sysconfig/syslog (把SYSLOGD_OPTIONS="-m 0" 改成 SYSLOGD-OPTIONS="-r -m 0")
重启syslogd: # /etc/init.d/syslog restart
tail -f -n 30 /var/log/haproxy.log (日志输出记录就可以看到了,也可以cat /var/log/haproxy.log查看)
Linux运维之Glassfish安装
一、安装需要的软件:glassfish-3.1-ml.zip和jdk-6u26-linux-x64.bin
1、JDK的安装配置
#cd /robin (进入jdk-6u26-linux-x64.bin的目录下)
#chmod 755 jdk-6u26-linux-x64.bin (修改权限)
#./jdk-6u26-linux-x64.bin (解压编辑)
#echo $PATH (检查PATH内部)
#PATH="/robin/jdk1.6.0_26/bin:$PATH" (将安装的JDK加入到PATH中)
#cd~ :.bash_profile (vim 找到PATH将其改为 PATH=/robin/jdk1.6.0_26/bin:$PATH:$HOME/bin)
OK,JDK安装完成!
2、Glassfish的安装配置
#cd /robin
#unzip glassfish-3.1-ml.zip
#cd /robin/glassfish/bin
#./asadmin start-domain domain1 (如果开有防火墙请关闭,在浏览器中打开http://localhost:4848,就可以打开管理界面)
在管理界面中,找到应用程序,添加一个Hello.war上去;然后在配置--网络配置--协议中添加一个服务,如TEST,在网络侦听器中将TEST的端口变更为81,为Haproxy做侦测端口对应!
最后,做一个Glassfish自启动脚本
#vi /etc/init.d/glassfish3
#!/bin/sh
# chkconfig: - 85 15
# description: glassfish3 is a world wide web server. It is used to server
#chmod 755 /etc/init.d/glassfish3 接着# chkconfig --add glassfish3 最后#chkconfig glassfish3 on (OK,完结!)
export AS_JAVA=/robin/jdk1.6.0_26
GLASSFISHHOME=/robin/glassfish3/glassfish
case "$1" in
start)
${GLASSFISHHOME}/bin/asadmin start-domain domain1
;;
stop)
${GLASSFISHHOME}/bin/asadmin stop-domain domain1
;;
restart)
${GLASSFISHHOME}/bin/asadmin start-domain domain1
${GLASSFISHHOME}/bin/asadmin stop-domain domain1
;;
*)
echo $"usage:$0 {start|stop|restart}"
exit 1
esac