Install jdk1.6 rpm under linux
1. Download the jdk rpm package jdk-6u11-linux-i586-rpm.bin from the sun website;
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u24-oth-JPR@CDS-CDS_Developer
2 , Create a java directory under /usr, and copy jdk-6u11-linux-i586-rpm.bin to the java directory;
3. Add execution authority to jdk-6u11-linux-i586-rpm.bin,
command: chmod a+ x jdk-6u11-linux-i586-rpm.bin
4. Execute: ./jdk-6u11-linux-i586-rpm.bin
5. Wait;
6. At this point, the installation is successful, set the environment variables;
7. Set the global linux Environment variables require root privileges, you can enter su on the command line to switch to the root user;
8. Modify the etc/profile file and add the following code at the end (including the following tomcat):
#set java environment
JAVA_HOME=/usr/java/jdk1.6.0_11
PATH=$PATH:$JAVA_HOME/bin
#By the way, the configuration path of tomcat is also written. Note that colons are used between paths under Linux, not semicolons like Win.
TOMCAT_HOME=/usr/tomcat
CATALINA_HOME=$TOMCAT_HOME
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH:$CATALINA_HOME/lib
PATH=$TOMCAT_HOME/bin:$PATH:$CATALINA_HOME/bin
export JAVA_HOME PATH CLASSPATH TOMCAT_HOME CATALINA_HOME
Install jdk1.7 tar.gz under linux
tar.gz is the version that can be used after decompression. Here we decompress jdk-7u3-linux-i586.tar.gz to /usr/local/.
1. Unzip
Extract to the current directory: $ tar -zxvf /opt/setup/jdk-7-ea-bin-b145-linux-i586-07_jun_2011.tar.gz
2. Environment configuration
① $sudo vi /etc/profile
② Add at the end of the line
#set java environment
JAVA_HOME=/usr/local/jdk1.7.0
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
save and exit
③$ source /etc/profile to make the changed configuration take effect immediately (or reconnect to the server)
④$ java -version View JDK version information, if it shows 1.7.0, it proves successful
⑤ Make the JDK available to all users
$ Vi /etc/profile.d/java.sh Create a new java.sh executable file and fill in the JDK related environment configuration information, as shown below:
$ chmod 755 /etc/profile.d/java.sh to assign permissions to java.sh
linux 下安装tomcat6
1、到apache网站下载tomcat文件 apache-tomcat-6.0.26.tar.gz;
2、在/usr目录下建立tomcat目录;
3、解压apache-tomcat-6.0.26.tar.gz 文件,
命令 tar -xvzf apache-tomcat-6.0.26.tar.gz
4、如果需要使用manager功能,需修改Tomcat_HOME/conf/tomcat-users.xml 文件,加入
<role rolename="manager"/>
<user username="admin" password="admin" roles="manager"/>
5、启动tomcat,命令行方式改变到安装目录,运行
./catalina.sh run 命令 启动tomcat 有控制台
./catalina.sh start 命令 启动tomcat 无控制台
./startup.sh 启动tomcat 无控制台
正常情况下可以见到如下的信息:
Using CATALINA_BASE: /usr/tomcat
Using CATALINA_HOME: /usr/tomcat
Using CATALINA_TMPDIR: /usr/tomcat/temp
Using JRE_HOME: /usr/java/jdk1.6.0_11/jre
Using CLASSPATH: /usr/tomcat/bin/bootstrap.jar
6、关闭tomcat,执行
./shutdown.sh 或者 ./catalina.sh stop
7、测试tomcat安装是否成功
http://localhost:8080