posts - 36, comments - 30, trackbacks - 0, articles - 3

centOS上安装JDK,Tomcat和Nginx

Posted on 2016-02-19 19:43 笑看人生 阅读(283) 评论(0)  编辑  收藏
@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);
在CentOS上安装JDK7,Tomcat7和Nginx1.9手顺

1.下载 jdk-7u79-linux-x64.rpm,下载地址如下:
  http://www.oracle.com/technetwork/cn/java/javase/downloads/jdk7-downloads-1880260.html

  [root@localhost java]#rpm -qa | grep jdk
  [root@localhost java]#cp /home/huangwei/Downloads/jdk-7u79-linux-x64.rpm .
  [root@localhost java]# chmod 755 jdk-7u79-linux-x64.rpm 
  [root@localhost java]# rpm -ivh jdk-7u79-linux-x64.rpm 
  [root@localhost java]# vi /etc/profile

       #set java enviromet
       JAVA_HOME=/usr/java/jdk1.7.0_79
       PATH=$PATH:$JAVA_HOME/bin
       CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
       export JAVA_HOME PATH CLASSPATH
  [root@localhost java]# source /etc/profile
  [root@localhost java]# java -version
       java version "1.7.0_79"
       Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
       Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
  [root@localhost lib]# rpm -qa | grep jdk
       jdk-1.7.0_79-fcs.x86_64



2.下载 apache-tomcat-7.0.68.zip,下载地址如下:
  http://tomcat.apache.org/download-70.cgi
  unzip apache-tomcat-7.0.68.zip to /usr/
  [root@localhost bin]# cd /usr/apache-tomcat-7.0.68/bin
  [root@localhost bin]# chmod +x *.sh
  [root@localhost bin]# ./startup.sh 
Using CATALINA_BASE:   /usr/apache-tomcat-7.0.68
Using CATALINA_HOME:   /usr/apache-tomcat-7.0.68
Using CATALINA_TMPDIR: /usr/apache-tomcat-7.0.68/temp
Using JRE_HOME:        /usr/java/jdk1.7.0_79
Using CLASSPATH:       /usr/apache-tomcat-7.0.68/bin/bootstrap.jar:/usr/apache-tomcat-7.0.68/bin/tomcat-juli.jar
Tomcat started.

  在浏览器中输入http://localhost:8080/ ,如果能正常打开Tomcat的主页,说明Tomcat安装成功。

3.下载 nginx-1.9.11.tar.gz,下载地址如下:
  http://nginx.org/en/download.html
  [root@localhost usr]# rpm -qa | grep gcc
gcc-4.4.7-16.el6.x86_64
libgcc-4.4.7-16.el6.x86_64
  [root@localhost usr]# rpm -qa | grep openssl
openssl-1.0.1e-42.el6.x86_64
  [root@localhost usr]# rpm -qa | grep zlib
zlib-1.2.3-29.el6.x86_64
  [root@localhost usr]# rpm -qa | grep pcre
pcre-7.8-7.el6.x86_64
  [root@localhost usr]# tar -zxvf nginx-1.9.11.tar.gz 
  [root@localhost usr]# cd nginx-1.9.11/
  [root@localhost nginx-1.9.11]# yum -y install pcre-devel
  [root@localhost nginx-1.9.11]# yum -y install zlib-devel
  [root@localhost nginx-1.9.11]# ./configure --prefix=/usr/nginx
  [root@localhost nginx-1.9.11]# make && make install
  [root@localhost nginx-1.9.11]# cd /usr/nginx/sbin/
  [root@localhost sbin]# ./nginx -t
nginx: the configuration file /usr/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/nginx/conf/nginx.conf test is successful
  [root@localhost sbin]# ./nginx

  
在浏览器中输入http://localhost/ ,如果能正常打开Nginx的主页,说明Nginx安装成功。
@import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

只有注册用户登录后才能发表评论。


网站导航: