千家信息网

Linux制作httpd静态网页详细教程

发表于:2024-10-27 作者:千家信息网编辑
千家信息网最后更新 2024年10月27日,这篇文章主要讲解了"Linux制作httpd静态网页详细教程",文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习"Linux制作httpd静态网页详细教程"吧
千家信息网最后更新 2024年10月27日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 98    DocumentRoot "/var/www/html/wangzhang"    ServerName wz.example.comListen 99    DocumentRoot "/var/www/html/zhuawawa"    ServerName zww.example.comListen 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 98    DocumentRoot "/var/www/html/wangzhang"    ServerName wz.example.comListen 99    DocumentRoot "/var/www/html/zhuawawa"    ServerName zww.example.comListen 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 99    DocumentRoot "/var/www/html/wangzhang"    ServerName wz.example.com    DocumentRoot "/var/www/html/zhuawawa"    ServerName zww.example.comlHost 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 80    DocumentRoot "/var/www/html/wangzhang"    ServerName wz.example.com    DocumentRoot "/var/www/html/zhuawawa"    ServerName zww.example.comlHost *: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安全错误 数据库的锁怎样保障安全 医院金保网服务器要求 中小学生教育和网络安全视频 多web访问服务器sh 暴雪服务器服务器检索内容失败 湖州计算机网络技术应用 svn服务器管理软件 北京管理软件开发口碑推荐 丽台p4 只能装服务器 城市空气质量数据库 培训计算机网络技术有限公司 山口坳服务器 网络安全执法中处罚主体 济南华为软件开发云创新中心 软件开发项目管理系统平台 网络安全监测装置相关规定 无法还原数据库正在使用 网络安全逃生图是什么 阿里云数据库之间限速 普及网络安全知识目的 如何访问内网服务器端口号 中国科学技术学会阿里数据库 数据库中查询学生所在的学院 c#怎么连接网络数据库 软件开发 项目人员架构 医疗卫生网络安全事件 安装网络技术员怎么样 关系型数据库是什么数据库 数据库字段包含某一个字符串 两种建数据库的方法 象牙塔网络安全员平台
0