本人之前已经做过这个实验,只是版本不同,今天本来想用全新版本的源码包做实验,但是以httpd-2.4.2.tar.gz的源码包在配置虚拟主机这一块我不知道如何配置,按照以前的配置总是报错:AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache2/conf/httpd.conf:491,在此纠结了很久,最终未果,就换了httpd-2.2.9的源码包做的实验,一路下来偶尔出点小插曲,但都解决了,下面是我在虚拟机上的配置过程:
先把我实验的包大概说一下:
下面是实验过程
[root@mail ~]# uname -a //检查系统环境
Linux mail 2.6.18-238.el5 #1 SMP Sun Dec 19 14:24:47 EST 2010 i686 i686 i386 GNU/Linux
[root@mail ~]#
[root@mail ~]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost localhost.localdomain
192.168.10.170 mail.chenkui.com //添加主机解析记录
::1 localhost6.localdomain6 localhost6
[root@mail ~]#
[root@mail ~]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mail 修改主机名
GATEWAY=192.168.10.1
[root@mail ~]# init 6 //在此修改主机名要重启才能生效
构建本地DVD yum源
安装createrepo软件包//在系统光盘中自带有此软件包
手动挂载光驱:mount /dev/cdrom /mnt Or /dev/dhc /mnt 这个时候,进入/mnt就可以看到光盘上的文件了
[root@www ~]# rpm -ivh /mnt/Server/createrepo-0.4.11-3.el5.noarch.rpm
warning: /mnt/Server/createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:createrepo ########################################### [100%]
[root@www ~]#
然后修改/etc/yum.repos.d/rhel-debuginfo.repo,把里面的内容修改成如下:
[root@mail mnt]# vi /etc/yum.repos.d/rhel-debuginfo.repo
[Cluster]
enabled = 1 //1表示repo中定义的源是启用的,0为禁用
name = Cluster //目录名称可自定义,在此我就把它定义为光盘中软件的目录名称
baseurl = file:///mnt/Cluster //把光盘挂载在哪个目录下面,此处就定义哪个目录
gpgcheck = 0 //表示这个repo中下载的rpm将进行gpg的校验,已确定rpm包的来源是有效和安全的,一般在此不启用
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release//定义用于校验的gpg密钥,当不启用的时候可以不定义该
url
[Server]
enabled = 1
name = Server
baseurl = file:///mnt/Server
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[ClusterStorage]
enabled = 1
name = ClusterStorage
baseurl = file:///mnt/ClusterStorage
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[VT]
enabled = 1
name = VT
baseurl = file:///mnt/VT
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
保存退出