安装:
安装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