已经配置好了 open
SUSE 11.3 操作系统。
现在,我们进入“GNOME 终端”,使用 ifconfig 命令验证一下本虚拟的 IP 地址就是一开始我们在宽带路由器中为它分配的静态地址。
ben@linux-nyhn:~> /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:51:5B:0B
inet addr:192.168.1.251 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe51:5b0b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:853 errors:0 dropped:0 overruns:0 frame:0
TX packets:807 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:853227 (833.2 Kb) TX bytes:90376 (88.2 Kb)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:22 errors:0 dropped:0 overruns:0 frame:0
TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1300 (1.2 Kb) TX bytes:1300 (1.2 Kb)
ben@linux-nyhn:~> sudo vim /etc/hosts
如上所示,再使用 vim 编辑器编辑 /etc/hosts 文件,增加一个域名 ben.skyiv.com,如下图所示:
注意上图中的 IP 地址必须是 127.0.0.1,而不能是 192.168.1.251。在宿主机的 Windows Vista 操作系统中以管理员身份进入命令提示符,使用记事本编辑 C:\Windows\System32\drivers\etc\hosts 文件,增加一个同样的域名 ben.skyiv.com,注意此时 IP 地址必须是 192.168.1.251,而不能是 127.0.0.1,如下图所示:
我们的 openSUSE 11.3 操作系统已经安装好了 apache 软件,但尚未启用,如下所示:
ben@linux-nyhn:~> sudo /sbin/service apache2 status
Checking for httpd2: unused
那么,现在,让我们设置 apache 为开机随系统启动,并且现在就启动它吧:
ben@linux-nyhn:~> sudo /sbin/chkconfig -add apache2
apache2 0:off 1:off 2:off 3:on 4:off 5:on 6:off
ben@linux-nyhn:~> sudo /sbin/service apache2 start
Starting httpd2 (prefork) done
ben@linux-nyhn:~> sudo /sbin/service apache2 status
Checking for httpd2: running