当前位置: 首页 > news >正文

想学会网站建设要会什么装修3d效果图怎么制作

想学会网站建设要会什么,装修3d效果图怎么制作,怎么做直播网站的超管,西安城市建设职业学院官方网站提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 目录 Web服务解析 虚拟Web主机 Web目录访问控制 Web服务解析 用途:基于 B/S 架构提供网页的服务端程序 应用层协议:HTTP(TCP 80…

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录

  • 目录

    Web服务解析

    虚拟Web主机

    Web目录访问控制


    Web服务解析

  • 用途:基于 B/S 架构提供网页的服务端程序

    应用层协议:HTTP(TCP 80)

    软件包(S):httpd

    软件包(B):firefox、IE、curl

    检查配置语法:httpd -t

    如何访问一个网站(URL) —— Uniform Resource Locator,网址(统一资源定位器)

    http://www.baidu.com/

    http://music.baidu.com/mp3/huluwa.mp3

    协议名://服务器地址:端口/目录路径/文件

    服务器默认网页从哪来 ——

    网页根目录: /var/www/html/

    配置文件:/etc/httpd/conf/httpd.conf

    /etc/httpd/conf.d/*.conf

    默认首页:index.html

    httpd.conf基础设置 ——

    Listen  "监听地址:端口"

    DocumentRoot    "网页根目录的绝对路径"

    DirectoryIndex  "网站目录下默认提供的第一个网页(首页)的名称"

    ServerName  "网站的FQDN完整域名"

    ServerAlias "网站域名的别名"

    ServerAdmin "网站管理员的电子邮箱地址"

    为 server 快速部署Web服务

    1)装包

    [root@server ~]# dnf  -y  install  httpd

    2)配置

    [root@server ~]# vim /etc/httpd/conf/httpd.conf

    ServerAdmin  webmaster@example.com        //设置网站管理邮箱

    [root@server ~]# echo  'Hello Class!'  > /var/www/html/index.html    //创建默认首页

    3)起服务

    [root@server ~]# firewall-cmd --permanent  --add-service=http

    [root@server ~]# firewall-cmd --reload

    [root@server ~]# systemctl  enable  httpd  --now

    4)从浏览器访问网页

    [client]# curl  http://server.lab.example.com/

    Hello Class!

    访问Web站点时,服务器端给出的常见反馈:

    ++ HTTP OK(200),网页正常响应

    ++ Not Found(404),浏览器请求的网页没找到(真的没这个文件,或者URL网址错了)

    ++ Forbbiden(403),拒绝提供xx网页

    虚拟Web主机

    含义:在一台httpd服务器上提供多个不同的站点

    基于域名的虚拟主机:

    http://server.lab.example.com

    http://web1.lab.example.com

    一旦启用虚拟Web主机以后 ——

    1. 全局配置当中的DocumentRoot和ServerName会被忽略

    2. 如果客户机请求的URL不属于任何一个已知的虚拟站点,那么使用第一个虚拟站点做回应

    配置要点:

    <VirtualHost  *:80>

    ServerName   web1.example.com

    ServerAlias  example.com

    DocumentRoot  /var/www/web1

    CustomLog  "logs/web1-vhost.log"  combined

    ServerAdmin  web1-admin@example.com

    </VirtualHost>

    练习:在 server 上配置虚拟Web主机

    !!!! 当浏览器请求 http://web1.lab.example.com/时,页面显示 "web1"

    !!!! 当浏览器请求 http://server.lab.example.com/时,页面显示 "Coming Soon!"

    1)准备网页目录

    [root@server ~]# mkdir -p /srv/{default,web1}/www

    [root@server ~]# echo 'Coming Soon!' > /srv/default/www/index.html

    [root@server ~]# echo 'web1' > /srv/web1/www/index.html

    [root@server ~]# restorecon -Rv /srv/

    2)配置虚拟Web主机

    [root@server ~]# vim  /etc/httpd/conf.d/vhosts.conf

    <VirtualHost _default_:80>

    ServerName  server.lab.example.com

    DocumentRoot  /srv/default/www

    </VirtualHost>

    <VirtualHost *:80>

    ServerName  web1.lab.example.com

    ServerAlias  lab.example.com

    DocumentRoot  /srv/web1/www

    </VirtualHost>

    <Directory /srv/*/www>

    Require all granted

    </Directory>

    [root@server ~]# systemctl restart httpd

    3)从客户机访问虚拟Web主机

    [client]# vim  /etc/hosts

    192.168.4.98   server.lab.example.com  server  web1.lab.example.com  lab.example.com

    [client]# curl  http://web1.lab.example.com/

    web1

    [client]# curl  http://lab.example.com

    web1

    [client]# curl  http://server.lab.example.com/

    Coming Soon!

    [client]# curl  http://192.168.4.98/

    Coming Soon!

    Web目录访问控制

    Web目录访问的受控因素:

    ++ 基本权限rwx + ACL权限 + 运行用户(apache)

    ++ SELinux策略(目录角色 -t  httpd_sys_content_t、端口开放 http_port_t)

    # chcon  -R  -t  httpd_sys_content_t  /web1new/

    或者

    # semanage fcontext -a -t httpd_sys_content_t  '/web1new(/.*)?'

    # restorecon  -Rv  /web1new/

    ++ 服务配置策略(httpd.conf ==> <Directory  .....>)

    禁止任何人访问根目录(默认设置)

    <Directory />

    AllowOverride none

    Require all denied

    </Directory>

    允许任何人访问

    <Directory  目录路径>

    Require all granted

    </Directory>

    只允许个别网络或IP地址访问

    <Directory  目录路径>

    Require  ip  IP地址  网段IIP .. ..

    </Directory>

    获取httpd配置手册 ——

    # dnf  -y  install  httpd-manual

    # systemctl  restart  httpd

    # firefox  http://server.lab.example.com/manual/

    练习:调整 server 网站目录授权

    ++ 为站点 server.lab.example.com 的网页目录下创建子目录 private

    ++ 在 private 子目录下部署网页 index.html

    ++ 只允许从 server 本机或 serverb 的浏览器访问 private 目录及网页

    ++ 禁止其他任何主机访问 private 子目录

    关键配置:

    [root@server ~]# vim  /etc/httpd/conf.d/vhosts.conf

    <VirtualHost  *:80>

    ServerName  server.lab.example.com

    DocumentRoot  /srv/default/www

    </VirtualHost>

    <Directory /srv/*/www>

    Require all granted

    </Directory>

    <Directory  /srv/default/www/private>

    Require ip 127.0.0.1  192.168.4.98  192.168.4.101

    </Directory>

    [root@server ~]# systemctl  restart  httpd

http://www.dtcms.com/a/472359.html

相关文章:

  • ps做网站界面金马国旅网站建设分析
  • 儿童做的小游戏下载网站网站的建设费用预算策划书
  • 六种常见的网站类型帮他人做视频网站违法吗
  • 蛋糕网站内容规划wordpress widget logic
  • python - 第二天
  • 罗湖商城网站建设哪家服务周到wordpress快速注册
  • 河北手机响应式网站建设设计创意产品设计及介绍
  • 怎么建立简单网站高端酒店网站模板
  • 网站备案单位查询系统百度推广售后服务电话
  • 企业网站定制网站备案被删除
  • 做付费网站自己的网站怎么做关键词优化
  • 重庆永川网站建设建设网站的申请信用卡分期付款
  • 做报名网站北京网站seo优化推广
  • 社保网站是每月1-6号都是在建设中的吗互联网金融p2p网站建设模板
  • 网站备案准备资料建设一个网站的流程
  • 做网站 视频山东建站管理系统
  • 网站建设域名未拿到目前最流行网站开发软件
  • 企业网站建设的方法有哪些直播软件排行榜2020
  • 提供网站建设小程序制作网站做授权登录
  • 做网站挣钱快吗辽宁省建设工程信息网a类业绩
  • 温州外贸网站建设公司网站需求表格
  • 百度不收录网站文章沙河做网站
  • 好用的快速网站建设平台上海建设摩托车科技有限公司官网
  • 什么是网络营销?它包括了哪些主要环节?北京网站推广优化
  • 可视化信息 网站做网站租服务器一年多少钱
  • Linux系统函数与C++标准库函数在文件操作中的对比分析
  • wordpress名站网站seo优化方案设计
  • 网站首页面设计网站如何优化排名软件
  • 网站怎样防止攻击江门网站如何制作
  • Micro850 控制器实战:功能模块解析与 CCW 组态全流程