CentOS搭建java web运行环境jdk + tomcat

Virtualbox install additionaltools in centos6.8 When i checked the log file mention in the above screen,i see below error.

Creating udev rule for the Guest Additions kernel module. /tmp/vbox.0/Makefile.include.header:97: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop. Creating user for the Guest Additions.

To overcome this error update gcc using

1.yum update gcc

  1. yum update

  2. yum install kernel-uek-devel

*Please note that to execute “yum” your guest vmbox should have internet connection

now after doing all the above I again executed ./VMBoxLinuxAdditions.run

基于 CentOS-6.8-x86_64-minimal

安装SSH:

yum install ssh

启动SSH:

service sshd start

设置开机运行:

chkconfig sshd on

###修改163源 参考http://mirrors.163.com/.help/centos.html

###命令行和桌面方式启动 vi /etc/inittab

id:3:initdefault:

修改 图形界面 id: 5 命令行 id: 3 切换回图形界面

startx

###环境变量

- 方法一(所有用户的shell都有权使用这些环境变量)

/etc/profile 文件后面加上以下代码

export JAVA_HOME=/opt/jdk1.7.0_80
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib

执行

source /etc/profile

立即生效

- 方法二

把上面的代码附加到 /home/xxuser/.bash_profile # 用户目录下.bash_profile文件

###系统编码

修改 /etc/profile

export LANG=en_US.UTF-8
#export LANG=zh_CN.GBK

source /etc/profile 后生效 查看当前系统编码

#env |grep LANG

启动tomcat前 查看8080端口占用情况时 [root@localhost conf]# lsof -i:8080 -bash: lsof: command not found 安装lsof工具

yum install lsof

其他

zip工具默认也是没有的 安装

yum install -y unzip zip

####CentOS ssh超时设置 修改/etc/ssh/sshd_config文件 将ClientAliveInterval对应的0改成60 服务器端向客户端请求消息的时间间隔,默认是0,不发送 表示每分钟发送一次,然后客户端响应,这样就保持长连接了. ClientAliveCountMax,使用默认值3即可. 表示服务器发出请求后客户端没有响应的次数达到一定值,就自动断开. 正常情况下,客户端不会不响应

重新启动 sshd: /etc/rc.d/init.d/sshd restart

相关文章

文章浏览阅读903次。4.清除缓存目录(/var/cache/yum)下的软件...
文章浏览阅读1.5k次。Python 是一种高级解释性编程语言,已被...
文章浏览阅读2.6k次。打开终端或控制台,以root或具有sudo权...
文章浏览阅读744次,点赞24次,收藏26次。目标:通过AppSrv为...
文章浏览阅读1.1w次,点赞8次,收藏26次。chmod命令来自于英...
文章浏览阅读1.2k次。yum源的URL地址,本例中是文件系统的路...