Oracle Linux是Linux发行版本之一,全称为Oracle Enterprise Linux,简称OEL,以对Oracle软件和硬件支持较好见长。
Oracle以Red Hat Linux做为起始,移除了Red Hat的商标,然后加入了Linux的错误修正。Oracle Enterprise Linux旨在保持与Red Hat Enterprise Linux完全兼容。
Oracle Enterprise Linux发布新版内核——Unbreakable Enterprise Kernel,专门针对Oracle软件与硬件进行优化,最重要的是Oracle数据库跑在OEL上性能可以提升超过75%。
下载Oracle Linux6.9的系统镜像:https://pan.baidu.com/s/1llcvEU3WypIRThIYKpbimA
选择第一项,按回车键:
注释:语言环境选中文(简体),系统安装好后,可以更改为英文。
键盘选择 美国英语式
设置主机名和配置网络:
默认是 自动(DHCP)
配置时区:(亚洲/上海)
自定义root的密码 (至少6个字符)
默认分区的效果:(其实安装系统仅需要提供一个根分区和一个交换分区;如果保留home分区,则可以限制home分区的大小,如不保留,则不可以限制home分区的大小)
Minimal (最小化安装)
系统安装完成,服务器本地登录:
查看IP地址:
软件SecureCRT的下载链接:https://pan.baidu.com/s/1-l9bwy4o3gRBUsugw9Jz1w
使用SecureCRT进行远程连接:
设置字体和字符编码:
查看主机名:
[root@oracle ~]# hostname
oracle.zhuohua.store
[root@oracle ~]#
[root@oracle ~]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=oracle.zhuohua.store
查看操作系统的版本:
[root@oracle ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.9 (Santiago)
[root@oracle ~]#
[root@oracle ~]# cat /etc/issue
Oracle Linux Server release 6.9
Kernel \r on an \m
查看内核版本:
[root@oracle ~]# uname -r
4.1.12-61.1.28.el6uek.x86_64
[root@oracle ~]#
[root@oracle ~]# uname -a
Linux oracle.zhuohua.store 4.1.12-61.1.28.el6uek.x86_64 #2 SMP Thu Feb 23 20:03:53 PST 2017 x86_64 x86_64 x86_64 GNU/Linux
网卡信息:
[root@oracle ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:1B:EE:B6
inet addr:192.168.168.163 Bcast:192.168.168.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe1b:eeb6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:449 errors:0 dropped:0 overruns:0 frame:0
TX packets:242 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:46828 (45.7 KiB) TX bytes:27078 (26.4 KiB)
Interrupt:19 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@oracle ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=251d55eb-d10f-46ae-9552-f67449b33df6
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp #使用DHCP分配的IP地址
HWADDR=00:0C:29:1B:EE:B6
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
Oracle Linux6.9本身自带公网Yum源,连接公网后,可以直接使用Yum进行软件安装:
[root@oracle ~]# cd /etc/yum.repos.d/
[root@oracle yum.repos.d]# ls
public-yum-ol6.repo
配置本地光盘Yum源:(服务器要插入系统光盘)
mkdir -p /mnt/cdrom
mount -t auto /dev/cdrom /mnt/cdrom/
## 以本地光盘作为Yum源
cat >/etc/yum.repos.d/local.repo<< eof
[local]
name=local Yum
baseurl=file:///mnt/cdrom
enabled=1
gpgcheck=0
eof
## 把原来的Yum源文件改名
cd /etc/yum.repos.d
mv public-yum-ol6.repo public-yum-ol6.repo.bak
## 清除Yum缓存
yum clean all
#######
在CentOS6、Redhat6、Oracle Linux6中可以使用setup配置工具很方便地配置防火墙、网络、系统服务等配置项。如果采用最小化安装系统的话,默认是没有安装该工具的,但可以手动安装:
yum -y install setuptool
yum -y install system-config-securitylevel-tui
yum -y install system-config-firewall-tui
yum -y install system-config-network-tui
yum -y install ntsysv
编辑网络配置:
[root@oracle ~]# setup
使用静态IP地址:
重启network服务:
[root@oracle ~]# service network restart
正在关闭接口 eth0: [确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 eth0: Determining if ip address 192.168.168.163 is already in use for device eth0...
[确定]
可以看到网卡信息也随之改变了
[root@oracle ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=251d55eb-d10f-46ae-9552-f67449b33df6
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none #使用静态IP地址
HWADDR=00:0c:29:1b:ee:b6
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
IPADDR=192.168.168.163 #IP地址
NETMASK=255.255.255.0 #掩码
DNS2=114.114.114.114 #本机使用的第二个DNS服务器地址
GATEWAY=192.168.168.2 #网关
DNS1=8.8.8.8 #本机使用的第一个DNS服务器地址
USERCTL=no
显示网卡的网关:
[root@oracle ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.168.2 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
192.168.168.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
查看本机所使用的DNS服务器地址:
[root@oracle ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
search localdomain zhuohua.store
nameserver 8.8.8.8
nameserver 114.114.114.114
注释:一般在网卡的配置文件上配置DNS地址。
######
Oracle Linux6.9默认是没有防火墙配置文件的:
添加防火墙规则:
[root@oracle ~]# iptables -I INPUT -p TCP --dport 22 -j ACCEPT
保存防火墙规则:(会自动创建防火墙配置文件的了)
[root@oracle ~]# iptables-save > /etc/sysconfig/iptables
重启防火墙:
[root@oracle ~]# service iptables restart
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则:[确定]
iptables:正在卸载模块:[确定]
iptables:应用防火墙规则:[确定]
配置防火墙默认规则:
[root@oracle ~]# iptables -P INPUT DROP
[root@oracle ~]# iptables -P FORWARD DROP
[root@oracle ~]# iptables-save > /etc/sysconfig/iptables
查看防火墙配置文件:
[root@oracle ~]# cat /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Fri Oct 16 18:37:52 2020
*filter
:INPUT DROP [0:0] #默认规则
:FORWARD DROP [0:0] #默认规则
:OUTPUT ACCEPT [3:324] #默认规则
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
COMMIT
# Completed on Fri Oct 16 18:37:52 2020
查看防火墙的filter表:
[root@oracle ~]# iptables -t filter -nL --line
Chain INPUT (policy DROP) #默认规则
num target prot opt source destination
1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
Chain FORWARD (policy DROP) #默认规则
num target prot opt source destination
Chain OUTPUT (policy ACCEPT) #默认规则
num target prot opt source destination
查看防火墙的nat表:
[root@oracle ~]# iptables -t nat -nL --line
Chain PREROUTING (policy ACCEPT) #默认规则
num target prot opt source destination
Chain INPUT (policy ACCEPT) #默认规则
num target prot opt source destination
Chain OUTPUT (policy ACCEPT) #默认规则
num target prot opt source destination
Chain POSTROUTING (policy ACCEPT) #默认规则
num target prot opt source destination
SELinux默认是开启的:
[root@oracle ~]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
查看当前语言环境:(中文)
[root@oracle ~]# echo $LANG
zh_CN.UTF-8
[root@oracle ~]# cat /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
修改语言环境:
[root@oracle ~]# vi /etc/sysconfig/i18n
LANG="zh_CN.UTF-8"
修改为:(中文修改为英文)
LANG="en_US.UTF-8"
重启服务器,才能生效:
[root@oracle ~]# init 6
服务器重启后,再查看当前语言环境:(英文)
[root@oracle ~]# echo $LANG
en_US.UTF-8
重启network服务:
[root@oracle ~]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Determining if ip address 192.168.168.163 is already in use for device eth0...
[ OK ]
硬盘分区信息:
df -hT
lsblk
注释:可以看到/home、swap分区、根分区是固定大小的。
df -hl
/home分区的使用率:
[root@oracle ~]# df -hl |grep home$ |tail -1 |awk '{print $4}' |cut -d% -f 1
1
查看内存、交换分区的使用情况:(单位MB)
free -m
内存使用率:
[root@oracle ~]# Mem_use_percent=$(expr $(free |head -3 |tail -1 |awk '{print $3}') \* 100 / $(free |grep "Mem:" |awk '{print $2}'))
[root@oracle ~]#
[root@oracle ~]# echo $Mem_use_percent
5
查看CPU信息:(以下是有两个CPU)
[root@oracle ~]# cat /proc/cpuinfo | grep "model name"
model name : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
model name : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
CPU空闲率:
vmstat -w
CPU使用率:
[root@oracle ~]# CPU_use_percent=$(expr 100 - $(vmstat -w |tail -1 |awk '{print $15}'))
[root@oracle ~]# echo $CPU_use_percent
1
相关文章:
最小化安装CentOS6
最小化安装CentOS7.8
最小化安装CentOS8
SecureCRT+密钥对验证
Linux客户端使用ftp命令连接FTP服务端
CentOS6_iptables
使用Shell脚本监控本机的CPU、内存、分区的使用率
Oracle Linux6安装服务器安全狗、Apache版网站安全狗
Oracle Linux6安装服务器安全狗、Nginx版网站安全狗
Oracle Linux6.9安装Oracle11gR2
Oracle Linux6.9安装Cacti
PuTTY远程管理Oracle Linux6.9
Zabbix使用Agent监控Oracle Linux6
Zabbix使用SNMP监控Oracle Linux6 |