zoukankan      html  css  js  c++  java
  • Apache下的配置文件httpd.conf、httpd-vhosts.conf 转

    Apache下的配置文件httpd.conf、httpd-vhosts.conf(windows)

    2013-05-24 22:09 by youxin, 58 阅读, 0 评论, 收藏, 编辑

    httpd.conf文件一般存在于apache目录下的conf文件夹中,主要用来配置apache的。
    http.conf里面的配置介绍:

    1、Listen :监听端口,默认情况是80。
    2、ServerAdmin :服务器管理员邮箱。
    3、ServerName:服务名。
    4、DocumentRoot:PHP网站的路径。
    5、<Directory />
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
      </Directory>
    Apache访问的每个目录可设置相关的服务和特性是允许或(和)不允许。
    一般修改为,否则可能会出现403页面错误。
    <Directory />
        Options FollowSymLinks
        AllowOverride None
      </Directory>

    同时修改PHP的目录:
    修改DocumentRoot和<Directory "D:/Program Files/xampp/htdocs">。
    修改为PHP的网站所在的目录,如下所示:
     
    查看问题的方法:
    运行dos,输入“cd  /d  F:/xampplite/apache/bin” ,进入到xampp的bin目录,输入httpd.exe就可以查看错误。
    常见问题
    1、ServerRoot没配置好,可以使用绝对路径
    2、document没配置好,网站路径没配置好
    3、httpd-vhosts.conf没配置好,配置参考如下

    <VirtualHost *:80>
        ServerName   localhost
        DocumentRoot  F:/Web/public

        RewriteEngine off

        <Location />
            RewriteEngine on
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule !.(js|ico|gif|jpg|png|css)$ /index.php
        </Location>
       
        <Directory F:/xampplite/htdocs>
            Options Indexes FollowSymLinks
            AllowOverride All
            Order allow,deny
            Allow from all
        </Directory>
       
    </VirtualHost>
    如果没有权限的话,在httpd.conf还增加一个:

    <Directory "F:/同步文件夹/百度云同步盘/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
    </Directory>


    转自:http://blog.sina.com.cn/s/blog_6721f25c0100m3yy.html
  • 相关阅读:
    AS2 tween缓动
    flash 绑定 swc类文件
    jsfl自运行与被调运行
    一键清除fla文件中的TLF文本
    as 2的 Event.REMOVED_FROM_STAGE
    jsfl 添加代码
    jsfl 删除库指定内容
    文件上传待研究
    SpringMVC单文件上传、多文件上传、文件列表显示、文件下载
    shiro配置参考(二)可以和mybatis的配置放在一个文件中(不建议这样,可以拆分开来,注意相关配置即可)
  • 原文地址:https://www.cnblogs.com/zhang36/p/4931567.html
Copyright © 2011-2022 走看看