安装及优化配置CentOS(远程桌面管理等,新手可直接一步一步照做)

安装:
安装CentOS6.2或OpenSUSE11.2

尽可能多地使用物理内存
#sysctl vm.swappiness=30
#gedit /etc/sysctl.conf
加vm.swappiness=30
#cat /proc/sys/vm/swappiness

修改SSH端口和用户/etc/ssh/sshd_config
#端口
Port number
#禁止root过程登录
PermitRootLogin no

添加有管理权限的用户
useradd username -g root
passwd username

安装中文支持
yum groupinstall "Chinese Support"
打开配置文件的目录:cd /etc/sysconfig
编辑配置文件:vi i18n
LANG="en_US.UTF-8"改为LANG="zh_CN.UTF-8",增加LANGUAGE="zh_CN:zh"

service iptables stop
chkconfig iptables off
安装gnome桌面
yum groupinstall "Desktop"
或xfce桌面
wget http://download.Fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm 
rpm -ivh epel-release-6-7.noarch.rpm 
yum search xfce 
yum groupinfo xfce 
yum -y groupinstall xfce

安装VNC
rpm -qa|grep tigervnc #检查vnc是否安装
yum -y install tigervnc tigervnc-server或yum install vnc-server
chkconfig --add vncserver
chkconfig vncserver on
配置VNC
vncserver
设置密码
修改/root/.vnc/xstartup文件
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &
scim -d &
或把内容改成
#!/bin/sh
/usr/bin/startxfce4

修改 /etc/sysconfig/vncservers
VNCSERVERS="1:root 2:user2"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"
修改 /usr/bin/vncserver
把5900替换为$defaultPort=21000
重新启动后service vncserver start

安装管理工具
yum -y install system-config-firewall
yum -y install system-config-services
yum -y install gnome-system-monitor
在防火墙中添加对应的端口:21001等
chkconfig iptables on

管理LVM
fdisk -l #查看分区列表
fdisk /dev/hdc #分区
n-p
t-8e
w
pvcreate /dev/hdc1 #建立物理卷
vgcreate VolGroup01 /dev/hdc1 #建立卷组
vgdisplay #查看现有的卷组
vgextend VolGroup01 /dev/hdc2 #扩展卷组
vgreduce VolGroup01 /dev/hdc2 #从卷组中删除一个物理卷
lvcreate -L 50G -n MyData VolGroup01 #创建逻辑卷,容量50G(或 -l Free PE),名称MyData
lvremove /dev/VolGroup01/MyBak #删除逻辑卷
lvextend -l 14707 /dev/VolGroup01/MyData #扩展逻辑卷大小

#升级内核,安装XFS系统
edit /etc/yum.repos.d/CentOS-Base.repo
[centosplus] enabled=1
# yum update kernel-2.6.18-8.1.15.el5.centos.plus xfsprogs kmod-xfs-0.4-1.2.6.18_8.1.15.el5.centos.plus //注意用对应的版本
# modprobe xfs  //启用xfs
# echo "modprobe xfs">>/etc/rc.d/init.d/local
# lsmod |grep xfs //查看xfs信息
xfs                   481240 1
dmesg
yum -y install xfsprogs kmod-xfs
如果有如下信息,说明xfs module成功加载
SGI XFS with ACLs, security attributes, realtime, large block numbers, no debug enabled
SGI XFS Quota Management subsystem
# mkfs.xfs /dev/VolGroup01/MyData #创建XFS文件系统
# mount /dev/VolGroup01/MyData /apps/mysql/var #挂接到文件夹

#升级内核,安装reiserFS系统
edit /etc/yum.conf, comment the line “exclude=kernel*” out //不一定要改
# yum --disablerepo updates,base --enablerepo=centosplus list 'kernel*' //查看现在的内核列表
# yum --disablerepo updates,base --enablerepo=centosplus install kernel.i686 //升级安装新内核(kernel.i686改为对应版本)
# yum --disablerepo updates,base --enablerepo=centosplus list '*reiser*' //查看reiser文件系统列表
# yum --disablerepo updates,base --enablerepo=centosplus install reiserfs-utils.i386 //升级安装文件系统(reiserfs-utils.i386改为对应版本)

# mkreiserfs /dev/VolGroup01/MyData #创建文件系统
# mount /dev/VolGroup01/MyData /apps/mysql/var #挂接到文件夹
#启动时自动挂载,在/etc/fstab中添加:
/dev/VolGroup01/MyData /apps/mysql/var reiserfs defaults 1 2

#增加用户能打开的文件数
/etc/security/limits.conf中添加
* soft nofile 32764
* hard nofile 65528
# ulimit -n 32764

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值