您的位置:首页 > 运维架构 > Tomcat

linux tomcat jdk mysql 免安装 绿色版整合

2012-10-24 21:35 766 查看
jdk 下载解压:

1.到http://www.oracle.com/technetwork/java/javase/downloads/index.html下载JDK 6 的linux版本jdk-6u22-linux-i586(自解压文件)

2.执行: ./jdk-6u14-linux-i586.bin 进行解压,解压后的文件目录名(示例)jdk1.6.0_22

tomcat下载解压

1.到http://tomcat.apache.org/下载tomcat的linux版本6.0.20,文件名(示例):apache-tomcat-6.0.20.tar.gz

2.到下载的文件所在的目录下,执行:tar -zxvf apache-tomcat-6.0.29.tar.gz,解压后的文件目录名为apache-tomcat-6.0.29

3.将解压好的文件夹拷贝到/usr/share/目录下,示例:mv apache-tomcat-6.0.29 /usr/share

4: 将jdk移动至/usr/share 或者tomcat目录下在此移动到tomcat目录下,为了下次不需要在作更改

mv jdk1.6.0_22 /usr/share/apache-tomcat-6.0.29

5:更改tomcat/bin目录下的startup.sh和shutdown.sh文件 加入红色的2句话,jdk的路径根据你实际的jdk路径来配置

vim startup.sh

#!/bin/sh

# Licensed to the Apache Software Foundation (ASF) under one or more

# contributor license agreements. See the NOTICE file distributed with

# this work for additional information regarding copyright ownership.

# The ASF licenses this file to You under the Apache License, Version 2.0

# (the "License"); you may not use this file except in compliance with

# the License. You may obtain a copy of the License at

#

# http://www.apache.org/licenses/LICENSE-2.0
#

# Unless required by applicable law or agreed to in writing, software

# distributed under the License is distributed on an "AS IS" BASIS,

# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

# See the License for the specific language governing permissions and

# limitations under the License.

# -----------------------------------------------------------------------------

# Start Script for the CATALINA Server

#

# $Id: startup.sh 562770 2007-08-04 22:13:58Z markt $

# -----------------------------------------------------------------------------

export JAVA_HOME=/usr/share/apache-tomcat-6.0.29/jdk1.6.0_22

export JRE_HOME=/usr/share/apache-tomcat-6.0.29/jdk1.6.0_22/jre

# Better OS/400 detection: see Bugzilla 31132

os400=false

darwin=false

case "`uname`" in

CYGWIN*) cygwin=true;;

OS400*) os400=true;;

Darwin*) darwin=true;;

esac

# resolve links - $0 may be a softlink

PRG="$0"

while [ -h "$PRG" ] ; do

ls=`ls -ld "$PRG"`

link=`expr "$ls" : '.*-> \(.*\)$'`

if expr "$link" : '/.*' > /dev/null; then

PRG="$link"

else

PRG=`dirname "$PRG"`/"$link"

fi

done

21,1 顶端

6:.进入/usr/share/apache-tomcat-6.0.29/bin目录,执行:./startup.sh 看启动是否正常 ,正常启动出现如下信息

Using CATALINA_BASE: /usr/share/apache-tomcat-6.0.29

Using CATALINA_HOME: /usr/share/apache-tomcat-6.0.29

Using CATALINA_TMPDIR: /usr/share/apache-tomcat-6.0.29/temp

Using JRE_HOME: /usr/share/apache-tomcat-6.0.29/jdk1.6.0_22/jre

Using CLASSPATH: /usr/share/apache-tomcat-6.0.29/bin/bootstrap.jar

7.在浏览器内访问:http://localhost:8080/看能否出现tomcat的默认页面(tomcat默认配置端口是8080)

mysql 下载加压配置:
ftp://gd.tuwien.ac.at/db/mysql/Downloads/MySQL-5.1/mysql-5.1.51-linux-i686-glibc23.tar.gz
修改Mysql编码

default-character-set=utf8

到mysql/bin目录下

#mysql //运行mysql 命令

如果没有启动,或者出现 Can't connect to local MySQL server through socket 'tmp/mysql.sock'

解决方法: #cd /mysql/support-files //进入Mysql的 support-files目录

#./mysql.server start //启动即可。该操作即可生成/tmp/mysql.sock
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: