- 作者:xiaoxiao
- 发表时间:2020-12-23 10:53
- 来源:未知
将j2sdk-1_4_2_05-linux-i586-rpm.bin放到/home/liufei目录下(任意目录均可,以此为例)cd /home/liufeichmod +x j2sdk-1_4_2_05-linux-i586-rpm.bin./j2sdk-1_4_2_05-linux-i586-rpm.bin将产生j2sdk-1_4_2_05-linux-i586.rpmrpm -hiv j2sdk-1_4_2_05-linux-i586.rpm则java即被安装到/usr/java/j2sdk1.4.2_05ln -s j2sdk1.4.2_05/ jdkvi /etc/profile (如果不想让所有用户都可使用JDK,则编辑目标用户的.bash_profile文件)在export PATH USER LOGNAME ...之前加入JAVA_HOME=/usr/java/jdkPATH=$PATH:$JAVA_HOME/binCLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib并将此行加入JAVA_HOME:export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME CLASSPATHTOMCAT:tar xvfz jakarta-tomcat-4.1.30.tar.gzmv jakarta-tomcat-4.1.30 /usr/localln -s jakarta-tomcat-4.1.30 tomcatuseradd tomcatchown -R tomcat:tomcat /usr/local/jakarta-tomcat-4.1.30chown -R tomcat:tomcat /usr/local/tomcatvi /etc/profile JAVA_HOME=/usr/java/jdkPATH=$PATH:$JAVA_HOME/binCLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/libCATALINA_HOME=/usr/local/tomcatCATALINA_BASE=/usr/local/tomcat
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME CLASSPATH CATALINA_HOME CATALINA_BASE进入/usr/local/tomcat/bin 启动tomcat:su - tomcat -c "./startup.sh" 通过浏览器 http://127.0.0.1:8080通过命令:ps -ax | grep "tomcat"
自动启动:vi /etc/rc.local:#start add by liufei
JAVA_HOME=/usr/java/jdkJRE_HOME=$JAVA_HOME/jreCATALINA_HOME=/usr/local/tomcatCATALINA_BASE=/usr/local/tomcatCLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/libPATH="/usr/kerberos/sbin:/usr/kerberos/bin:/usr/bin:/bin:/usr/X11R6/bin":$CATALINA_HOME/bin:$JAVA_HOME/bin:$JAVA_HOME/jre/binexport JAVA_HOME JRE_HOME CATALINA_HOME CATALINA_BASE CLASSPATH PATHsu - tomcat -c "$CATALINA_HOME/bin/startup.sh"
#end add by liufei
编辑/usr/local/tomcat/conf/tomcat-users.xml加入manager,admin用户组和admin用户<?xml version='1.0' encoding='utf-8'?><tomcat-users> <role rolename="tomcat"/> <role rolename="role1"/> <role rolename="manager"/> <role rolename="admin"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="role1" password="tomcat" roles="role1"/> <user username="both" password="tomcat" roles="tomcat,role1"/>