CentOS 6.3 服务器安装配置

1.下载CentOS并安装

CentOS-6.3-x86_64-minimal.iso

http://centos.arcticnetwork.ca/6.3/isos/x86_64/CentOS-6.3-x86_64-minimal.iso

2.IP配置

vi /etc/sysconfig/network-scripts/ifcfg-em1
DEVICE="em1"
BOOTPROTO="static"
HWADDR="***"
NM_CONTROLLED="yes"
IPADDR=192.168.1.80
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
BROADCAST=192.168.1.255
DNS1=211.98.2.4
DNS2=211.98.4.1
ONBOOT="yes"
TYPE="Ethernet"
UUID="***"

3.DevelopmentLibrariesAndDevelopmentTools

shell执行以下两条命令:

yum groupinstall "Development Libraries"

yum groupinstall "Development Tools"

4.下载、安装JDK

-我选择的版本是jdk-6u37-linux-x64.bin

http://download.oracle.com/otn-pub/java/jdk/6u37-b06/jdk-6u37-linux-x64.bin?AuthParam=1354695286_79ec0310b842ca7a97de733469f45b99

-下载后拷贝到/usr/local目录下(不是非得这个目录)

-修改权限

[root@gateway local]# ls -l jdk-6u37-linux-x64.bin 
-rw-r--r--. 1 root root 72048548 12月  5 16:20 jdk-6u37-linux-x64.bin
[root@gateway local]# chmod 777 jdk-6u37-linux-x64.bin 
[root@gateway local]# ls -l jdk-6u37-linux-x64.bin 
-rwxrwxrwx. 1 root root 72048548 12月  5 16:20 jdk-6u37-linux-x64.bin
[root@gateway local]#

-安装

[root@gateway local]# ./jdk-6u37-linux-x64.bin

可以看到多了jdk的目录了

[root@gateway local]# ls
bin  etc  games  include  jdk1.6.0_37  jdk-6u37-linux-x64.bin  lib  lib64  libexec  sbin  share  src

-配置

[root@gateway ~]# vi /etc/profile

在export命令之前添加JDK的配置信息

export JAVA_HOME=/usr/local/jdk1.6.0_37
export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar 
export PATH=$PATH:$JAVA_HOME/bin

执行以下命令使改动生效:

[root@gateway ~]# source /etc/profile

验证一下:

[root@gateway ~]# java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)

5.开启指定端口:

iptables -I INPUT -i em1 -p tcp --dport 10001 -j ACCEPT
iptables  -I OUTPUT -o em1 -p tcp --sport 10001 -j ACCEPT
/etc/rc.d/init.d/iptables save

相关推荐