设为首页 收藏本站
查看: 1368|回复: 0

[经验分享] centos6.5_x64 安装配置java+tomcat+apache

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-6-27 17:26:05 | 显示全部楼层 |阅读模式
1.下载:   
# wget http://download.oracle.com/otn-p ... 1-linux-x64-rpm.bin   

2.赋权限:   
[iyunv@rrcy ~]# ls -l jdk-6u31-linux-x64-rpm.bin
-rw-r--r-- 1 root root 81071431 Jun 26 14:00 jdk-6u31-linux-x64-rpm.bin
[iyunv@rrcy ~]# chmod +x jdk-6u31-linux-x64-rpm.bin


3.安装:   
#./jdk-6u31-linux-x64-rpm.bin   


[iyunv@rrcy ~]# ./jdk-6u31-linux-x64-rpm.bin
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
  inflating: jdk-6u31-linux-amd64.rpm  
  inflating: sun-javadb-common-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-core-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-client-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm  
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...
Installing JavaDB
Preparing...                ########################################### [100%]
   1:sun-javadb-common      ########################################### [ 17%]
   2:sun-javadb-core        ########################################### [ 33%]
   3:sun-javadb-client      ########################################### [ 50%]
   4:sun-javadb-demo        ########################################### [ 67%]
   5:sun-javadb-docs        ########################################### [ 83%]
   6:sun-javadb-javadoc     ########################################### [100%]

Java(TM) SE Development Kit 6 successfully installed.

Product Registration is FREE and includes many benefits:
* Notification of new versions, patches, and updates
* Special offers on Oracle products, services and training
* Access to early releases and documentation

Product and system data will be collected. If your configuration
supports a browser, the JDK Product Registration form will
be presented. If you do not register, none of this information
will be saved. You may also register your JDK later by
opening the register.html file (located in the JDK installation
directory) in a browser.

For more information on what data Registration collects and
how it is managed and used, see:
http://java.sun.com/javase/regis ... trationPrivacy.html

Press Enter to continue.....


Done.

3.查看文件指向
[iyunv@rrcy java]# ls -l
total 4
lrwxrwxrwx 1 root root   16 Jun 26 14:02 default -> /usr/java/latest
drwxr-xr-x 9 root root 4096 Jun 26 14:02 jdk1.6.0_31
lrwxrwxrwx 1 root root   21 Jun 26 14:02 latest -> /usr/java/jdk1.6.0_31


4.设置java环境:/etc/profile.d/在最后添加如下内容,然后上传   
root@rrcy tomcat]# vim /etc/profile.d/java.sh
export JAVA_HOME=/usr/java/jdk1.6.0_31
export PATH=$PATH:$JAVA_HOME/bin

5.执行环境变量:
[iyunv@rrcy java]# . /etc/profile.d/java.sh

6.查看版本:
[iyunv@rrcy java]# java -version
java version "1.5.0"
gij (GNU libgcj) version 4.4.7 20120313 (Red Hat 4.4.7-4)

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


7.是否成功安装JDK验证:
# java   
Usage: java [-options] class [args...]   
           (to execute a class)   
   or  java [-options] -jar jarfile [args...]   
           (to execute a jar file)   

where options include:   
    -d32          use a 32-bit data model if available   

    -d64          use a 64-bit data model if available   
    -server       to select the "server" VM  


二、安装配置tomcat+apache

1.下载安装包
apache-tomcat-7.0.54.tar.gz
2.解压安装包
tar -xf apache-tomcat-7.0.54.tar.gz -C /usr/local
3.创建tomcat连接
cd /usr/local
ln -sv apache-tomcat-7.0.54 tomcat
4.查看连接是否成功
[iyunv@rrcy local]# ll
lrwxrwxrwx   1 root root      20 Jun 26 12:56 tomcat -> apache-tomcat-7.0.54

5.创建tomcat环境变量文件
[iyunv@rrcy ~]# vim /etc/profile.d/tomcat.sh
export CATALINA_HOME=/usr/local/tomcat
export PATH=$PATH:$CATALINA_HOME/bin

6.运行环境变量

[iyunv@rrcy ~]# . /etc/profile.d/tomcat.sh

[iyunv@rrcy tomcat]# catalina.sh version
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.54
Server built:   May 19 2014 10:26:15
Server number:  7.0.54.0
OS Name:        Linux
OS Version:     2.6.32-431.17.1.el6.x86_64
Architecture:   x86_64
JVM Version:    1.5.0
JVM Vendor:     Free Software Foundation, Inc.
[iyunv@rrcy tomcat]#

7.开起tomcat服务
[iyunv@rrcy tomcat]# catalina.sh start

8.查看8080 8009 端口
[iyunv@rrcy init.d]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 192.168.1.208:53            0.0.0.0:*                   LISTEN      10603/named         
tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      10603/named         
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      897/sshd            
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      10603/named         
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1182/master         
tcp        0      0 127.0.0.1:6010              0.0.0.0:*                   LISTEN      11219/sshd         
tcp        0      0 127.0.0.1:6011              0.0.0.0:*                   LISTEN      11656/sshd         
tcp        0      0 127.0.0.1:9000              0.0.0.0:*                   LISTEN      1193/php-fpm        
tcp        0      0 127.0.0.1:3306              0.0.0.0:*                   LISTEN      1090/mysqld         
tcp        0      0 :::8080                     :::*                        LISTEN      12338/java         
tcp        0      0 :::80                       :::*                        LISTEN      2753/httpd         
tcp        0      0 :::22                       :::*                        LISTEN      897/sshd            
tcp        0      0 ::1:25                      :::*                        LISTEN      1182/master         
tcp        0      0 ::1:6010                    :::*                        LISTEN      11219/sshd         
tcp        0      0 ::1:6011                    :::*                        LISTEN      11656/sshd         
tcp        0      0 ::ffff:127.0.0.1:8005       :::*                        LISTEN      12087/java         
tcp        0      0 :::8009                     :::*                        LISTEN      12338/java  

9.创建启动服务

[iyunv@rrcy conf]# vim /etc/init.d/tomcat
JAVA_HOME=/usr/java/latest
CATALINA_HOME=/usr/local/tomcat
export JAVA_HOME CATALINA_HOME
exec $CATALINA_HOME/bin/catalina.sh $*

[iyunv@rrcy conf]# chmod +x /etc/init.d/tomcat

[iyunv@rrcy conf]# service tomcat start
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/java/latest
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.

11. IE访问  http://ip:8080



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-21223-1-1.html 上篇帖子: the tomcat installation directory is not valid. It is missing excepted file o... 下篇帖子: Tomcat报内存溢出 java
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表