df -lhT 现在是ext3文件系统,是否支持ext4系统
应该centos 6会支持 详情请查看:http://www.jb51.net/os/128751.html
centos6.5系统
///---------------------------------------------------------
以下为分区的方案
swap 实现虚拟内存,建议大小是物理内存的1~2倍。 64G
/boot 用来存放与 Linux 系统启动有关的程序 。[设置为主分区] 256M
/boot/efi efi system分区 。[设置为主分区] 32M
/ Linux 系统的根目录,所有的目录都挂在这个目录下面。[设置为主分区] 32G
/var 用来存放Linux系统中经常变化的数据以及日志文件 32G
/home 存放普通用户的数据,是普通用户的宿主目录,建议大小为剩下的空间。 剩下的空间[]
///---------------------------------------------------------
常用目录结构
/home/opt 存放软件安装包
/usr/local 程序安装目录
/home/databases 数据库目录
/home/logs 日志目录
/home/scripts 脚本存放目录
///---------------------------------------------------------
安装完系统后初始化要做的东西
一、设置IP地址、网关DNS
输入账号root
再输入安装过程中设置的密码,登录到系统
vi /etc/sysconfig/network-scripts/ifcfg-eth0 #编辑配置文件,添加修改以下内容
BOOTPROTO=static #启用静态IP地址
ONBOOT=yes #开启自动启用网络连接
IPADDR=192.168.0.99 #设置IP地址
NETMASK=255.255.255.0 #设置子网掩码
GATEWAY=192.168.0.1 #设置网关
:wq! #保存退出
vi /etc/resolv.conf #编辑配置文件,添加修改以下内容
search router
nameserver 202.96.128.86
nameserver 61.144.56.100
nameserver 8.8.8.8
:wq! #保存退出
service network restart #重启网络服务
二、设置主机名
hostname www #设置主机名为www
vi /etc/sysconfig/network #编辑配置文件
HOSTNAME=www#修改localhost.localdomain为www
:wq! #保存退出
vi /etc/hosts #编辑配置文件
127.0.0.1 www localhost #修改localhost.localdomain为www
:wq! #保存退出
shutdown –r now #重启系统
三、SSH安装与配置
ssh安装
yum安装vim最简单的命令, yum -y install vim*
禁用root远程登录
vi /etc/ssh/sshd_config
port 2424
PermitRootLogin no
PermitEmptyPasswords no #禁止空密码登录
UseDNS no #关闭DNS查询
GSSAPIAuthentication no
vi /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 2424 -j ACCEPT
service iptables restart
四、关闭SELinux
vi /etc/selinux/config
SELINUX=disabled
setenforce 0 #临时关闭
五、添加普通用户并进行sudo授权管理
vi /etc/sudoers #或visudo打开,添加user用户所有权限
root ALL=(ALL) ALL
user ALL=(ALL) ALL
六、关闭不必要开机自启动服务
chkconfig --list | grep 3:on 或 chkconfig --list | grep '3:启用'
chkconfig auditd off
chkconfig blk-availability off
chkconfig ip6tables off
chkconfig lvm2-monitor off
chkconfig netfs off
chkconfig udev-post off
七、删除不必要的系统用户
awk -F ":" '{print $1}' /etc/passwd
userdel adm
userdel lp
userdel shutdown
userdel halt
userdel uucp
userdel operator
userdel games
userdel gopher
userdel ftp
userdel nobody
userdel nfsnobody
八、安装系统的一些初始安装包
yum update -y #更新系统
yum -y install cmake bison bison-devel ncurses-devel
yum -y install bind-utils sysstat iftop iotop subversion
yum -y install wget setuptool gcc gcc-c++ autoconf vixie-cron crontabs zip make file patch
九、调整文件描述符的限制数量
ulimit -n 查看只有1024
解决:
vi /etc/security/limits.conf
文件最后加上
* soft nofile 32768
* hard nofile 65536
执行: ulimit -SHn 65536
十.同步系统时间
yum install ntpdate -y
crontab -e
0 * * * * /usr/sbin/ntpdate cn.pool.ntp.org ; hwclock -w
或
/usr/sbin/ntpdate pool.ntp.org
/etc/init.d/ntpd start
chkconfig ntpd on
十一、内核参数优化
vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_max_syn_backlog = 65536
net.core.netdev_max_backlog = 32768
net.core.somaxconn = 32768
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_fin_timeout = 30
net.ipv4.ip_local_port_range = 1024 65535
net.nf_conntrack_max = 655360
net.netfilter.nf_conntrack_tcp_timeout_established = 1200
系统初始配置完成 重启系统