标签:stc creat 防火墙 tor idg his com 使用 /var
以下使用 linux centos系统
1、下载jdk-8u111-linux-x64.tar.gz
2、解压该文件,将解压后的文件复制到 /usr/local/jdk1.7 目录下。如图:
在这里 jdk1.7 目录就是我解压后的文件内容。
3、配置环境变量
进入etc目录下编辑profile文件
文件内容:
# /etc/profile # System wide environment and startup programs, for login setup # Functions and aliases go in /etc/bashrc # It‘s NOT a good idea to change this file unless you know what you # are doing. It‘s much better to create a custom.sh shell script in # /etc/profile.d/ to make custom changes to your environment, as this # will prevent the need for merging in future updates. pathmunge () { case ":${PATH}:" in *:"$1":*) ;; *) if [ "$2" = "after" ] ; then PATH=$PATH:$1 else PATH=$1:$PATH fi esac } if [ -x /usr/bin/id ]; then if [ -z "$EUID" ]; then # ksh workaround EUID=`id -u` UID=`id -ru` fi USER="`id -un`" LOGNAME=$USER MAIL="/var/spool/mail/$USER" fi # Path manipulation if [ "$EUID" = "0" ]; then pathmunge /usr/sbin pathmunge /usr/local/sbin else pathmunge /usr/local/sbin after pathmunge /usr/sbin after fi HOSTNAME=`/usr/bin/hostname 2>/dev/null` HISTSIZE=1000 if [ "$HISTCONTROL" = "ignorespace" ] ; then export HISTCONTROL=ignoreboth else export HISTCONTROL=ignoredups fi export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL # By default, we want umask to get set. This sets it for login shell # Current threshold for system reserved uid/gids is 200 # You could check uidgid reservation validity in # /usr/share/doc/setup-*/uidgid file if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then umask 002 else umask 022 fi for i in /etc/profile.d/*.sh ; do if [ -r "$i" ]; then if [ "${-#*i}" != "$-" ]; then . "$i" else . "$i" >/dev/null fi fi done unset i unset -f pathmunge
添加关于JDK环境变量的配置:在该文件末尾添加下面代码
JAVA_HOME="/usr/local/jdk1.7" CLASS_PATH="$JAVA_HOME/lib:$JAVA_HOME/jre/lib" PATH=".:$PATH:$JAVA_HOME/bin"
export JAVA_HOME
4、测试是否安装成功
a、让更改后的文件立即生效 ; 执行命令: source /etc/profile
b、输入命令 java -version 结果如图:
1、下载tomcat apache-tomcat-7.0.70.tar.gz
2、将解压后的文件移动到 /usr/local/tomcat1.7 如图:
3、配置环境变量
在/etc/profile 文件末尾添加如下内容
CATALINA_HOME="/usr/local/tomcat1.7" export CATALINA_HOME
4、测试tomcat是否安装成功
a、让更改后的文件立即生效 ; 执行命令: source /etc/profile
b、进入tomcat bin目录下执行命令 ./startup.sh
c、访问 127.0.0.1:8080 看是否出现tomcat主页
一般情况下JDK与tomcat的环境变量我们会写在一起 在/etc/profile 文件末尾添加如下内容
JAVA_HOME="/usr/local/jdk1.7" CLASS_PATH="$JAVA_HOME/lib:$JAVA_HOME/jre/lib" PATH=".:$PATH:$JAVA_HOME/bin" CATALINA_HOME="/usr/local/tomcat1.7" export JAVA_HOME CATALINA_HOME
Centos 7使用firewalld代替了原来的iptables。下面记录如何使用firewalld开放Linux端口:
标签:stc creat 防火墙 tor idg his com 使用 /var
原文地址:http://www.cnblogs.com/jalja/p/6117048.html