zoukankan      html  css  js  c++  java
  • Apache搭建简单的图片访问服务器

    安装apache后,修改httpd.conf文件

    将根目录修改为你图片所在目录

    DocumentRoot有这么一行,修改成你要指向的路径
    DocumentRoot "/yang/pic"  我的路径

    再修改一下 Directory的路径 要求和上边的一致

    <Directory "/yang/pic">
    
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes  FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
        Options  FollowSymLinks
    
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
        AllowOverride all
    
    #
    # Controls who can get stuff from this server.
    #
        Order allow,deny
        Allow from all
    
    </Directory>

    接下来是权限的设置,因为完成上边的设置后,如果访问你的图片路径,是能够看到目录下所有图片等文件的。

    所以要求他不能访问路径

    进入apache的配置文件 httpd.conf 找到: 在 配置访问目录处设置

    Options Indexes FollowSymLinks
    修改为:
    Options FollowSymLinks
    

    这样在 yang/pic 目录下的图片 就可以通过地址访问了

    一般默认的端口为80,可以通过配置文件修改,

    Listen 81   找到这个位置,我改成了81端口
  • 相关阅读:
    关于字体单位em的问题
    键盘按钮keyCode大全
    右侧导航栏(动态添加数据到list)
    当前页面点击取到值
    前端写分页(用了自己同事写的插件)
    选择控件js插件和使用方法
    Form表单验证
    前端页面跳转并取到值
    App配置页面头部
    json字符串、json对象、数组之间的转换
  • 原文地址:https://www.cnblogs.com/wanyong-wy/p/10435425.html
Copyright © 2011-2022 走看看