在VMWARE 8 上安装centos 5.5 64位系统操作实例

图形界面只选择gnom,选择软件定制,把、c库等开发平台都选上,把server中的ftp、nfs、邮件、dhcp等必要的服务器程序都选上,这样为以后安装oracle11g奠定基础;

特别是、c库开发环境都要安装,这样安装oracle时补丁包可以省去很多;

软件定制后,进行下一步:

clip_image002

启动安装:

clip_image004

安装完成后,重启系统,默认关掉防火墙和selinux等安全组件,以后需要可以使用setup命令打开,然后配置显示 分辨率,选择相应的的显示器类型,在管理-网络中,选择开机激活eth0,然后选择手动,配置vmnat8的ip网段:192.168.128.xxx,确定后重启系统;

验证网络激活,打开一个终端,ping一下vmnat8的ip:192.168.128.1,如果通说明网络激活,局域网搭建成功;

安装vmware-tools for Linux, 使vmware操作方便;

此cent版本安装完后,默认非root登录后,不能使用sbin下的命令脚本,比如ifconfig,因为/etc/profile 没有把/sbin作为默认的环境变量加进来,可以vi /etc/profile在文件末加入:

PATH=$PATH:/sbin

export PATH

命令;

执行如下的命令 检查对oracle11g需要的包是否都已经安装:

[cent@localhost ~]$ rpm -qa | grep gcc

gcc-c++-4.1.2-48.el5

libgcc-4.1.2-48.el5

gcc-4.1.2-48.el5

gcc-gfortran-4.1.2-48.el5

gcc--4.1.2-48.el5

libgcc-4.1.2-48.el5

[cent@localhost ~]$ rpm -qa|grep gcc-

gcc-c++-4.1.2-48.el5

libgcc-4.1.2-48.el5

gcc-4.1.2-48.el5

gcc-gfortran-4.1.2-48.el5

gcc--4.1.2-48.el5

libgcc-4.1.2-48.el5

[cent@localhost ~]$ rpm -qa|grep gcc-c++

gcc-c++-4.1.2-48.el5

[cent@localhost ~]$ rpm -qa|grep compat-libstdc++-

[cent@localhost ~]$ rpm -qa|grep elfutils-libelf-devel-

elfutils-libelf-devel-static-0.137-3.el5

elfutils-libelf-devel-0.137-3.el5

[cent@localhost ~]$ rpm -qa|grep glibc-devel-

glibc-devel-2.5-49

glibc-devel-2.5-49

[cent@localhost ~]$ rpm -qa|grep glibc-headers-

[cent@localhost ~]$ rpm -qa|grep libaio-devel-

[cent@localhost ~]$ rpm -qa|grep libstdc++-devel-

libstdc++-devel-4.1.2-48.el5

[cent@localhost ~]$ rpm -qa|grep sysstat-

[cent@localhost ~]$ rpm -qa|grep unixODBC-

unixODBC-2.2.11-7.1

unixODBC-2.2.11-7.1

[cent@localhost ~]$ rpm -qa|grep unixODBC-devel-

[cent@localhost ~]$ rpm -qa|grep pdksh-

经测试,还有下面的几个包没有安装,需要重新加载系统盘进行安装:

注意:以下写法只是包名称一部分,安装的时候按安装命令中的包名称

>>compat-libstdc++-

>>glibc-headers-

>>libaio-devel-

>>sysstat-

>>unixODBC-devel-

>>pdksh-

需要执行如下操作进行安装:

vi /etc/yum.repos.d/-Media.repo

将 baseurl=file:///media//修改为

file:///media/CentOS_5.5_Final/但是执行上面修改的前提是你的系统盘是挂载在/media/CentOS_5.5_Final/目录下,而非:/media/下!

然后执行

[root@localhost archive2]# yum –disablerepo=\* –enablerepo=c5-media install compat-libstd* glibc-headers libaio-devel sysstat unixODBC-devel pdksh

注意上面命令中的包名称;

如果执行如下安装会话:

clip_image006

执行如下命令处理:

[root@localhost archive2]# rm -f /var/run/yum.pid

[root@localhost archive2]# service yum-updatesd restart

停止 yum-updatesd: [确定]

启动 yum-updatesd: [确定]

[root@localhost archive2]# yum –disablerepo=\* –enablerepo=c5-media install compat-libstd* glibc-headers libaio-devel sysstat unixODBC-devel pdksh

会话如下:

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* c5-media:

Setting up Install Process

Package glibc-headers-2.5-49.x86_64 already installed and latest version

Resolving Dependencies

–> Running transaction check

—> Package compat-libstdc++-296.i386 0:2.96-138 set to be updated

—> Package compat-libstdc++-33.i386 0:3.2.3-61 set to be updated

—> Package compat-libstdc++-33.x86_64 0:3.2.3-61 set to be updated

—> Package libaio-devel.i386 0:0.3.106-5 set to be updated

—> Package libaio-devel.x86_64 0:0.3.106-5 set to be updated

—> Package pdksh.x86_64 0:5.2.14-36.el5 set to be updated

—> Package sysstat.x86_64 0:7.0.2-3.el5 set to be updated

—> Package unixODBC-devel.i386 0:2.2.11-7.1 set to be updated

—> Package unixODBC-devel.x86_64 0:2.2.11-7.1 set to be updated

–> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================================================================================================================

Package Arch Version Repository Size

==========================================================================================================================================================================================

Installing:

compat-libstdc++-296 i386 2.96-138 c5-media 90 k

compat-libstdc++-33 i386 3.2.3-61 c5-media 232 k

compat-libstdc++-33 x86_64 3.2.3-61 c5-media 227 k

libaio-devel i386 0.3.106-5 c5-media 12 k

libaio-devel x86_64 0.3.106-5 c5-media 11 k

pdksh x86_64 5.2.14-36.el5 c5-media 205 k

sysstat x86_64 7.0.2-3.el5 c5-media 173 k

unixODBC-devel i386 2.2.11-7.1 c5-media 739 k

unixODBC-devel x86_64 2.2.11-7.1 c5-media 796 k

Transaction Summary

==========================================================================================================================================================================================

Install 9 Package(s)

Upgrade 0 Package(s)

Total download size: 2.4 M

Is this ok [y/N]:

y

Downloading Packages:

————————————————————————————————————————————————————————————

Total 23 MB/s | 2.4 MB 00:00

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID e8562897

c5-media/gpgkey | 1.5 kB 00:00

Importing GPG key 0xE8562897 “CentOS-5 Key (CentOS 5 Official Signing Key) ” from /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing : compat-libstdc++-33 1/9

Installing : unixODBC-devel 2/9

Installing : unixODBC-devel 3/9

Installing : compat-libstdc++-296 4/9

Installing : libaio-devel 5/9

Installing : sysstat 6/9

Installing : libaio-devel 7/9

Installing : compat-libstdc++-33 8/9

Installing : pdksh 9/9

Installed:

compat-libstdc++-296.i386 0:2.96-138 compat-libstdc++-33.i386 0:3.2.3-61 compat-libstdc++-33.x86_64 0:3.2.3-61 libaio-devel.i386 0:0.3.106-5 libaio-devel.x86_64 0:0.3.106-5

pdksh.x86_64 0:5.2.14-36.el5 sysstat.x86_64 0:7.0.2-3.el5 unixODBC-devel.i386 0:2.2.11-7.1 unixODBC-devel.x86_64 0:2.2.11-7.1

Complete!

会话截图如下:

clip_image008

clip_image010

clip_image012

至此,缺少的包安装成功!

进行包完全验证:

[root@localhost archive2]# rpm -qa|grep glibc-headers

glibc-headers-2.5-49

[root@localhost archive2]# rpm -qa|grep libaio-devel-

libaio-devel-0.3.106-5

libaio-devel-0.3.106-5

[root@localhost archive2]# rpm -qa|grep compat-libstdc

compat-libstdc++-33-3.2.3-61

compat-libstdc++-296-2.96-138

compat-libstdc++-33-3.2.3-61

[root@localhost archive2]# rpm -qa|grep sysstat

sysstat-7.0.2-3.el5

[root@localhost archive2]# rpm -qa|grep unixODBC-devel

unixODBC-devel-2.2.11-7.1

unixODBC-devel-2.2.11-7.1

[root@localhost archive2]# rpm -qa|grep pdksh-

pdksh-5.2.14-36.el5

[root@localhost archive2]# rpm -qa|grep gcc

gcc-c++-4.1.2-48.el5

libgcc-4.1.2-48.el5

gcc-4.1.2-48.el5

gcc-gfortran-4.1.2-48.el5

gcc--4.1.2-48.el5

libgcc-4.1.2-48.el5

[root@localhost archive2]# rpm -qa|grep elfutils-libelf-devel

elfutils-libelf-devel-static-0.137-3.el5

elfutils-libelf-devel-0.137-3.el5

[root@localhost archive2]# rpm -qa|grep glibc-devel

glibc-devel-2.5-49

glibc-devel-2.5-49

[root@localhost archive2]# rpm -qa|grep gcc-c++

gcc-c++-4.1.2-48.el5

[root@localhost archive2]# rpm -qa|grep libstdc++-devel

libstdc++-devel-4.1.2-48.el5

[root@localhost archive2]# rpm -qa|grep unixODBC

unixODBC-devel-2.2.11-7.1

unixODBC-2.2.11-7.1

unixODBC-2.2.11-7.1

unixODBC-devel-2.2.11-7.1

验证nfs包是否安装:

[cent@localhost ~]$ rpm -qa | grep nfs-utils

nfs-utils-1.0.9-44.el5

nfs-utils-lib-1.0.8-7.6.el5

[cent@localhost ~]$ rpm -qa | grep portmap

portmap-4.0-65.2.2.1

结果如上说明安装;

另外注意编码问题,centos默认采用utf-8编码:

echo $LANG

zh_CN.UTF-8

或者

more /etc/sysconfig/i18n

LANG=”zh_CN.UTF-8”

说明系统采用utf8编码;

Centos5.5使用utf8编码时,oracle中文每个中文占用3个字节;而在zhs16gbk编码下,oracle每个中文占用2字节;

检查nfs是否运行

[root@localhost ~]# /etc/init.d/nfs status

rpc.mountd 已停

nfsd 已停

rpc.rquotad 已停

必须配置自动运行

Nfs是用来做网络上共享文件资源的解决方案,这种共享可以像使用本地文件资源一样读写共享的文件资源;Fedora Core拥有NFS server和NFS client两个角色,因此他既可以暴露本地的文件系统给其他系统使用也可以挂载其他主机开放的文件系统;

Nfs共享文件其实是输出目录,NFS Server Configuration 可以用来配置NFS服务器;

NFS Server Configuration 工具必须在X Window系统中使用,拥有root权限,并且保证本地安装了system-config-nfs rpm包。可以从开始菜单—系统设置—服务器设置—nfs打开该工具,或者在终端输入命令:system-config-nfs;

[root@localhost ~]# system-config-nfs

打开如下界面:

clip_image014

点击add,打开文件共享添加页面:

clip_image016

其中,目录表示要暴露的文件目录,主机表示访问该nfs上的文件资源要输出到的目标主机,如ip信息;

主机一栏,可以是单一ip地址,可以是一组主机(用通配符*来表示),也可以是指定了子网掩码的ip网络如192.168.0.0/24或者192.168.100.8/255.255.255.0,另外还有net groups;

基本权限可以设定需要的读写权限;

添加成功后,打开如下页面:

clip_image018

去掉同步写选项:

clip_image020

点选用户访问选项卡,点选 将所有客户端用户视为匿名用户,同时设置匿名用户对应的本地用户id为1001,本地用户组id为1001;

clip_image022

执行如下的命令检查:

[root@localhost archivelog]# more /etc/exports

/archivelog/arch1 192.168.128.130(rw,async,all_squash,anonuid=1001,anongid=1001)

/archivelog/arch2 192.168.128.129(rw,async,all_squash,anonuid=1001,anongid=1001)

或者

[root@localhost ~]# exportfs -v

/archivelog/arch1 192.168.128.130(rw,async,wdelay,root_squash,all_squash,no_subtree_check,anonuid=1001,anongid=1001)

/archivelog/arch2 192.168.128.129(rw,async,wdelay,root_squash,all_squash,no_subtree_check,anonuid=1001,anongid=1001)

注意:上面的anonuid=表示登录用户以匿名处理,nfs匿名用户的uid是1001,施工中这个1001对应的是oracle用户的uid,当然anongid是oracle所在dba组的gid,具体施工中根据实际oracle 的信息配置;

以下命令用来查询本地nfs提供的可挂载点和允许主机:

[root@localhost ~]# showmount -e

Export list for localhost.localdomain:

/archivelog/arch2 192.168.128.129

/archivelog/arch1 192.168.128.130

上面的内容 完全可以使用 vi /etc/exports进行添加;

重新执行如下命令,查看nfs状态

[root@localhost ~]# /etc/init.d/nfs status

rpc.mountd (pid 25474) 正在运行…

nfsd (pid 25467 25466 25465 25464 25463 25462 25461 25460) 正在运行…

rpc.rquotad (pid 25451) 正在运行…

表示nfs已经运行,下面检查nfs自动启动运行级别:

[root@localhost ~]# chkconfig –list|grep nfs

nfs 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭

nfslock 0:关闭 1:关闭 2:关闭 3:启用 4:启用 5:启用 6:关闭

0表示关机,1表示单用户模式,2表示多用户模式,3表示完全多用户模式,5表示X11模式,6表示重新启动;

如果2345没有打开,可以使用如下命令开启自动运行:

[root@localhost ~]# chkconfig nfs on

以root登录系统后,新开一个终端,以下命令添加2组和oracle用户:

[root@localhost ~]# groupadd oinstall

或者:groupadd –g 2000 oinstall

[root@localhost ~]# groupadd dba

或者:groupadd –g 1000 dba

[root@localhost ~]# useradd -g oinstall -G dba -d /home/oracle -s /bin/bash oracle

或者:useradd –u 2000 –g oinstall –G dba –p password –d /home/oracle –s /bin/bash oracle

-g表示新账户的默认组id,-G表示新账户的附加组id,-s表示新账户登录后的shell;

-p 后面跟加密的串 表示加密的密码,一般不用,而是用passwd重设用户密码;

ftp配置验证

验证vsftp包是否安装:

[root@localhost ~]# rpm -qa|grep vsftp

vsftpd-2.0.5-16.el5_4.1

如上,表示已经安装;

/etc/vsftpd/vsftpd.conf文件内容的验证:

[root@localhost ~]# more /etc/vsftpd/vsftpd.conf

# Example config file /etc/vsftpd/vsftpd.conf

#

# The default compiled in settings are fairly paranoid. This sample file

# loosens things up a bit, to make the ftp daemon more usable.

# Please see vsftpd.conf.5 for all compiled in defaults.

#

# READ THIS: This example file is NOT an exhaustive list of vsftpd options.

# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's

# capabilities.

#

# Allow anonymous FTP? (Beware – allowed by default if you comment this out).

anonymous_enable=YES

#

# Uncomment this to allow local users to log in.

local_enable=YES

#

# Uncomment this to enable any form of FTP write command.

write_enable=YES

#

# Default umask for local users is 077. You may wish to change this to 022,

# if your users expect that (022 is used by most other ftpd's)

local_umask=022

#

# Uncomment this to allow the anonymous FTP user to upload files. This only

# has an effect if the above global write enable is activated. Also, you will

# obviously need to create a directory writable by the FTP user.

#anon_upload_enable=YES

#

# Uncomment this if you want the anonymous FTP user to be able to create

# new directories.

#anon_mkdir_write_enable=YES

#

# Activate directory messages – messages given to remote users when they

# go into a certain directory.

dirmessage_enable=YES

#

# The target log file can be vsftpd_log_file or xferlog_file.

# This depends on setting xferlog_std_format parameter

xferlog_enable=YES

#

# Make sure PORT transfer connections originate from port 20 (ftp-data).

connect_from_port_20=YES

#

# If you want, you can arrange for uploaded anonymous files to be owned by

# a different user. Note! Using “root” for uploaded files is not

# recommended!

#chown_uploads=YES

#chown_username=whoever

#

# The name of log file when xferlog_enable=YES and xferlog_std_format=YES

# WARNING – changing this filename affects /etc/logrotate.d/vsftpd.log

#xferlog_file=/var/log/xferlog

#

# Switches between logging into vsftpd_log_file and xferlog_file files.

# NO writes to vsftpd_log_file, YES to xferlog_file

xferlog_std_format=YES

#

# You may change the default value for timing out an idle session.

#idle_session_timeout=600

#

# You may change the default value for timing out a data connection.

#data_connection_timeout=120

#

# It is recommended that you define on your system a unique user which the

# ftp server can use as a totally isolated and unprivileged user.

#nopriv_user=ftpsecure

#

# Enable this and the server will recognise asynchronous ABOR requests. Not

# recommended for security (the code is non-trivial). Not enabling it,

# however, may confuse older FTP clients.

#async_abor_enable=YES

#

# By default the server will pretend to allow ASCII mode but in fact ignore

# the request. Turn on the below options to have the server actually do ASCII

# mangling on files when in ASCII mode.

# Beware that on some FTP servers, ASCII support allows a denial of service

# attack (DoS) via the command “SIZE /big/file” in ASCII mode. vsftpd

# predicted this attack and has always been safe, reporting the size of the

# raw file.

# ASCII mangling is a horrible feature of the protocol.

#ascii_upload_enable=YES

#ascii_download_enable=YES

#

# You may fully customise the login banner string:

#ftpd_banner=Welcome to blah FTP service.

#

# You may specify a file of disallowed anonymous e-mail addresses. Apparently

# useful for combatting certain DoS attacks.

#deny_email_enable=YES

# (default follows)

#banned_email_file=/etc/vsftpd/banned_emails

#

# You may specify an explicit list of local users to chroot() to their home

# directory. If chroot_local_user is YES, then this list becomes a list of

# users to NOT chroot().

#chroot_list_enable=YES

# (default follows)

#chroot_list_file=/etc/vsftpd/chroot_list

#

# You may activate the “-R” option to the builtin ls. This is disabled by

# default to avoid remote users being able to cause excessive I/O on large

# sites. However, some broken FTP clients such as “ncftp” and “mirror” assume

# the presence of the “-R” option, so there is a strong case for enabling it.

#ls_recurse_enable=YES

#

# When “listen” directive is enabled, vsftpd runs in standalone mode and

# listens on IPv4 sockets. This directive cannot be used in conjunction

# with the listen_ipv6 directive.

listen=YES

#

# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6

# sockets, you must run two copies of vsftpd whith two configuration files.

# Make sure, that one of the listen options is commented !!

#listen_ipv6=YES

pam_service_name=vsftpd

userlist_enable=YES

tcp_wrappers=YES

添加以下三行:

userlist_enable=YES

userlist_deny=NO

userlist_file=/etc/vsftpd/user_list

上面的设置表示使用使用user_list文件列举允许使用ftp的用户清单

[root@localhost ~]# more /etc/vsftpd/user_list

# vsftpd userlist

# If userlist_deny=NO, only allow users in this file

# If userlist_deny=YES (default), never allow users in this file, and

# do not even prompt for a password.

# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers

# for users that are denied.

root

bin

daemon

adm

lp

sync

shutdown

halt

mail

news

uucp

operator

games

nobody

在生产系统中,只允许oracle用户,把上面的用户列表删掉,加上oracle;

检查ftp服务运行状态:

[root@localhost ~]# service vsftpd status

vsftpd 已停

[root@localhost ~]# service vsftpd status

vsftpd (pid 4075) 正在运行…

查看当前系统下所有的挂载点:

[root@localhost ~]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

76G 4.8G 67G 7% /

/dev/sda1 99M 13M 82M 14% /boot

tmpfs 501M 0 501M 0% /dev/shm

/dev/hdc 103M 103M 0 100% /media/20120116_163837

[root@localhost ~]# umount /dev/hdc

[root@localhost ~]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

76G 4.8G 67G 7% /

/dev/sda1 99M 13M 82M 14% /boot

tmpfs 501M 0 501M 0% /dev/shm

挂载nfs共享目录到本地client

[root@localhost ~]# showmount -e

Export list for localhost.localdomain:

/archivelog/arch1 192.168.128.130

/archivelog/arch2 192.168.128.129

执行挂载

[root@localhost ~]# mount 192.168.128.130:/archivelog/arch1 /test

查看挂载点列表

[root@localhost ~]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

76G 4.8G 67G 7% /

/dev/sda1 99M 13M 82M 14% /boot

tmpfs 501M 0 501M 0% /dev/shm

192.168.128.130:/archivelog/arch1

76G 4.8G 67G 7% /test

解挂上面挂载的资源,注意挂载时有ip,解挂时也要带上

[root@localhost ~]# umount 192.168.128.130:/archivelog/arch1

[root@localhost ~]# df -h

文件系统 容量 已用 可用 已用% 挂载点

/dev/mapper/VolGroup00-LogVol00

76G 4.8G 67G 7% /

/dev/sda1 99M 13M 82M 14% /boot

tmpfs 501M 0 501M 0% /dev/shm

将挂载的/archivelog/arch1 目录的所有者设成oracle及其dba组成员后,test挂载点也跟着变:

[root@localhost ~]# cd /

[root@localhost /]# ll

总计 170

drwxr-xr-x 4 oracle dba 4096 02-01 15:19 archivelog

drwxr-xr-x 2 oracle dba 4096 02-01 15:19 test

注意,此时镜像服务器上的oracle用户可以访问该归档目录,使用归档日志,所有要将目录附给oracle用户:chown –R oracle:dba /archivelog;

Chmod –R 755 /archivelog

Man命令的使用

Man + 命令

Q退出

修改oracle用户密码为oracle

[root@localhost ~]# passwd oracle

Changing password for user oracle.

New UNIX password:

BAD PASSWORD: it is based on a dictionary

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

声明: 除非转自他站(如有侵权,请联系处理)外,本文采用 BY-NC-SA 协议进行授权 | 智乐兔
转载请注明:转自《在VMWARE 8 上安装centos 5.5 64位系统操作实例
本文地址:https://www.zhiletu.com/archives-254.html
关注公众号:智乐兔

赞赏

wechat pay微信赞赏alipay pay支付宝赞赏

上一篇
下一篇

相关文章

在线留言

你必须 登录后 才能留言!

在线客服
在线客服 X

售前: 点击这里给我发消息
售后: 点击这里给我发消息

智乐兔官微