Web网站服务

1章 Web网站服务
【实验拓扑】
在这里插入图片描述
【需求描述】
1.编译安装httpd服务器,要求支持动态模块扩展、地址重写、多字符集。
2.网站名臣设置为www.benet.com,默认首页设置为index.html和index.php。

【实验步骤】
一.将CentOS01配置为Web服务器,编译安装httpd软件包。
1.挂载光盘
[root@centos01 ~]# mount /dev/cdrom /mnt/
2.将源码程序包解压到指定目录中“/usr/src/”并进入
[root@centos01 ~]# tar zxvf /mnt/httpd-2.2.17.tar.gz -C /usr/src/
3.配置Apache。
[root@centos01 httpd-2.2.17]#./configure --prefix=/usr/local/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi
4.编译和安装。
[root@centos01 httpd-2.2.17]# make && make install
5.查看是否安装成功,存在创建目录证明成功。
[root@centos01 ~]# ls -ld /usr/local/httpd/

二.配置并启动httpd服务器。
1.优化Apache命令
[root@centos01 ~]# ln -s /usr/local/httpd/bin/* /usr/local/bin/
2.检查配置文件的完成性
[root@centos01 ~]# apachectl -t
3.生成Apache服务器控制文件添加执行权限。
[root@centos01 ~]# cp /usr/local/httpd/bin/apachectl /etc/init.d/httpd
[root@centos01 ~]# chmod +x /etc/init.d/httpd
4.修改Apache服务控制文件。
[root@centos01 ~]# vim /etc/init.d/httpd
在这里插入图片描述

5.添加系统服务设置开机自启。
在这里插入图片描述

6.启动apache服务
[root@centos01 ~]# systemctl start httpd
7.检查端口号是否启动。
[root@centos01 ~]# netstat -anpte | grep 80

8 .更改网卡文件
[root@centos01 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
在这里插入图片描述

三.CentOS02配置DNS服务器。

  1. 挂在光盘
    [root@centos01 ~]# mount /dev/cdrom /mnt/
    2.安装
    [root@centos01 ~]# yum -y install bind bind-utils bind-chroot
    3.备份主配置文件
    [root@centos01 ~]#cp /etc/named.conf /etc/named.conf.bak
    4 . 清空主配置文件
    [root@centos01 ~]#echo “” /etc/named.conf
    5.配置主配置文件
    [root@centos01 ~]# vim /etc/named.conf
    在这里插入图片描述

6 .配置benet.com.zone文件
[root@centos01 ~]# vim /var/named/benet.com.zone
在这里插入图片描述

7 . 更改网卡文件
[root@centos01 ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
在这里插入图片描述

验证:客户端配置IP地址和DNS
客户端 http;//192.168.100.10
www.benet.com
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值