Linux制作httpd静态网页详细教程
发表于:2025-11-14 作者:千家信息网编辑
千家信息网最后更新 2025年11月14日,这篇文章主要讲解了"Linux制作httpd静态网页详细教程",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Linux制作httpd静态网页详细教程"吧
千家信息网最后更新 2025年11月14日Linux制作httpd静态网页详细教程
这篇文章主要讲解了"Linux制作httpd静态网页详细教程",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Linux制作httpd静态网页详细教程"吧!
目录
1.利用仓库创建httpd lrzsz unzip文件
2.对源码文件进行解压
3.配置httpd-vhosts.conf的3种方法
方法1:(相同IP,不同端口号配置)
方法2:(不同IP,相同端口号配置)
方法3:(相同IP,相同端口号,不同域名)
1.利用仓库创建httpd lrzsz unzip文件
1.挂载[root@clq0917 ~]# mount /dev/cdrom /mnt/mount: /dev/sr0 写保护,将以只读方式挂载写配置文件[root@clq0917 ~]# vi /etc/yum.repos.d/aa.repo[aa]name=sssaaabaseurl=file:///mntgpgcheck=0enabled=1 按下ESC键,输入:x保存 清理仓库 [root@clq0917 ~]# yum clean all 元数据建立 [root@clq0917 ~]# yum makecache2.安装[root@clq0917 ~]# yum -y install httpd[root@clq0917 ~]# yum -y install lrzsz [root@clq0917 ~]# yum -y install httpd[root@clq0917 ~]# yum -y install unzip
2.对源码文件进行解压

[root@clq0917 ~]# cd /var/www/html加文件[root@clq0917 html]# rz解压[root@clq0917 html]# unzip wangzhang.zipmv (解码数据)+名字(wangzhang)[root@clq0917 html]# unzip zhishaizi.zipmv (解码数据)+名字(zhishaizi)[root@clq0917 html]# unzip zhuawawa.zipmv (解码数据)+名字(zhuawawa)删掉不用的[root@clq0917 html]# rm -rf zhuawawa.zip[root@clq0917 html]# rm -rf wangzhang.zip[root@clq0917 html]# rm -rf zhishaizi.zip查看:[root@clq0917 html]# lswangzhang zhishaizi zhuawawa
3.配置httpd-vhosts.conf的3种方法
1.[root@clq0917 html]# vi httpd-vhosts.conf Listen 98DocumentRoot "/var/www/html/wangzhang" ServerName wz.example.com Listen 99DocumentRoot "/var/www/html/zhuawawa" ServerName zww.example.com Listen 100lHost *:100> DocumentRoot "/var/www/html/zhishaizi" ServerName zsz.example.com刷新一下:[root@clq0917 html]# systemctl restart httpd[root@qn conf.d]# ss -antlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 0.0.0.0:22 0.0.0.0:* LISTEN 0 128 *:98 *:* LISTEN 0 128 *:99 *:* LISTEN 0 128 *:100 *:* LISTEN 0 128 [::]:22 [::]:*看到98 99 和100端口号就表示成功了。
方法1:(相同IP,不同端口号配置)
1.[root@clq0917 html]# vi httpd-vhosts.conf Listen 98DocumentRoot "/var/www/html/wangzhang" ServerName wz.example.com Listen 99DocumentRoot "/var/www/html/zhuawawa" ServerName zww.example.com Listen 100lHost *:100> DocumentRoot "/var/www/html/zhishaizi" ServerName zsz.example.com刷新一下:[root@clq0917 html]# systemctl restart httpd[root@qn conf.d]# ss -antlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 0.0.0.0:22 0.0.0.0:* LISTEN 0 128 *:98 *:* LISTEN 0 128 *:99 *:* LISTEN 0 128 *:100 *:* LISTEN 0 128 [::]:22 [::]:*看到98 99 和100端口号就表示成功了。
百度搜索:
192.168.174.131:98
192.168.174.131:99
192.168.174.131:100
效果图:
方法2:(不同IP,相同端口号配置)
1.配置IP地址[root@clq0917 html]# ip addr add 192.168.174.175/24 dev ens33[root@clq0917 html]# ip addr add 192.168.174.176/24 dev ens33[root@clq0917 html]# vi httpd-vhosts.conf Listen 99DocumentRoot "/var/www/html/wangzhang" ServerName wz.example.com DocumentRoot "/var/www/html/zhuawawa" ServerName zww.example.com lHost 192.168.174.176:99> DocumentRoot "/var/www/html/zhishaizi" ServerName zsz.example.com刷新一下:[root@clq0917 html]# systemctl restart httpd[root@qn conf.d]# ss -antlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:99 *:* *:* LISTEN 0 128 [::]:22 [::]:*看到 99端口号就表示成功了。
百度搜索:
192.168.174.131:99
192.168.174.175:99
192.168.174.176:99
效果图:

方法3:(相同IP,相同端口号,不同域名)
1.[root@clq0917 html]# vi httpd-vhosts.conf Listen 80DocumentRoot "/var/www/html/wangzhang" ServerName wz.example.com DocumentRoot "/var/www/html/zhuawawa" ServerName zww.example.com lHost *:80> DocumentRoot "/var/www/html/zhishaizi" ServerName zsz.example.com刷新一下:[root@clq0917 html]# systemctl restart httpd[root@qn conf.d]# ss -antlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 0.0.0.0:22 0.0.0.0:* LISTEN 0 128 *:80 *:* 看到80端口号就表示成功了。进入C盘的C:\Windows\System32\drivers\etc目录下,把hosts文件拖到桌面上并用写字板打开,加入以下内容并保存192.168.174.131 wz.example.com zww.example.com zsz.example.com把桌面上的hosts文件拖回C:\Windows\System32\drivers\etc目录下,打开CMD,输入 ping zww.example.com看是否能通然后在浏览器上用域名访问
hosts:
cmd:
感谢各位的阅读,以上就是"Linux制作httpd静态网页详细教程"的内容了,经过本文的学习后,相信大家对Linux制作httpd静态网页详细教程这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是,小编将为大家推送更多相关知识点的文章,欢迎关注!
口号
相同
文件
方法
配置
不同
教程
网页
静态
制作
成功
数据
仓库
内容
名字
域名
目录
学习
效果
效果图
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
网络安全竞赛主持
hadoop能当做数据库吗
怎么写网络安全学习心得呢
本地连接dns服务器
网络安全的实质和关键是
深圳市破茧网络技术怎么样
视易服务器桌面壁纸
手机网络安全黑板报图片
为数字化地图建立地理数据库
常用空间数据库技术
表格中禁止输入重复数据库
一键删除数据库缓存
陕西省家庭教育网络安全
辽宁软件开发定制服务价格
供电公司组织网络安全宣传
玉溪软件开发费用
在网络技术中什么是拓扑学
建立简历邀约数据库
db2数据库配置查询数据量
哪个时序数据库好
文件上传服务器报500
cisg网络安全
温州水电费缴费软件开发团队
潢川县网络安全
中国网网络技术
腾讯会议的服务器在哪国
app网络技术公司
疾风之刃选择服务器
5g车联网的数据库处理
绵阳打卡软件开发