JavaScript must be enabled in order for you to see "WP Copy Data Protect" effect. However, it seems JavaScript is either disabled or not supported by your browser. To see full result of "WP Copy Data Protector", enable JavaScript by changing your browser options, then try again.

OS basic tuning under the RHEL 7.0


最近剛好會用到RHEL 7.0的OS,與之前常用的RHEL 6.x和5.x落差不小,像是開機的程序設定檔的位置一些指令的交替等等,而且CentOS 7.0和SLES 12未來都會採用類似的模式來操作,所以還是紀錄一下一些平常在開始使用前,會做一些Basic的Tuning,因此話不多說,直接看下去吧,如下:
1) Timezone與UTC的Setting(之前RHEL 6.x在安裝OS中可以直接Disable UTC)
#tzselect -> or #rm /etc/localtime && ln -s /usr/share/zoneinfo/Asia/Taipei /etc/localtime
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
1) Africa
2) Americas
3) Antarctica
4) Arctic Ocean
5) Asia
6) Atlantic Ocean
7) Australia
8) Europe
9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#? 5
Please select a country.
1) Afghanistan 18) Israel 35) Palestine
2) Armenia 19) Japan 36) Philippines
3) Azerbaijan 20) Jordan 37) Qatar
4) Bahrain 21) Kazakhstan 38) Russia
5) Bangladesh 22) Korea (North) 39) Saudi Arabia
6) Bhutan 23) Korea (South) 40) Singapore
7) Brunei 24) Kuwait 41) Sri Lanka
8) Cambodia 25) Kyrgyzstan 42) Syria
9) China 26) Laos 43) Taiwan
10) Cyprus 27) Lebanon 44) Tajikistan
11) East Timor 28) Macau 45) Thailand
12) Georgia 29) Malaysia 46) Turkmenistan
13) Hong Kong 30) Mongolia 47) United Arab Emirates
14) India 31) Myanmar (Burma) 48) Uzbekistan
15) Indonesia 32) Nepal 49) Vietnam
16) Iran 33) Oman 50) Yemen
17) Iraq 34) Pakistan
#? 43
The following information has been given:
Taiwan
Therefore TZ='Asia/Taipei' will be used.
Local time is now: Sat Oct 4 21:56:30 CST 2014.
Universal Time is now: Sat Oct 4 13:56:30 UTC 2014.
Is the above information OK?
1) Yes
2) No
#? 1
You can make this change permanent for yourself by appending the line
TZ='Asia/Taipei'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Taipei
#timedatectl set-local-rtc 1
#cat /etc/adjtime | grep -i LOCAL | wc -l
1

2) Network的Setting(這邊以Static IP舉例,順便關Firewall)
#service NetworkManager stop
#systemctl disable !!:1
#vi /etc/sysconfig/network-scripts/ifcfg-eno1
TYPE=Ethernet
BOOTPROTO=static
NAME=eno1
DEVICE=eno1
ONBOOT=yes
IPADDR=192.168.1.1
NETMASK=255.255.255.0
#systemctl restart network
#service firewalld stop
#chkconfig !!:1 off
#yum install iptables-services

3) 將NIC Device改回ethN(需額外加上Parameter在Kernel Line[Disable CDNN])
#vi /etc/default/grub
GRUB_CMDLINE_LINUX="... net.ifnames=0 biosdevname=0"
#grub2-set-default 0
#grub2-mkconfig -o /boot/grub2/grub.cfg -> For Legacy Mode
#init 6
#ls -al /sys/class/net -> or #ifconfig -a

4) 修改Hostname與Disable SELinux(RHEL 6.x在/etc/sysconfig/network的HOSTNAME)
#vi /etc/hostname
unsvr.sit.com
#vi /etc/sysconfig/selinux -> #setenforce 0(Temp)
SELINUX=disabled

5) NTP網路校時設定
#yum install chrony
#vi /etc/chrony.conf
# server 0.centos.pool.ntp.org iburst
# server 1.centos.pool.ntp.org iburst
# server 2.centos.pool.ntp.org iburst
# server 3.centos.pool.ntp.org iburst
server tick.stdtime.gov.tw iburst
server watch.stdtime.gov.tw iburst
#systemctl start chronyd
#systemctl enable chronyd
#chronyc -a
chronyc> tracking -> 檢視時間差
chronyc> sources -> 查看NTP Server Status
chronyc> makestep -> 手動立即校時
chronyc> exit

6) 使用rc.local與另外安裝ipmitool(Default Setting需額外設定執行權限)
#chmod a+x /etc/rc.d/rc.local
#rpm -ivh OpenIPMI-modalias-2.0.19-11.el7.x86_64.rpm
#rpm -ivh OpenIPMI-libs-2.0.19-11.el7.x86_64.rpm
#rpm -ivh OpenIPMI-2.0.19-11.el7.x86_64.rpm
#rpm -ivh ipmitool-1.8.13-7.el7.x86_64.rpm
#service ipmi start
#chkconfig !!:1 on
#ipmitool mc info

7) Reset/Recovery the password about root(參考Jamyy大大這邊的文章)

#mount -o remount,rw /
#passwd -> 直接更改root的密碼
#touch /.autorelabel -> 若你的System有開SELinux=enforcing記得要做
#exec /sbin/init

8) Format and Record the DVD or CD
#dvd+rw-format -force=full /dev/sr0 -> Format Data for DVD type
#growisofs -Z /dev/sr0=/root/example.iso -> Record Data for DVD type
#umount /run/media/root/CDROM
#wodim -v dev=/dev/sr0 blank=fast -> Format Data for CD type
#wodim -v -sao dev=/dev/sr0 /root/example.iso -> Record Data for CD type

9) Disable auto logout and screensaver

10) Modify and query the current runlevel(poweroff.target[0]、rescue.target[1]和reboot.target[6])
#systemctl get-default -> 查看目前的RunLevel
#systemctl set-default graphical.target -> 設定下次開機的Runlevel
#systemctl isolate multi-user.target -> 類似#init 3

11) Setup the func of VNC through vino(這邊就不介紹tightvnc的部分)
#gsettings set org.gnome.Vino require-encryption false -> Solve VNC Client沒支援Type 18 TLS
#gnome-control-center sharing -> 類似在RHEL6執行#vino-preferences


12) Through the command of getconf to get the Arch
#getconf -a -> List all env about this system
#getconf LONG_BIT
64

13) Modify the behavior about the physical power button(Default value is blank)
#gsettings range org.gnome.settings-daemon.plugins.power button-power
enum
'blank'
'suspend'
'shutdown'
'hibernate'
'interactive'
'nothing'
#gsettings set org.gnome.settings-daemon.plugins.power button-power shutdown

14) Modify the repo from the DVD or Mirror from the CentOS7(參考這篇所推敲出)
#mount /dev/sr0 /mnt
#cat >> /etc/yum.repos.d/rhel70.repo
[rhel70]
baseurl = file:///mnt
gpgcheck = 0 -> Crtl-D
#yum clean
#yum list -> The part of following is about using the mirror of CentOS7
#rpm -qa | grep yum | xargs rpm -e --nodeps
#wget http://mirror01.idc.hinet.net/CentOS/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm
#wget http://mirror01.idc.hinet.net/CentOS/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-24.el7.noarch.rpm
#wget http://mirror01.idc.hinet.net/CentOS/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
#rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
#rpm -ivh --nodeps yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
#rpm -ivh yum-3.4.3-118.el7.centos.noarch.rpm
#wget http://iori.tw/CentOS_7_Mirror_Hinet.tar.gz
#tar zxvf CentOS_7_Mirror_Hinet.tar.gz
#mv ~/CentOS_7_Mirror_Hinet/CentOS-Base.repo /etc/yum.repos.d/
#yum list
#mkdir -p /var/cache/yum/{base,extras,updates}/
#cp ~/CentOS_7_Mirror_Hinet/mirrorlist.txt /var/cache/yum/base/
#cp ~/CentOS_7_Mirror_Hinet/mirrorlist.txt /var/cache/yum/extras/
#cp ~/CentOS_7_Mirror_Hinet/mirrorlist.txt /var/cache/yum/updates/
#mv ~/CentOS_7_Mirror_Hinet/RPM-GPG-KEY-CentOS-7 /etc/pki/rpm-gpg/
#yum list
#rpm -ivh ~/CentOS_7_Mirror_Hinet/epel-release-7-2.noarch.rpm
#yum list

15) Modify the boot order with the Grub2(這邊以改成第二個為例)
#vi /etc/default/grub -> or #grub2-set-default 2
GRUB_DEFAULT=1
#grub2-mkconfig -o /boot/grub2/grub.cfg -> For Legacy mode

◎、以上就是關於用到RHEL7時,會做的Basic OS Tuning剩下的部分等有遇到把它們補上吧,或是看倌們有想到什麼,也可以直接留言給我後補上,先到這囉,收工勒!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
This site is protected by WP-CopyRightPro