搭建web网站

实验一:基于端口8909搭建web网站 内容为“小胖,你咋这么胖!!!”

操作过程:

1. 挂载 (采取本地安装,先挂载)
[[email protected] ~]# mount /dev/sr0 /mnt
mount: /dev/sr0 is write-protected, mounting read-only
2. 安装软件包

[[email protected] ~]# vim /etc/yum.repos.d/base.repo
[base] ( yum源仓库的配置、检查)
name=base
baseurl=file:///mnt
gpgcheck=0
enable=1
[[email protected] ~]# yum install httpd -y
搭建web网站
3. 启用服务
[[email protected] ~]# systemctl start httpd
查看服务启停状况
[[email protected] ~]# systemctl status httpd
搭建web网站
4. 关闭防火墙 关闭selinux
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# setenforce 0

5.编辑子配置文件:vim /etc/httpd/conf.d/meimei.conf
搭建web网站
6.创建/aaa 写入网页内容
搭建web网站
搭建web网站
7.重启服务并测试

搭建web网站

实验二:.要求搭建web服务器,创建基于域名的虚拟主机,能够使用www.xiaopang.com和www.dapang.com访问各自的网站网站存放路径分别为/xiaopang和/dapang

操作过程:
1. 编辑子配置文件:vim /etc/httpd/conf.d/meimei.conf
搭建web网站
2.创建目录xiaopang和dapang并写入网站内容
搭建web网站
3.关闭防火墙:systemctl stop firewalld
停止selinux:setenforce 0
重启服务:systemctl restart httpd

搭建web网站
4.修改Linux的dns解析的数据库文件:vim /etc/hosts
搭建web网站

5. 修改windows下的数据库文件:C/windows/system32/drivers/etc/hosts
同Linux相似
搭建web网站

6.测试搭建web网站搭建web网站