快速业务通道

LINUX下用脚本实现JDK TOMCAT

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-05-04

这几天真是累.常常下半夜3点睡觉.是这段时间对LINUX下的SHELL编程喜欢上了.

一时弄的忘了睡觉.还好,累没白累.遍写了一个JDK TOMCAT的自动安装,配置的脚本

在这里我把配置出来的成果拿来和大家分享一下.希望有高手来指定一下,我在编程中的不足之处.

我将十分的感谢~~!

touch service.sh

chmod a x service.sh


#!/bin/bash
#this is jdk tomcat of server allocation

touch /home/aaaaa

jk="/home/aaaaa"

echo "#!/bin/bash


service vsftpd stop

" >$jk

chmod a x $jk

cd /home

./aaaaa
rm -rf /home/aaaaa

echo "select ''N'' is withdraws from ;
select ''Y'' Will be able to carry out JDK TOMCAT server allocation .
if select ''Y'' You need to wait for several minutes ,
If you do not want to wait to invite note CTRL C, the key withdraws from"

echo -n "select Y or N:"


read NAME

if [ "$NAME" == "N" ]


then

echo "select ''N'' is exit"

else

find / -name jakarta-tomcat-5.0.28.tar.gz > /aaa


tar -zxvf `cat /aaa`

mkdir /opt/tomcat

find / -name jakarta-tomcat-5.0.28 > /la


echo "Torture fatigued jakarta-tomcat-5.0.28/ in course of waiting for one meeting to opt/tomcat/, please"


cp -r `cat /la`/* /opt/tomcat


find / -name j2sdk-1.4.2-03-linux-i586.bin > /aaa


chmod a x `cat /aaa`

cp `cat /aaa` /
cd /

./j2sdk-1.4.2-03-linux-i586.bin

rm -rf /aaa
mkdir /usr/jdk

cp -r /j2sdk1.4.2/* /usr/jdk

Empire CMS,phome.net

rm -rf /j2sdk1.4.2 /j2sdk-1.4.2-03-linux-i586.bin

mv /etc/profile /etc/zuan

sed ''s/export/& JAVA_HOME CLASS_PASS TOMCAT_HOME /'' /etc/zuan>/etc/yirehe

sed ''/local/a pathmunge /usr/jdk/bin'' /etc/yirehe>/etc/ewang

sed ''/LOGNAME=$USER/aCLASS_PATH="/usr/jdk/lib/tools.jar" JAVA_HOME="/usr/jdk/" TOMCAT_HOME="/opt/tomcat/"'' /etc/ewang>/etc/profile

rm -rf /etc/zuan /etc/yirehe /etc/ewang

mv /opt/tomcat/conf/tomcat-users.xml /opt/tomcat/conf/bdyd

sed ''7d'' /opt/tomcat/conf/bdyd>/opt/tomcat/conf/yileng

sed ''9d'' /opt/tomcat/conf/yileng>/opt/tomcat/conf/bdyda

echo "<user name="aaa" password="aaa" roles="yirehe" />" >> /opt/tomcat/conf/bdyda

echo "</tomcat-users>" >> /opt/tomcat/conf/bdyda

sed ''s/aaa/"admin"/g'' /opt/tomcat/conf/bdyda> /opt/tomcat/conf/kaka

sed ''s/yirehe/"admin,manager"/g'' /opt/tomcat/conf/kaka> /opt/tomcat/conf/tomcat-users.xml

rm -rf /opt/tomcat/conf/bdyd /opt/tomcat/conf/yileng /opt/tomcat/conf/bdyda /opt/tomcat/conf/kaka


mv /opt/tomcat/conf/server.xml /opt/tomcat/conf/aaa

sed ''s/Connector port="8080"/Connector port="80"/'' /opt/tomcat/conf/aaa>/opt/tomcat/conf/djdk

sed ''s/Connector port="8443"/Connector port="443"/'' /opt/tomcat/conf/djdk>/opt/tomcat/conf/server.xml

rm -rf /opt/tomcat/conf/djdk /opt/tomcat/conf/aaa

mv /opt/tomcat/conf/server.xml /opt/tomcat/conf/aaa

sed ''s/Connector port="8080"/Connector port="80"/'' /opt/tomcat/conf/aaa>/opt/tomcat/conf/djdk

sed ''s/Connector port="8443"/Connector port="443"/'' /opt/tomcat/conf/dj

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号