歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux安裝系統注意事項及系統初始化

Linux安裝系統注意事項及系統初始化

日期:2017/2/28 14:44:55   编辑:Linux教程

Linux安裝系統注意事項

1.分區

學習用途:

/boot:200M

/swap :內存的1到2倍

/:根據需要分配大小,比如虛擬機下總空間是15G,那麼可以分配8——10G跟/分區,如果是生產環境,60——100G都很正常

/opt:最好有個單獨的分區,用以存儲數據、資料,下次使用系統此分區保持不變,就不會丟失數據。

2.根據需要安裝工具包。

3. 學習使用的話盡可能最小化安裝,只需要在最小化的基礎上安裝中文支持包即可。

系統初始化

1.修改主機名字

[root@localhost Desktop]# vim /etc/sysconfig/network

[root@localhost Desktop]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME= linuxidc.host.com

[root@localhost Desktop]# hostname
localhost.localdomain

[root@localhost Desktop]# hostname linuxidc.host.com
[root@localhost Desktop]# hostname
linuxidc.host.com
#修改完後重啟系統或者關閉終端,再次執行hostname修改就可以看到效果

2.配置網絡

[root@ linuxidc ~]# vi /etc/sysconfig/network-scripts/
#局域網,配置IPADDR和NETMASK即可

3.關閉安全相關的比如SELINUX防火牆

[root@ linuxidc ~]# chkconfig NetworkManager off
[root@ linuxidc ~]# chkconfig iptables off
[root@ linuxidc ~]# chkconfig ip6tables off

[root@ linuxidc ~]# /etc/init.d/iptables stop
[root@ linuxidc ~]# /etc/init.d/ip6tables stop


[root@ linuxidc ~]# setenforce 0
#將SELINUX有enabled改為permissive
[root@localhost ~]# grep "^SELINUX=" /etc/sysconfig/selinux -n
8:SELINUX=permissive

4.yum源的配置

[root@localhost ~]# mkdir /iso
mount /dev/cdrom /iso
cd /iso
ll
[root@localhost iso]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
rhel-source.repo
[root@localhost yum.repos.d]# cp rhel-source.repo iso.repo

[root@localhost yum.repos.d]# cat iso.repo
[rhel-iso]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///iso
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release

[root@localhost yum.repos.d]# yum install vim man -y

#mount後重啟失效,要想永久生效,添加此句話
[root@localhost yum.repos.d]# echo "mount /dev/cdrom /iso" >> /etc/rc.local
[root@localhost yum.repos.d]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
mount /dev/cdrom /iso

5.其他可以自行配置,比如啟用中文輸入法、修改終端字體和顏色等等

Copyright © Linux教程網 All Rights Reserved