本文共 2445 字,大约阅读时间需要 8 分钟。
Ubuntu 安装JDK,mysql,Tomcat
JDK版本:jdk-6u20-linux-i586-rpm.bin
Tomcat版本: apache-tomcat-6.0.29.tar.gz
Mysql版本: mysql-5.1.50-linux-i686-glibc23.tar.gz
下载地址:http://mysql.ntu.edu.tw/Downloads/MySQL-5.1/
一、安装JDK
01.# rpm -qa | grep gcj
02.# rpm -e --nodeps libgcj-4.1.2-46.el5
03.# rpm -e --nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
04.# chmod a+x jdk-6u20-linux-i586-rpm.bin
05.# ./jdk-6u20-linux-i586-rpm.bin
二、安装tomcat
01.# tar -zxvf apache-tomcat-6.0.29.tar.gz
02.# cp -R apache-tomcat-6.0.29 /usr/local/tomcat
03.进入到/usr/local/tomcat/bin目录下
04.启动tomcat服务
# ./startup.sh
停止tomcat服务
#./shutdown.sh
05.测试tomcat
http://127.0.0.1:8080或者http://ip地址:8080
三、安装mysql
01.# tar -zxvf mysql-5.1.50-linux-i686-glibc23.tar.gz
02.# cp -R mysql-5.1.50-linux-i686-glibc23 /usr/local/mysql
03.# groupadd mysql
04.# useradd -g mysql mysql
05.# scripts/mysqld_safe_db --user=mysql
06.# chown -R root .
07.# chown -R mysql data
08.# chgrp -R mysql .
09.进入到/usr/local/mysql/bin目录下,启动mysql服务
# ./mysqld_safe --user=mysql &
10.进入mysql数据库
# ./mysql
四、配置tomcat开机启动
01.进入/usr/local/tomcat/bin目录下
# vi +2 catalina.sh在第二行添加如下3句话
# chkconfig: 2345 63 37
# description:tomcat server init script
CATALINA_HOME=/usr/local/tomcat
如果要修改tomcat内存那就在catalina.sh增加这么一行
java_opts=' -xms1536m-xmx1536m-xx:permsize=64m-xx:maxnewsize=256m-xx:maxpermsize=128m'
02.在cp之前要停止掉tomcat服务
# cp catalina.sh /etc/rc.d/init.d/tomcat
03.进入/etc/rc.d/init.d
# chkconfig --add tomcat
04.# chkconfig --list tomcat
tomcat0:关闭1:关闭2:启用3:启用4:启用5:启用6:关闭
05.service tomcat start启动tomcat服务
service tomcat stop停止tomcat服务
五、配置mysql开机启动
01.进入到/usr/local/mysql目录下
# cp support-files/mysql.server/etc/rc.d/init.d/mysql
02.# cd /etc/rc.d/init.d/
03.# chmod +x mysql
04.# chkconfig mysql on
重新启动计算机
测试tomcat如上
测试mysql:
# /usr/local/mysql/bin/mysql
# /usr/local/mysql/bin/mysql
Welcome to the MySQL monitor.Commands end with ; or /g.
Your MySQL connection id is 1
Server version: 5.1.50 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database|
+--------------------+
| information_schema |
| mysql|
| test|
+--------------------+
3 rows in set (0.05 sec)
mysql>
微信 赏一包辣条吧~
支付宝 赏一听可乐吧~
转载地址:http://lwyhp.baihongyu.com/