新centos6 静态ip 放行端口 hosts主机名 jdk环境变量
0 jdk 环境变量
vi /etc/profile
source /etc/profile 刷新环境变量
在尾部增加如下代码:
#JDK全局环境变量配置
export JAVA_HOME=/usr/local/jdk/jdk1.7.0_75
export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
1.静态IP
修改下列项的值
vim /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO="static"
IPV6INIT="no"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPADDR="192.168.177.130"
NETMASK="255.255.255.0"
GATEWAY="192.168.177.2" #Wangguan
#NETWORK="192.168.177.0" #Ziwang IP
#BCAST="192.168.177.255"
#BROADCAST="192.168.177.255"
DNS1="114.114.114.114"
如果 service network restart 失败
则依次运行 即可
chkconfig NetWorkManager off
chkconfig network on
service NetworkManager stop
service network start
2.修改network
vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=trsr01
3 放行端口
4 centos6 yum换源
vim /etc/yum.repos.d/CentOS-Base.repo
之后 yum clean all yum makecache
# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-6.10 - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/6.10/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-6.10 - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/6.10/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-6.10 - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/6.10/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-6.10 - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/6.10/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-6.10 - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos-vault/6.10/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos-vault/RPM-GPG-KEY-CentOS-6
5 上传下载工具