概述:众所周知在安装oracle数据库中需要安装一些操作系统包,如果使用rpm工具进行包的安装需要解决包与包的依赖问题,而如果使用yum安装包将变得非常的方便;oracle安装可以采用静默安装与图形化界面安装,一般我们都将会选择图形界面安装简单方便直观;这里推荐大家使用vnc远程桌面的形式及规避了在机房里对着显示屏安装数据库冻到感冒,也无需使用第三工具入xmanager由于网络抖动等导致安装不成功的情况发生。开始测试配置。。。
实验步骤:
1、安装好redhat 6.4操作系统
2、上传安装介质,真实机器可以插入光纤亦可以上传iso文件(本文使用iso文件进行)
3、挂载iso文件
4、配置本地yum源
5、安装vnc包
6、配置vnc
实验:
查看操作系统版本:
[root@cube ~]# uname -r
2.6.32-358.el6.x86_64
[root@cube ~]# uname -a
Linux cube 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@cube ~]# cat /etc/issue
Red Hat Enterprise Linux Server release 6.4 (Santiago)
Kernel \r on an \m
安装介质上传与/tmp目录中:
[root@cube ~]# ls -l /tmp/rhel*
-rw-r--r--. 1 root root 3720347648 Dec 26 15:56 /tmp/rhel-server-6.4-x86_64-dvd.iso
将iso文件挂载到/media目录中
mount -o loop -t iso9660 /tmp/rhel-server-6.4-x86_64-dvd.iso /media/
配置yum本地源信息:
[root@cube ~]# cd /etc/yum.repos.d/
[root@cube yum.repos.d]# ls
rhel-source.repo
[root@cube yum.repos.d]# rm rhel-source.repo
rm: remove regular file `rhel-source.repo'? y
[root@cube yum.repos.d]# touch base.repo
[root@cube yum.repos.d]# vi base.repo
[base]
name = base
baseurl=file:///media/Server
gpgcheck=0
enable=1
刷新yum源,可以使用以下命令亦或者是重启服务器等等
yum clean dbcache
yum list
至此 yum本地源配置完毕 可以去测试 yum install 包进行按照测试
vnc配置:
安装vnc包
[root@cube Packages]# yum install -y vnc-server
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tigervnc-server.x86_64 0:1.1.0-5.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================
Package Arch Version Repository Size
================================================================================================================
Installing:
tigervnc-server x86_64 1.1.0-5.el6 base 1.0 M
Transaction Summary
================================================================================================================
Install 1 Package(s)
Total download size: 1.0 M
Installed size: 2.6 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : tigervnc-server-1.1.0-5.el6.x86_64 1/1
base/productid | 1.7 kB 00:00 ...
Verifying : tigervnc-server-1.1.0-5.el6.x86_64 1/1
Installed:
tigervnc-server.x86_64 0:1.1.0-5.el6
Complete!
配置vncservers文件,最后添加两行命令:
[root@cube Packages]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the lines below to start a VNC server on display :2
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see this URL:
# http://kbase.redhat.com/faq/docs/DOC-7028
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"
VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1024x768"
为vncserver设置密码:
[root@cube Packages]# vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: creating new authority file /root/.Xauthority
xauth: (stdin):1: bad display name "cube:1" in "add" command
New 'cube:1 (root)' desktop is cube:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/cube:1.log
一般我们使用gnome作为图形界面形式故需要修改下/root/.vnc/xstartup文件
[root@cube ~]# cat /root/.vnc/xstartup
#!/bin/sh
[ -r /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
export LANG
export SYSFONT
vncconfig -iconic &
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
OS=`uname -s`
if [ $OS = 'Linux' ]; then
case "$WINDOWMANAGER" in
*gnome*)
if [ -e /etc/SuSE-release ]; then
PATH=$PATH:/opt/gnome/bin
export PATH
fi
;;
esac
fi
if [ -x /etc/X11/xinit/xinitrc ]; then
exec /etc/X11/xinit/xinitrc
fi
if [ -f /etc/X11/xinit/xinitrc ]; then
exec sh /etc/X11/xinit/xinitrc
fi
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
gnome-session &
启动vncserver并使服务随机启动
[root@cube ~]# service vncserver restart
Shutting down VNC server: 1:root [ OK ]
Starting VNC server: 1:root xauth: (stdin):1: bad display name "cube:1" in "add" command
New 'cube:1 (root)' desktop is cube:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/cube:1.log
[ OK ]
至此vncserver已经配置完成,您可以在您的笔记本上使用vncview工具进行连接了。补充一点 vnc的端口为5901 端口
[root@cube ~]# netstat -ntlp |grep vnc
tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 2319/Xvnc
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 2319/Xvnc
tcp 0 0 :::6001
总结:配置好本地yum源及vnc为工作中安装oracle等各种软件提供了很好的解决方案,各位看官自行try it get 技能吧。。