正在加载图片...
《操作系统》实验指导书/实验三:网站服务器 ##第一个网站使用80端口,其网站使用域名为www.yl.com Servernamewww.yi.com DocumentRoot /var/www/html Options FollowSymLinks AllowOverride All Require all granted </Directory> </irtualHost> Server Admin root@localhost ##第二个网站使用80端口,其网站使用域名为www.twocom Servernamewww.twocom DocumentRoot /var/www/html <Directory"/var/www/html Options FollowSymLinks AllowOverride All </Directory> </irtualHost> ②服务重启 完成配置文件编辑后,需重启httd服务,其操作命令如下。 #systemctirestarthttpd ③ hosts配置 编辑本地 hosts文件,其文件路径为C: Windows System32 driversletc hosts, hosts文件 增加内容如图3-12所示 172.16.124.187www 172.16,124,187www, 图3-12修改本地 hosts文件 ④测试访问 在本地浏览器中分别输入两个网站的地址:htt/www.yi.com/test.html、htp/www.two. com/ test html,验证域名发布网站是否生效,访问结果如图3-13、3-14所示。 <cowww.yi.com/test.htm ☆ 这是第一个网页 图3-13通过 Www.yl. com域名访问 这是第二个网页 图3-14通过www.two.com域名访问 信息管理与信息系统教研室/阮晓龙/13938213680/共11页,第7页《操作系统》实验指导书 / 实验三:网站服务器 信息管理与信息系统教研室 / 阮晓龙 / 13938213680 / 共 11 页,第 7 页 ##第一个网站使用 80 端口,其网站使用域名为 www.yi.com ServerName www.yi.com DocumentRoot /var/www/html <Directory "/var/www/html"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> ServerAdmin root@localhost ##第二个网站使用 80 端口,其网站使用域名为 www.two.com ServerName www.two.com DocumentRoot /var/www/html1 <Directory "/var/www/html1"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> ②服务重启 完成配置文件编辑后,需重启 httpd 服务,其操作命令如下。 # systemctl restart httpd ③hosts 配置 编辑本地 hosts 文件,其文件路径为 C:\Windows\System32\drivers\etc\hosts,hosts 文件 增加内容如图 3-12 所示。 ④测试访问 在本地浏览器中分别输入两个网站的地址:http://www.yi.com/test.html、http://www.two. com/test.html,验证域名发布网站是否生效,访问结果如图 3-13、3-14 所示。 图 3-13 通过 www.yi.com 域名访问 图 3-14 通过 www.two.com 域名访问 图 3-12 修改本地 hosts 文件
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有