PHP 学习日志——httpd.conf

今日主要研究Apache 内的 httpd.conf 文件


#后面的内容是注释作用,是无效的。

ServerSignature On //服务器签名 开
ServerTokens Full //服务器令牌 所有


ServerRoot "D:/Program Files/wamp/bin/apache/apache2.4.9"

//阿帕奇服务器的根目录所在位置


Define APACHE24 Apache2.4

//定义 APACHE24与Apache2.4 一样


Listen 0.0.0.0:80
Listen [::0]:80

//允许所有IP地址访问本地的80端口


Listen 12.34.56.78:80

//只允许12.34.56.78这个IP地址访问我们的80端口


LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so

//调用默认的Apache 函数文件


LoadModule php5_module "D:/Program Files/wamp/bin/php/php5.5.12/php5apache2_4.dll"

//调用PHP的的函数库,解析网页上的PHP文件


ServerAdmin [email protected]

//管理员的Email地址


ServerName localhost:80
//服务器名称

HostnameLookups Off

//主机名访问停用


DocumentRoot "D:/Program Files/wamp/www/"

//默认网站存放位置


<Directory />
    AllowOverride none
    Require all denied
</Directory>

//是否允许访问路径,不允许所有,允许指定IP访问路径


<Directory "D:/Program Files/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.4/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:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Require all granted
</Directory>


//权限文件夹,只有放在"D:/Program Files/wamp/www/"的网站才是有权限访问的


<IfModule dir_module>
    DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>

//索引文件,当访问来到的时候,默认寻找这些文件返回结果,会依次查找上面的文件


ErrorLog "D:/Program Files/wamp/logs/apache_error.log"

//错误日志


CustomLog "D:/Program Files/wamp/logs/access.log" common

//访问日志


<IfModule alias_module>
   
    ScriptAlias /cgi-bin/ "D:/Program Files/wamp/bin/apache/apache2.4.9/cgi-bin/"

</IfModule>
//CGI 的访问配置文件,和CGI的具体位置

<IfModule cgid_module>
    #
    # ScriptSock: On threaded servers, designate the path to the UNIX
    # socket used to communicate with the CGI daemon of mod_cgid.
    #
    #Scriptsock cgisock
</IfModule>
//CGI的访问配置关系


<Directory "D:/Program Files/wamp/bin/apache/apache2.4.9/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>

//CGI的权限

<IfModule mime_module>

    TypesConfig conf/mime.types

    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz

    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3
//解析php、php3文件,使用php的数据和服务

</IfModule>

//在什么情况下,用什么样的解析方式



# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#自定义错误界面,出现404/500/402错误的时候访问后面的网页


# Virtual hosts
#Include conf/extra/httpd-vhosts.conf

//虚拟主机的配置文件


Include "D:/Program Files/wamp/alias/*"

//包含路径中的配置文件

你可能感兴趣的:(apache,PHP,注释,服务器)