JRE+MYSQL+JETTY安装部署
<Alvin-zeng.孤独0-1>
目录
3.3、将WEB 目录打成war 包,放入/jetty/etc/webapps/4
一、JRE安装
1.1、下载软件
http://www.oracle.com/technetwork/java/javase/downloads/jre-6u26-download-400751.html
1.2、加执行权限,然后解压
#: chmod +x jre-6u25-linux-x64.bin
#: ./jre-6u25-linux-x64.bin
1.3、移动解压,将目录移动到java目录下面
#: mv jre1.6.0_25 /opt/web/java/
#:vim /etc/profile
export JAVA_HOME=/opt/web/java/jre1.6.0_25/
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$PATH
#:source /etc/profile
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
二、Mysql5.5安装
2.1、下载安装Cmake
http://wwwNaNake.org/files/v2.8/cmake-2.8.4.tar.gz
2.2、解压缩及安装CMAKE
#: tar -xvf cmake-2.8.4.tar.gz
#: cd cmake-2.8.40
#: ./configure && make && make install
2.3、安装MYSQL
#: tar -xvf mysql-5.5.11.tar.gz
#: cd mysql-5.5.11
#:make && make install
2.4、创建用户 及初始化数据库
#:useradd mysql
#: mkdir -p /data/mysql/
#: chown -R mysql:mysql /data/mysql
#:cd /usr/local/mysql/scripts
#:./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/
#:cp /usr/local/mysql/bin/mysql /usr/bin/
#:cp /usr/local/mysql/bin/mysqladmin /usr/bin/
#: chmod 755 /usr/bin/mysql
#: chmod 755 /usr/bin/mysqladmin
#: cp support-files/my-medium.cnf /etc/my.cnf
#:cp support-files/mysql.server /etc/init.d/mysql
#: chmod 755 /etc/init.d/mysql
#: /etc/init.d/mysql start
三、安装jetty
3.1、下载软件,解压。无需安装
#: tar –xvf jetty-hightide-7.4.1.v20110513.tar.gz
3.2、修改8080为80端口
#: mv jetty-hightide-7.4.1.v20110513jetty
#: cd jetty
#:vim etc/jetty.xml
<Set name="port"><Property name="jetty.port" default="80"/></Set>
#: rm –rf /etc/jetty/webapps/*
#: rm –rf /etc/jetty/contexts/*
#: cd /etc/jetty/contexts/my.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure id='wac' class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/hr</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/hr</Set>
<Set name="securityHandler">
<New class="org.eclipse.jetty.security.ConstraintSecurityHandler">
<Set name="loginService">
<New class="org.eclipse.jetty.plus.jaas.JAASLoginService">
<Set name="name">Test JAAS Realm</Set>
<Set name="loginModuleName">xyz</Set>
</New>
</Set>
</New>
</Set>
</Configure>
3.3、将WEB 目录打成war 包,放入/jetty/etc/webapps/
#: jar –cvf web.war web/*
#: mv web.war /etc/jetty/webapps/
#:cd /etc/jetty/webapps/
#: jar –xvf web.war
#: rm web.war
3.4、启动JETTY
#:cd /jetty/
#:java –jar start.jar &
转载于:https://blog.51cto.com/2999835/1260923