PHP中,Apache的配置至关重要,特别是httpd.conf这个文件,它是Apache中的核心文件。好了,废话不说,今天将这个文件中的一些内容讲解一番。

ServerRoot "d:/wamp/bin/apache/apache2.2.21"                   //这个文件表示的是服务器,本地就是Apache,在计算机                                                                                                  中的位置

Listen 80                                                                                //这里表示监听的端口号,这里是80

LoadModule actions_module modules/mod_actions.so      //表示的加载的模型,这个表示的是action

LoadModule alias_module modules/mod_alias.so            //需要加载的模型,这里的这个表示需要加载的虚拟目录

其他的加载模块也是类似的

User daemon                                                                    //用户进程

Group daemon                                                                 //

这两个其实也没有什么,原文解释:

If you wish httpd to run as a different user or group, you must run  httpd as root initially and it will switch.

User/Group: The name (or #number) of the user/group to run httpd as.

把它理解成进程就行。

ServerAdmin        admin@localhost                               //服务器管理员的邮件地址,这里可以设置为你的有效邮件地址,这样的话,有什么问题就能发到你的邮箱中去提醒你

ServerName localhost:80                                              //服务器的用户名和对应的端口号

DocumentRoot "d:/wamp/www/"                                    //这个目录下放的是我们编写的程序,然后通过localhost就能访问。例如,我在这个www目录下,有一个test.php .那么我就可以通过www.localhost/test.php或者是

www.127.0.0.1/test.php去访问(别忘了开启Apache)。当然你也可以把它改为其他目录。一般不建议改动。

如果改了上面那个文件夹,那么这个下面的文件夹也需要进行改正


<Directory "d:/wamp/www/">

    #

    # 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 Indexes 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.

    #

#   onlineoffline tag - don't remove

    Order Deny,Allow

    Deny from all

    Allow from 127.0.0.1

</Directory>

文件夹改正之后,其它的就不需要改

ErrorLog "d:/wamp/logs/apache_error.log"                                     //这个是记录错误的日志以及它在计算机的位置

LogLevel warn

<IfModule log_config_module>

    #

    # The following directives define some format nicknames for use with

    # a CustomLog directive (see below).

    #

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>

      # You need to enable mod_logio.c to use %I and %O

      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

    </IfModule>

    #

    # The location and format of the access logfile (Common Logfile Format).

    # If you do not define any access logfiles within a <VirtualHost>

    # container, they will be logged here.  Contrariwise, if you *do*

    # define per-<VirtualHost> access logfiles, transactions will be

    # logged therein and *not* in this file.

    #

    CustomLog "d:/wamp/logs/access.log" common

    #

    # If you prefer a logfile with access, agent, and referer information

    # (Combined Logfile Format) you can use the following directive.

    #

    #CustomLog "logs/access.log" combined

</IfModule>

这个里面是关于错误的一些配置,可以不作了解

Include "d:/wamp/alias/*"                                            //将alias目录下的文件包含进来,alias里面也可以放我们编写的程序,但需要进行修改

Apache中httpd.conf文件的详解的更多相关文章

  1. Apache 中httpd.conf文件配置详解(转载)

    httpd.conf文件配置详解   Apache的基本设置主要交由httpd.conf来设定管理,我们要修改Apache的相关设定,主要还是通过修改httpd.cong来实现.下面让我们来看看htt ...

  2. apache httpd.conf 文件的 详解

    文章 摘自 :http://www.php100.com/html/webkaifa/apache/2009/0418/1192.html   ServerRoot /usr/local Server ...

  3. Apache2 httpd.conf配置文件中文版详解

    Apache2 httpd.conf配置文件中文版详解## 基于 NCSA 服务的配置文件.##这是Apache服务器主要配置文件.#它包含服务器的影响服务器运行的配置指令.#参见以取得关于这些指令的 ...

  4. Apache 查找httpd.conf文件

    Linux下查找httpd.conf文件 $ find / -name httpd.conf  

  5. sysctl.conf文件配置详解

    ############################# net.inet.ip.sourceroute=0 net.inet.ip.accept_sourceroute=0 ########### ...

  6. Ubuntu14.04下编译安装或apt-get方式安装搭建Apache或Httpd服务(图文详解)

    不多说,直接上干货! 写在前面的话 对于 在Ubuntu系统上,编译安装Apache它默认路径是在/usr/local/apache2/htdocs 或者编译安装httpd它默认路径是在/usr/lo ...

  7. PostgreSQL.conf文件配置详解[转]

    一.连接配置与安全认证 1.连接Connection Settings   listen_addresses (string) 这个参数只有在启动数据库时,才能被设置.它指定数据库用来监听客户端连接的 ...

  8. Redis中redis.conf里面配置详解

    是否将redis设置为守护程序,默认为no daemonize yes   如果设置为守护程序,需要指定pid文件 pidfile /var/run/redis/redis-server.pid   ...

  9. grub.conf文件参数详解

    Grub是Linux的下系统启动器之一(另一个名为Lilo),grub.conf相当于 windows下的boot.ini,都是存放启动项设置和信息的,如果你熟悉boot.ini的设置的话相信也可以很 ...

随机推荐

  1. Pytorch1.0入门实战一:LeNet神经网络实现 MNIST手写数字识别

    记得第一次接触手写数字识别数据集还在学习TensorFlow,各种sess.run(),头都绕晕了.自从接触pytorch以来,一直想写点什么.曾经在2017年5月,Andrej Karpathy发表 ...

  2. [转]Node.js中koa使用redis数据库

    本文转自:https://blog.csdn.net/offbye/article/details/52452322 Redis是一个常用的Nosql数据库,一般用来代替Memcached做缓存服务, ...

  3. 记录Newtonsoft.Json的日常用法

    最近在做一个使用基于.net mvc 实现前后台传输Json的实例.网上找了一些资料.发现在开发的时候,许多的数据交互都是以Json格式传输的.其中涉及序列化对象的使用的有DataContractJs ...

  4. 腾讯防水墙(滑动验证码)的简单使用 https://007.qq.com

    在线体验:https://007.qq.com/online.html 快速开始:https://007.qq.com/quick-start.html 简单使用: 1. 引入 JS <scri ...

  5. Flask 系列之 LoginManager

    说明 操作系统:Windows 10 Python 版本:3.7x 虚拟环境管理器:virtualenv 代码编辑器:VS Code 实验目标 通过使用 flask-login 进行会话管理的相关操作 ...

  6. gulp解决跨域的配置文件

    //引入插件 var gulp = require('gulp'); // var Proxy = require('gulp-connect-proxy'); var connect = requi ...

  7. blfs(systemd版本)学习笔记-构建google-chrome浏览器

    我的邮箱地址:zytrenren@163.com欢迎大家交流学习纠错! 一.google-chrome浏览器官网下载地址 我只找到了deb包和rpm包的下载地址 1.https://dl.google ...

  8. C#基础(201)--常量枚举

    本文知识点: 1.掌握常量的定义和使用方法 2.理解枚举的作用和特点 3.掌握枚举的使用方法 1.1.常量的定义语法 const  数据类型   常量名称  =  值: 1.2.常见错误 1.3常量的 ...

  9. 2018-08-13 中文编程讨论组(GitHub)社区守则一周年修订

    原址在此 社区守则 大原则 求同存异 就事论事 己所不欲勿施于人 注: 在讨论组成立一周年之际, 对行为规范进行一些细化 内 这部分所有内容同样适用于对外 回归技术 所有与中文编程没有直接关系的话题都 ...

  10. ThreadPoolExecutor 线程池的源码解析

    1.背景介绍 上一篇从整体上介绍了Executor接口,从上一篇我们知道了Executor框架的最顶层实现是ThreadPoolExecutor类,Executors工厂类中提供的newSchedul ...