GVKun编程网logo

PHP的-Wamp服务器:更改httpd.conf的Apache?(wampserver 如何更换php版本)

9

关于PHP的-Wamp服务器:更改httpd.conf的Apache?和wampserver如何更换php版本的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于Apache2.4.8的htt

关于PHP的-Wamp服务器:更改httpd.conf的Apache?wampserver 如何更换php版本的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于Apache 2.4.8的httpd.conf的配置信息、Apache HTTP服务器 2.2.12 发布、apache struts2 Apache2 httpdconf 中文版、apache 的 /etc/httpd/conf/httpd.conf 和 /usr/local/apache2/conf/httpd.conf 区别等相关知识的信息别忘了在本站进行查找喔。

本文目录一览:

PHP的-Wamp服务器:更改httpd.conf的Apache?(wampserver 如何更换php版本)

PHP的-Wamp服务器:更改httpd.conf的Apache?(wampserver 如何更换php版本)

我正在尝试用我的错误解决错误,我无法从服务器连接到我的android应用程序.

所有消息来源都将我引向following tutorial作为解决方案.

除了以下方面,我已经成功完成了本教程中的所有步骤:

编辑Wamp服务器的httpd.conf文件

即本教程指示以下内容:

4.在httpd.conf文件中找到此配置部分:

Directory “c:/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

现在,找到“ 127.0.0.1”并将其替换为“全部”,保存文件并重新启动wamp服务器.

但是,我的问题是我的httpd.conf文件中没有此代码.我的相应部分如下所示:

<Directory "c:/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>

我可以在代码中进行哪些更改以解决此问题?

一个解决方案将不胜感激,我已经被服务器问题困扰了一个多星期:(

解决方法:

知道这是古老的,但是它可以免除我尝试修复“禁止的国王错误”时遇到的压力,这使我在Google上摸不着头脑……多数民众赞成在403错误的情况下,如果您错误地认为自己一无所知我在说如果您这样做,那简直太棒了,而且很热!
     *点击系统任务栏上的WAMP服务器图标(假设您使用的是Windows),然后-> Apache-> httpd.vhosts.conf [打开“ httpd.vhosts.conf”文件]
    *并将“目录”标记(…)中的“需要本地”更改为“需要全部授予”
这应该是您要寻找的炸弹!
*再次单击WAMP图标,然后重新启动所有服务,然后最后进入“联机”状态.总而言之,你一切都好!

N.B
   这绝对对您4有用,尤其是在按照有关如何通过修改防火墙设置(即通过添加新规则)并按照说明修改httpd.conf文件的方式将Android设备连接到Wamp服务器的在线教程之后,获取“禁止的错误”代号-403.

Apache 2.4.8的httpd.conf的配置信息

Apache 2.4.8的httpd.conf的配置信息

httpd -v查看配置信息的

#
# This is the main Apache HTTP server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see 
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They''re here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# Configuration and logfile names: If the filenames you specify for many
# of the server''s control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/foo_log"
# with ServerRoot set to "/Applications/MAMP/Library" will be interpreted by the
# server as "/Applications/MAMP/Library/logs/foo_log".

#
# ServerRoot: The top of the directory tree under which the server''s
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to point the LockFile directive
# at a local disk.  If you wish to share the same ServerRoot for multiple
# httpd daemons, you will need to change at least LockFile and PidFile.
#
ServerRoot "/Applications/MAMP/Library"

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
<IfModule !mpm_netware.c>
PidFile logs/httpd.pid
</IfModule>

#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 8888

#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule'' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l'') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_dbd_module modules/mod_authn_dbd.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so
LoadModule dbd_module modules/mod_dbd.so
LoadModule bucketeer_module modules/mod_bucketeer.so
LoadModule dumpio_module modules/mod_dumpio.so
LoadModule echo_module modules/mod_echo.so
LoadModule case_filter_module modules/mod_case_filter.so
LoadModule case_filter_in_module modules/mod_case_filter_in.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule include_module modules/mod_include.so
LoadModule filter_module modules/mod_filter.so
LoadModule substitute_module modules/mod_substitute.so
LoadModule charset_lite_module modules/mod_charset_lite.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule ident_module modules/mod_ident.so
LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule fastcgi_module modules/mod_fastcgi.so
LoadModule cgid_module modules/mod_cgid.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imagemap_module modules/mod_imagemap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule perl_module modules/mod_perl.so
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule xsendfile_module modules/mod_xsendfile.so

LoadModule php5_module        /Applications/MAMP/bin/php/php5.4.45/modules/libphp5.so

#
AddType application/x-httpd-php .php .phtml

<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
#
# 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.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User #-1
Group #-1

</IfModule>
</IfModule>

<IfModule xsendfile_module>
	XSendFile on
</IfModule>

# ''Main'' server configuration
#
# The directives in this section set up the values used by the ''main''
# server, which responds to any requests that aren''t handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#

#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.  e.g. admin@your-domain.com
#
ServerAdmin you@example.com

#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn''t have a registered DNS name, enter its IP address here.
#
ServerName localhost:8888

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
# MAMP DOCUMENT_ROOT !! Don''t remove this line !!
DocumentRoot "/Applications/MAMP/htdocs"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories). 
#
# First, we configure the "default" to be a very restrictive set of 
# features.  
#
<Directory />
    Options Indexes FollowSymLinks
    AllowOverride None
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something''s not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/Applications/MAMP/htdocs">
    #
    # 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 All

    #
    # 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
    
    XSendFilePath "/Applications/MAMP/htdocs"
</Directory>

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.php

    <IfModule perl_module>
        DirectoryIndex index.pl
    </IfModule>

    <IfModule wsgi_module>
        DirectoryIndex index.wsgi index.py
    </IfModule>

</IfModule>

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride 
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

<Files ~ "^\.DS_Store">
    Order allow,deny
    Deny from all
</Files>

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host''s errors will be logged there and not here.
#
ErrorLog "/Applications/MAMP/logs/apache_error.log"

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel error

<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 "/Applications/MAMP/logs/apache_access.log" common

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    #CustomLog "/Applications/MAMP/logs/apache_access.log" combined
</IfModule>

<IfModule alias_module>
    #
    # Redirect: Allows you to tell clients about documents that used to 
    # exist in your server''s namespace, but do not anymore. The client 
    # will make a new request for the document at its new location.
    # Example:
    # Redirect permanent /foo http://www.example.com/bar

    #
    # Alias: Maps web paths into filesystem paths and is used to
    # access content that does not live under the DocumentRoot.
    # Example:
    # Alias /webpath /full/filesystem/path
    #
    # If you include a trailing / on /webpath then the server will
    # require it to be present in the URL.  You will also likely
    # need to provide a <Directory> section to allow access to
    # the filesystem path.
	#
	# We include the /icons/ alias for FancyIndexed directory listings.  If you
	# do not use FancyIndexing, you may comment this out.
	#
	
	Alias /favicon.ico "/Applications/MAMP/bin/favicon.ico"
	
	Alias /icons/ "/Applications/MAMP/Library/icons/"
	
	<Directory "/Applications/MAMP/Library/icons">
		Options Indexes MultiViews
		AllowOverride None
		Order allow,deny
		Allow from all
	</Directory>
	
	Alias /phpMyAdmin "/Applications/MAMP/bin/phpMyAdmin"
	Alias /phpmyadmin "/Applications/MAMP/bin/phpMyAdmin"
	
	<Directory "/Applications/MAMP/bin/phpMyAdmin">
		Options Indexes MultiViews
		AllowOverride None
		Order allow,deny
		Allow from all
	</Directory>
	
	Alias /phpPgAdmin "/Applications/MAMP/bin/phpPgAdmin"
	Alias /phppgadmin "/Applications/MAMP/bin/phpPgAdmin"
	
	<Directory "/Applications/MAMP/bin/phpPgAdmin">
		Options Indexes MultiViews
		AllowOverride None
		Order allow,deny
		Allow from all
	</Directory>
	
	Alias /phpLiteAdmin "/Applications/MAMP/bin/phpLiteAdmin"
	Alias /phpliteadmin "/Applications/MAMP/bin/phpLiteAdmin"
	
	<Directory "/Applications/MAMP/bin/phpLiteAdmin">
		Options Indexes MultiViews
		AllowOverride None
		Order allow,deny
		Allow from all
	</Directory>
	
	Alias /MAMP "/Applications/MAMP/bin/mamp"
	
	<Directory "/Applications/MAMP/bin/mamp">
		Options Indexes MultiViews
		AllowOverride None
		Order allow,deny
		Allow from all
	</Directory>
	
	Alias /adminer "/Applications/MAMP/bin/adminer"

	<Directory "/Applications/MAMP/bin/adminer">
		DirectoryIndex adminer.php
		Options Indexes MultiViews
		AllowOverride None
		Order allow,deny
		Allow from all
	</Directory>

    #
    # ScriptAlias: This controls which directories contain server scripts. 
    # ScriptAliases are essentially the same as Aliases, except that
    # documents in the target directory are treated as applications and
    # run by the server when requested rather than as documents sent to the
    # client.  The same rules about trailing "/" apply to ScriptAlias
    # directives as to Alias.
    #
    ScriptAlias /cgi-bin/ "/Applications/MAMP/cgi-bin/"

    Alias /perl/ "/Applications/MAMP/cgi-bin/"

    <IfModule perl_module>
        PerlModule ModPerl::Registry
        <Location /perl>
            SetHandler perl-script
            PerlResponseHandler ModPerl::Registry
            PerlOptions +ParseHeaders
            Options +ExecCGI
        </Location>
    </IfModule>
</IfModule>

<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 logs/cgisock
</IfModule>

#
# "/Applications/MAMP/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/Applications/MAMP/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

#
# DefaultType: the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain

<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig /Applications/MAMP/conf/apache/mime.types

    #
    # AddType allows you to add to or override the MIME configuration
    # file specified in TypesConfig for specific file types.
    #
    #AddType application/x-gzip .tgz
    #
    # AddEncoding allows you to have certain browsers uncompress
    # information on the fly. Note: Not all browsers support this.
    #
    #AddEncoding x-compress .Z
    #AddEncoding x-gzip .gz .tgz
    #
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

    #
    # AddHandler allows you to map certain file extensions to "handlers":
    # actions unrelated to filetype. These can be either built into the server
    # or added with the Action directive (see below)
    #
    # To use CGI scripts outside of ScriptAliased directories:
    # (You will also need to add "ExecCGI" to the "Options" directive.)
    #
    AddHandler cgi-script .cgi .pl

    # For type maps (negotiated resources):
    #AddHandler type-map var

    #
    # Filters allow you to process content before it is sent to the client.
    #
    # To parse .shtml files for server-side includes (SSI):
    # (You will also need to add "Includes" to the "Options" directive.)
    #
    #AddType text/html .shtml
    #AddOutputFilter INCLUDES .shtml
</IfModule>

#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type.  The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
<IfModule mime_magic_module>
	MIMEMagicFile /Applications/MAMP/conf/apache/magic
</IfModule>

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# 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
#

#
# EnableMMAP and EnableSendfile: On systems that support it, 
# memory-mapping or the sendfile syscall is used to deliver
# files.  This usually improves server performance, but must
# be turned off when serving from networked-mounted 
# filesystems or if support for these functions is otherwise
# broken on your system.
#
#EnableMMAP off
#EnableSendfile off

# Supplemental configuration
#
# The configuration files in the /Applications/MAMP/conf/apache/extra/ directory can be 
# included to add extra features or to modify the default configuration of 
# the server, or you may simply copy their contents here and change as 
# necessary.

# Server-pool management (MPM specific)
#Include /Applications/MAMP/conf/apache/extra/httpd-mpm.conf

# Multi-language error messages
#Include /Applications/MAMP/conf/apache/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
#Include /Applications/MAMP/conf/apache/extra/httpd-autoindex.conf

# Language settings
#Include /Applications/MAMP/conf/apache/extra/httpd-languages.conf

# User home directories
#Include /Applications/MAMP/conf/apache/extra/httpd-userdir.conf

# Real-time info on requests and configuration
#Include /Applications/MAMP/conf/apache/extra/httpd-info.conf

# Virtual hosts
#Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

# Local access to the Apache HTTP Server Manual
#Include /Applications/MAMP/conf/apache/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
#Include /Applications/MAMP/conf/apache/extra/httpd-dav.conf

# Various default settings
#Include /Applications/MAMP/conf/apache/extra/httpd-default.conf

# Secure (SSL/TLS) connections
#Include /Applications/MAMP/conf/apache/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup file:/dev/urandom 1024
SSLRandomSeed connect file:/dev/urandom 1024
    
#
# Uncomment the next line if Apache should not accept SSLv3 connections, to learn more google for "POODLE SSLv3".
# SSLProtocol All -SSLv2 -SSLv3 
</IfModule>

 

Apache HTTP服务器 2.2.12 发布

Apache HTTP服务器 2.2.12 发布

Apache官方在今天放出产品系列2.2的最新版本2.2.12的源码包。按照惯例,大约几天后才会正式发布。您可以先用为快。

2.2系列的上一个版本是2008-12-07的2.2.11,过了半年多,这个版本主要就是修正了一些模块的bug和安全漏洞.其他的产品线还是 2008-01-17的1.3.41和2.0.63.看来1.3和2.0基本已停止更新了。对比Nginx和lighttpd,Apache的更新速度还 真是有点慢。

下载: http://httpd.apache.org/dev/dist/httpd-2.2.12.tar.bz2
改进: http://httpd.apache.org/dev/dist/CHANGES_2.2.12

apache struts2 Apache2 httpdconf 中文版

apache struts2 Apache2 httpdconf 中文版

Apache2 httpd.conf 中文版 
#
# 基于 NCSA 服务的配置文件。
#
#这是Apache服务器主要配置文件。
#它包含服务器的影响服务器运行的配置指令。
#参见以取得关于这些指令的详细信息
#
#不要只是简单的阅读这些指令信息而不去理解它。
#这里只是做了简单的说明,如果你没有参考在线文件,你就会被警告。
#
#这些配置指令被分为下面三个部分:
#1. 控制整个Apache服务器行为的部分(即全局环境变量)
#2. 定义主要或者默认服务参数的指令,也为所有虚拟主机提供默认的设置参数
#3. 虚拟主机的设置参数
#
#配置和日志文件名:如果你指定的文件名以“/”开始(win32下以“dirver:/”),
#服务器将使用绝对路径,如果文件名不是以“/”开始的,那么它将把ServerRoot
#的值附加在文件名的前面,例如,对“logs/foo.log",如果ServerRoot的值
#为“/usr/local/apache2”,则该文件应为“/usr/local/apache2/logs/foo.log”
#
##第一区:全局环境参数
#
#这里设置的参数将影响整个Apache服务器的行为;
#例如Apache能够处理的并发请求的数量等。
#
#ServerRoot:指出服务器保存其配置、出错和日志文件等的根目录。
#
#注意!如果你想要将它指定为NFS或其它网络上的位置,
#请一定要去阅读与LockFile有关的文档(可能在
#)。
#这将会使你自己也能解决很多问题。
#
#路径的结尾不要添加斜线。
#
ServerRoot "/usr/loacl/apache2"
#
#串行访问的锁文件必须保存在本地磁盘上
#


#LockFile logs/accept.lock


#ScoreBoardFile:用来保存内部服务进程信息的文件。
#如果未指明(默认),记分板(scoreboard)将被保存在一个匿名的共享内存段中,
#并且它不能被第三方软件所使用。
#如果指定了,要确保不能使用两个Apache使用同一个记分板文件,
#这个记分板文件必须保存在本地磁盘上。
#


#ScoreBoardFile logs/apache_runtime_status


#
#PidFile:记录服务器启动进程号的文件。
#

PidFile logs/httpd.pid

#
#Timeout:接收和发送前超时秒数
#
Timeout 300
#
#KeepAlive:是否允许稳固的连接(每个连接有多个请求),
#设为"Off"则停用。
#
KeepAlive On
#
#MaxKeepAliveRequests:在稳固连接期间允许的最大请求数,
#设为0表示无限制接入。
#我们推荐你将其设为一个较大的值,以便提高性能
MaxKeepAliveRequests 100
#
#KeepAliveTimeout:在同一个连接上从同一台客户上接收请求的秒数
#
KeepAliveTimeout 15
##
##Server-Pool大小设定(针对MPM的)
##
# prefork MPM
# StartServers:启动时服务器启动的进程数
# MinSpareServers:保有的备用进程的最小数目
# MaxSpareServers:保有的备用进程的最大数目
# MaxClients:服务器允许启动的最大进程数
# MaxRequestsPerChild:一个服务进程允许的最大请求数

StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestPerChild 0

# worker MPM
# StartServers:服务器启动时的服务进程数目
# MaxClients:允许同时连接的最大用户数目
# MinSpareThreads:保有的最小工作线程数目
# MaxSpareThreads:允许保有的最大工作线程数目
# ThreadsPerChild:每个服务进程中的工作线程常数
# MaxRequestsPerChild:服务进程中允许的最大请求数目

StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0

# perchild MPM
# NumServers:服务进程数量
# StartThreads:每个服务进程中的起始线程数量
# MinSpareThreads:保有的最小线程数量
# MaxSpareThreads:保有的最大线程数量
# MaxThreadsPerChild:每个服务进程允许的最大线程数
# MaxRequestsPerChild:每个服务进程允许连接的最大数量

NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0

# WinNT MPM
# ThreadsPerChild:服务进程中工作线程常数
# MaxRequestsPerChild:服务进程允许的最大请求数

ThreadsPerChild 250
MaxRequestsPerChild 0

# BeOS MPM
# StartThreads:服务器启动时启动的线程数
# MaxClients:可以启动的最大线程数(一个线程等于一个用户)
# MaxRequestsPerThread:每个线程允许的最大请求数

StartThreads 10
MaxClients 50
MaxRequestsPerThread 10000

# NetWare MPM
# ThreadStachSize:为每个工作线程分配的堆栈尺寸
# StartThreads:服务器启动时启动的线程数
# MinSpareThreads:用于处理实发请求的空闲线程数
# MaxSpareThreads:空闲线程的最大数量
# MaxThreads:在同一时间活动的最大线程数
# MaxRequestPerChild:一个线程服务请求的最大数量,
# 推荐将其设置为0,以实现无限制的接入

ThreadStackSize 65536
StartThreads 250
MinSpareThreads 25
MaxSpareThreads 250
MaxThreads 1000
MaxRequestPerChild 0

# OS/2 MPM
# StartServers:启动的服务进程数量
# MinSpareThreads:每个进程允许的最小空闲线程
# MaxSpareThreads:每个进程允许的最大空闲线程
# MaxRequestsPerChild:每个服务进程允许的最大连接数

StartServers 2
MinSpareThreads 5
MaxSpareThreads 10
MaxRequestsPerChild 0

#
# Listen:允许你绑定Apache服务到指定的IP地址和端口上,以取代默认值
# 参见指令
# 使用如下命令使Apache只在指定的IP地址上监听,
# 以防止它在IP地址0.0.0.0上监听
#
# Listen 12.34.56.78:80
Listen 80
#
# 动态共享支持(DSO)
#
# 为了能够使用那些以DSO模式编译的模块中的函数,你必须有相应的“LoadModule”行,
# 因此,在这里包含了这些指令,以便能在使用它之前激活。
# 那些静态编译的模块不需要在这里列出 (即以“httpd -l”列出的模块)
#
# 示例:
# LoadModule foo_module modules/mod_foo.so
#
#
# ExtendedStatus:当调用“server-status”时,控制Apache是产生“全”状态
# 信息(ExtendedStatus On),还是产生基本信息(ExtendedStatus Off)。
# 默认为off
#
# ExtendedStatus On
### 第二区:“主”服务配置
#
# 这一区建立被 “主” 服务器用的指令值,以回应那些不被 
# 定义处理的任何请求。
# 这些数值也提供默认值给后面定义的容器。
# 如果中有定义,那么这里定义的指令值将被
中的定义所覆盖。
#


#
# 如果你想使httpd以另外的用户或组来运行,你必须在开始时以root方式启动
# 然后再将它切换为你想要使用的用户或组。
#
# User/Group:运行httpd的用户和组
# 在SCO (ODT3)上使用“User nouser”和“Group nogroup”
# 在HPUX上,你可能不能以nobody身份使用共享内存,建议创建一个www用户。
# 注意一些核心(kernel)在组ID大于60000时拒绝setgid(Group)或semctl(IPC_SET),
#节在这些系统上不要使用“Group #-1”。
#
User nobody
Group #-1


#
# ServerAdmin:你的邮件地址,当发生问题时Apache将向你发出邮件。
# 作为一个出错文档,这个地址显示在server-generated页上,
# 例如:admin@your-domain.com
#
ServerAdmin kreny@sina.com
#
# ServerName指定Apache用于识别自身的名字和端口号。
# 通常这个值是自动指定的,但是我们推荐你显式的指定它以防止启动时出错
#
# 如果你为你的主机指定了一个无效的DNS名,server-generated重定向将不能工作。
# 参见UseCanonicalName指令
#
# 如果你的主机没有注册DNS名,在这里键入它的IP地址
# 无论如何,你必须使用它的IP地址来提供服务,
# 这里使用一种容易理解的方式重定向服务
ServerName www.dalouis.com:80
#
# UseCanonicalName:决定Apache如何构造URLS和 SERVER_NAME 和 SERVER_PORT 的指令。
# 当设置为 “Off”时,Apache会使用用户端提供的主机名和端口号。
# 当设置为“On”,Apache会使用ServerName指令的值。
#
UseCanonicalName Off
#
# DocumentRoot:你的文档的根目录。默认情况下,所有的请求从这个目录进行应答。
# 但是可以使用符号链接和别名来指向到其他的位置。
#
DocumentRoot "/home/redhat/public_html"
#
# Apache可以存取的每个目录都可以配置存取权限(包括它的子目录)。
#
# 首先,我们配置一个高限制的特征。
# 这将禁止访问文件系统所在的目录,并添加你希望允许访问的目录块。
# 如下所示

Order Deny,Allow
Deny from all

#
# 注意从这里开始你一定要明确地允许哪些特别的特征能够被使用。
# - 所以,如果Apache没有象你所期待的那样工作的话,
# 请检查你是否在下面明确的指定它可用。
#
#
# 这将改变到你设置的DocumentRoot
#

#
# Options:这个指令的值可以是“None”,“All”,或者下列选项的任意组合:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# 注意,“MultiViews”必须被显式的指定,“Options All”不能为你提供这个特性。
#
# 这个指令既复杂又重要,请参见
#“http://httpd.apache.org/docs-2.0/mod/core.html#optioins”以取得更多的信息。
#
Options FollowSymLinks
#
# AllowOverride控制那些被放置在.htaccess文件中的指令。
# 它可以是“All”,“None”,或者下列指令的组合:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# 控制谁可以获得服务。
#
Order allow,deny
Allow from all

#
# UserDir:指定在得到一个~user请求时将会添加到用户home目录后的目录名。
#
UserDir public_html
# 为防止在UserDir指令上的漏洞,对root用户设置
# 象“./”这样的UserDir是非常有用的。
# 如果你使用Apache 1.3或以上版本,我们强烈建议你
# 在你的服务器配置文件中包含下面的行
UserDir disabled root
#
# 下面是一个使用UserDir指令使一个站点的目录具有只读属性的示例:
#

# AllowOverride FileInfo AuthConfig Limit Indexes
# Options MultiViews Indexes SymLinksIfOwnerMatch IncludeNoExec

# Order allow,deny
# Allow from all


# Order deny,allow
# Deny from all


#
# DirectoryIndex:定义请求是一个目录时,Apache向用户提供服务的文件名
#
# index.html.var文件(一个类型映象文件)用于提供一个文档处理列表,
# 出于同样的目的,也可以使用MultiViews选项,但是它会非常慢。
#
DirectoryIndex index.php index.html index.html.var
#
# AccessFileName:在每个目录中查询为目录提供附加配置指令的文件的文件名。
# 参见AllowOverride指令。
#
AccessFileName .htaccess
#
# 下面的行防止.htaccess和.htpasswd文件被Web客户查看。
#

Order allow,deny
Deny from all

#
# Typeconfig:定义在哪里查询mime.types文件。
#
TypeConfig conf/mime.types
#
# DefaultType:定义当不能确定MIME类型时服务器提供的默认MIME类型。
# 如果你的服务主要包含text或HTML文档,“text/plain”是一个好的选择;
# 如果大多是二进制文档,诸如软件或图像,你应使用
# “application/octer-stream”来防止浏览器象显示文本那样显示二进制文件。
#
DefaultType text/plain
#
# mod_mime_magic允许服务器从自己定义自己类型的文件中使用不同的线索(hints),
# 这个MIMEMagicFile指令定义hints定义所在的文件。
#

MIMEMagicFile conf/magic

#
# HostnameLookups:指定记录用户端的名字还是IP地址,例如,本指令为on时
# 记录主机名,如www.apache.org;为off时记录IP地址,204.62.129.132。
# 默认值为off,这要比设为on好得多,因为如果设为on则每个用户端请求都将会
# 至少造成对 nameserver 进行一次查询。
#
HostnameLookups Off
#
# EnableMMAP:控制是否进行内存转储(如果操作系统支持的话)。
# 默认为on,如果你的服务器安装在网络文件系统上(NFS),请关闭它。
# 在一些系统上,关闭它会提升系统性能(与文件系统类型无关);
# 具体情况请参阅http://httpd.apache.org/docs-2.0/mod/core.html#enablemmap
#
# EnableMMAP off
#
# EnableSendfile:控制是否使用sendfile kernel支持发送文件
# (如果操作系统支持的话)。默认为on,如果你的服务器安装在网络文件系统
# (NFS)上,请你关闭它。
# 参见http://httpd.apache.org/docs-2.0/mod/core.html#enablesendfile
#
# EnableSendfile off
#
# ErrorLog:错误日志文件定位。
# 如果你没有在内定义ErrorLog指令,这个虚拟主机的错误信息
# 将记录在这里。如果你在那儿定义了ErrorLog,这些错误信息将记录在你所
# 定义的文件里,而不是这儿定义的文件。
#
ErrorLog logs/error_log
#
# LogLevel:控制记录在错误日志文件中的日志信息数量。
# 可能的值包括:debug,info,notice,warn,error,crit,alert,emerg。
#
LogLevel warn
#
# 下面的指令为CustomLog指令定义格式别名。
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# 你需要安装了mod_logio.c模块才能使用%I和%O。
# LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
#
# 指定接入日志文件的定位和格式(一般日志格式)。
# 如果你没有在内定义这个指令,传输信息将记录在这里,
# 如果你定义了这个指令,则记录在你指定的位置,而不是这儿定义的位置。
#
CustomLog logs/access_log common
#
# 如果你想要记录agent和referer信息,可以使用下面的指令
#
# CustomLog logs/referer_log referer
# CustomLog logs/agent_log agent
#
# 如果你想要使用一个文件记录access,agent和referer信息,
# 你可以如下定义这个指令:
#
# CustomLog logs/access_log combined
#
# ServerTokens
# 这个指令定义包含在HTTP回应头中的信息类型。默认为“Full”,
# 这表示在回应头中将包含模块中的操作系统类型和编译信息。
# 可以设为列各值中的一个:
# Full | OS | Minor | Minimal | Major | Prod
# Full传达的信息最多,而Prod最少。
#
ServerTokens Full
#
# 随意的添加包含服务器版本和虚拟主机名字一行信息到server-generated输出页中
# (内部错误文档,FTP目录列表,mod_status和mod_info输出等等,除了CGI错误
# 或自定义的错误文档以外)。
# 设为“EMail”将包含一个指向ServerAdmin的mailto:连接。
# 可以为如下值:On | Off | EMail
#
ServerSignature On
#
# Aliases:在这时添加你需要的别名,格式如下:
# Alias 别名 真实名
#
# 注意,如果你在别名的未尾包含了“/”,那么在URL中也需要包含“/”。
# 因此,“/icons”不是这个示例中的别名。
# 如果别名中以“/”结尾,那么真实名也必须以“/”结尾,
# 如果别名中省略了结尾的“/”,那么真实名也必须省略。
#
# 我们使用别名“/icons/”来表示FancyIndexed目录列表,如果你不使用、
# FancyIndexing,你可以注释掉它。
#
# Alias /icons/ "/usr/local/apache2/icons/"

# Options Indexes MultiViews
# AllowOverride None
# Order allow,deny
## Allow from all

#
# 这将改变ServerRoot/manual。这个别名提供了手册页所在的位置,
# 即使你改变了你的DocumentRoot。如果你对有无手册页并不在意的话,
# 你可以注释掉它。
#
Alias /manual "/usr/loacl/apache2/manual"

Options Indexes FollowSymLinks MultiViews IncludesNoExec
AddOutputFilter Includes html
Order allow,deny
Allow from all

#
# ScriptAlias:指定包含服务脚本的目录。
# ScriptAliases 本质上与Aliases一样,除了这里的文档在请求时做为程序处理处理以外。
# 尾部的“/”规则与Alias一样
#
ScriptAlias /cgi-bin/ "/usr/loacl/apache2/cgi-bin/"
# 这里是添加php 4支持的指令
AddType application/x-httpd-php .php
LoadModule php4_module modules/libphp4.so

#
# 添加mod_cgid.c设置,mod_cgid提供使用cgid进行通讯的UNIX套接字的
# 脚本接口路径。
#
# Scriptsock logs/cgisock

#
# 将"/usr/local/apache2/cgi-bin"改为你的ScriptAliased指定的CGI目录,
# 如果你配置了的话。
#

AllowOverride None
Options None
Order allow,deny
Allow from all

#
# Redirect允许你告诉客户端使用存在于服务器名字空间中的文档,
# 而不是现在的,这帮助客户定位那些改变了位置的文档。
# 例如:
# Redirect permanent /foo http://www.example.com/bar
#
# 控制server-generated目录列表显示的指令
#
#
# IndexOptions:控制server-generated目录列表显示特征。
#
IndexOptions FancyIndexing VersionSort
#
# AddIcon* 指令告诉服务器不同扩展名的图象文件如何显示,
# 只适用于FancyIndexed指令
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
#
# DefaultIcon 为那些没有显式定义图标的文件提供处理
#
DefaultIcon /icons/unknown.gif
#
# AddDescription允许你在server-generated索引后放置一个简短的说明。
# 只对FancyIndexed指令有效。
# 格式:AddDescription "说明" 文件名
#
# AddDescription "GZIP compressed document" .gz
# AddDescription "tar archive" .tar
# AddDescription "GZIP compressed tar archive" .tgz
#
# ReadmeName指定服务器默认查找的README文件的名字,并添加到目录列表中
#
# HeaderName指定目录列表前缀文件的文件名
ReadmeName README.html
HeaderName HEADER.html
#
# IndexIgnore指定目录索引忽略并且不包含在列表中的文件名集合,
# 支持shell类型的通配符。
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
#
# AddEncoding允许你在信息传送中使用(Mosaic/X 2.1+)解压缩信息,
# 注意:不是所有的浏览器都支持这个选项。
# 尽管名字相似,但是下列的指令与上面的FancyIndexing定制指令不同。
#
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
#
# DefaultLanguage和AddLanguage允许你指定文档的语言。
# 这使你可以让用户用容易理解的语言浏览文档。
#
# 指定默认的语言,这意味着所有没有指定语言的包都将使用该语言。
# 多数情况下,你也许并不想设置它,除非你确信这样做是正确的。
# 通常,不使用确定的语言比使用错误的语言要好。
#
# DefaultLanguage nl
#
# 注意1:作为语言关键字的词缀毫无疑问是不能一样的--采用波兰
# 文的文档(网络标准语言代码是pl)将希望使用“AddLanguage pl .po”
# 来避免与perl脚本的一般词缀产生二义性。
#
# 注意2: 下面的例子举例说明在一些范例中语言的二字符缩写与它的国家
# 的二字符缩写不相同,例如 “Danmark/dk” 和 “Danmark/da” 的比较.
#
# 注意3: 在 “ltz” 的情况下我们使用三字符词缀,违犯了 RFC的规定,
# 运行中将修复它并使用RFC1766标准取得参考数据。
#
# Danish (da) - Dutch (nl) - English (en) - Estonian (et)
# French (fr) - German (de) - Greek-Modern (el)
# Italian (it) - Norwegian (no) - Norwegian Nynorsk (nn) - Korean (ko)
# Portugese (pt) - Luxembourgeois* (ltz)
# Spanish (es) - Swedish (sv) - Catalan (ca) - Czech(cz)
# Polish (pl) - Brazilian Portuguese (pt-br) - Japanese (ja)
# Russian (ru) - Croatian (hr)
#
AddLanguage da .dk
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .et
AddLanguage fr .fr
AddLanguage de .de
AddLanguage he .he
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddLanguage pl .po
AddLanguage ko .ko
AddLanguage pt .pt
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pt-br .pt-br
AddLanguage ltz .ltz
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .sv
AddLanguage cz .cz
AddLanguage ru .ru
AddLanguage tw .tw
AddLanguage zh-tw .tw
AddLanguage hr .hr
# LanguagePriority允许你在会话过程中优先使用一些语言。
#
# 以优先次序递减的方式列出它们。我们或多或少地采用按字母排列顺序的方式
# 排列它们。也许你想要改变这个顺序。
LanguagePriority en da nl et fr de el it ja ko no pl pt pt-br ltz ca es sv tw
#
# ForceLanguagePriority 允许你为MULTIPLE CHOICES(Prefer)[在通讯的情况下]
# 或NOT ACCEPTABLE(Fallback)[没有可接受的语言匹配的情况]提供一个结果页。
#
ForceLanguagePriority Prefer Fallback
#
# 为发送出的所有页指定默认的字符集,这总是一个好主意,并且为你的
# web站点的国际化打开了大门,这不正是你曾经想要的吗。同样地,指定
# 默认字符集有一些小的损害,如一个使用iso-8859-1(latin1)标准命令
# 的页面,除非以别的方式指定例如你仅仅以显式方式声明它。
# 也有一些与那些总是鼓励你使用默认字符集的javascropt和URL语法有关
# 的浏览器安全原因。
#
#AddDefaultCharset ISO-8859-1
AddDefaultCharse GB2312
#
# 一般以文件扩展名的方式使用字符集。也许你想要避免与语言扩展发生
# 碰撞,除非你在每次改变后都做了很好的测试。
# 参见http://www.iana.org/assignments/character-sets以取得字符集
# 的名字列表和它们各自的RFCs。
#
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
# 对于俄语,使用了多个字符集(如何使用主要依靠客户端):
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8
# 下面的字符集没有映射到一个特定的标准(iso)上,但是它们在浏览器
# 中被广泛的支持。注意那些大写字母。
# (它不应该,但是它是为兼容一些浏览器而做)
#
# 参见http://www.iana.org/assianments/character-sets以取得
# 它们的列表。但是浏览器支持较少。
#
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-jp
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis
#
# AddType允许你为指定的文件类型添加或覆盖mime.types文件中配置的MIME
#
AddType application/x-tar .tgz
AddType image/x-icon .ico
#
# AddHandler允许你映射确定的文件扩展名到“handlers”:
# 与文件类型无关的行为。这既能编译到服务器中也可以添加到Action指令
# 中(看下面)。
# 为了在ScriptAliased指令指定的以外使用CGI脚本:
#(要使它可用,你还需要在Options中添加“ExecCGI”。
#
# AddHandler cgi-script .cgi
#
# 对于那些包含他们自己的HTTP头的文件
#
# AddHandler send-as-is asis
#
# 对于server-parsed imagemap文件:
#
# AddHandler imap-file map
#
# agemap 文件:
#
#AddHandler imap- 文件映像
#
# 对于类型映像转移资源)
#(这是默认的设定以允许Apache的“It Worked”页能多种语言分发)。
#
AddHandler type-map var
#
# 过滤器允许你在将它发送到客户端前进行处理。
#
# 为了在服务器端分析包含(SSI)的.shtml文档:
# (要执行这个指令,你还需要在Options指令中添加“Includes”。)
#
# AddType text/html .shtml
# AddOutputFilter INCLUDES .shtml
#
# Action让你定义当调用匹配的媒体文件时将要执行的脚本。这将减少
# 那些经常使用的CGI脚本的URL路径名的重复输入。
# 格式:Action media/type /cgi-script/location
# 格式:Action handler-name /cgi-script/location
#
#
# 可配置的错误应答有三种风格:
# 1)plain text 2)local redirects 3) external redirects
#
# 一些示例:
# 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
#
#
# 综合应用这些指令,我们可以创建一个国际化的出错应答。
#
# 我们使用Alias来重定向任意/error/HTTP_.html.var应答到
# 我们的多语言错误消息集合。使用正确的文本替代它。
#
# 通过加入下面的行,你就能够改变这些消息的显示,而不必改变
# HTTP_.html.var文件。
#
# Alias /error/include/ "/your/include/path/"
#
# 以将/usr/local/apache2/error/include/下的文件拷贝到/your/inclue/path/下
# 开始,你可以创建你自己的文件集合,甚至是其于每个虚拟主机的。
# 不管你的ServerSignature如何设置,默认的包含文件将显示你的
# Aapche版本号和你的ServerAdmin邮件地址
#
# 国际化的错误文档需要mod_alias,mod_include和mod_negotiation三个
# 模块。要激活它们,取消下面30行的注释符号
# Alias /error/ "/usr/local/apache2/error/"
#

# AllowOverride None
# Options IncludesNoExec
# AddOutputFilter Includes html
# AddHandler type-map var
# Order allow,deny
# Allow from all
# LanguagePriority en de es fr it nl sv
# ForceLanguagePriority Prefer Fallback

#
# ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
# ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error.php
# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
# ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
# ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
# ErrorDocument 410 /error/HTTP_GONE.html.var
# ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
# ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
# ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
# ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
# ErrorDocument 415 /error/HTTP_SERVICE_UNAVAILABLE.html.var
# ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
# ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
# ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
# ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
# ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
#
# 下面的命令更改标准的HTTP应答行为以处理己知的浏览器问题。
#
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
#
# 下面命令关闭对那些没有尾部“/”的目录的非GET请求的重定向,
# 这些命令修复了微软的采用DAV方法不能正确处理重定向的WEB文件夹的问题。
# Apple下的DAV文件系统和Gnome下的VFS对DAV的支持也是采用这样的方法
# 进行处理的。
#
BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
BrowserMatch "^gnome-vfs" redirect-carefully
#
# 允许你使用URL:http://servername/server-status来通过mod_status生
# 成并报告服务器状态信息。改变.example.com为你自己的域名。
#

# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from .example.com

#
# 允许使用URL:http://servername/server-info来远程报告服务器配置信息
# (需要mod_info.c支持)。改变“.example.com”为你自己的域名。
#

# SetHandler server-info
# Order deny,allow
# Deny from all
# Allow from .example.com

#
# 代理服务器命令,去掉下面的行使代理服务可用。
#

# ProxyRequests On

# Order deny,allow
# Deny from all
# Allow from .example.com

#
# 安装或关闭HTTP/1.1“通道”头处理。
# (“Full”添加服务器版本信息,“Block”移掉所有输出“通道”头信息。
# 可以设为下面各选项之一:Off | On | Full | Block
#
# ProxyVia On
# 最好为代理服务安装高速缓冲,去掉下面几行的注释符号:
# (没有CacheRoot则不缓冲)
#
# CacheRoot "/usr/local/apache2/proxy"
# CacheSize 5
# CacheGcInterval 4
# CacheMaxExpire 24
# CacheLastModifiedFactor 01
# CacheDefaultExpire 1
# NoCache a-domain.com another-domain.edu joes.garage-sale.com

# 代理命令结束。
#
# 附加的特定模块配置。
#

Include conf/ssl.conf

## 第三区:虚拟主机
#
# VirtualHost:你可以通过设置虚拟主机容器以实现在你的主机上保有多个
# 域名/主机名。大多数配置信息只使用基于名字的虚拟主机,因此服务器
# 不必担心IP地址的问题,下面的命令以*号代替虚拟主机名。
#
# 在你试着配置你的虚拟主机以前,请参见
# URL:http://httpd.apache.org/docs-2.0/vhosts/>以取得更多的信息。
#
# 你可以使用命令行选项“-S”来检验你的虚拟主机配置。
#
# 使用基于名字的虚拟主机。
#
# NameVirtualHost *
#
# 虚拟主机示例:
# 几乎所有的Apache命令都可以在虚拟主机容器中使用。
# 第一个虚拟主机区是用于向服务名未知的请求进行应答的配置。
#

# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log commom

以上就介绍了apache struts2 Apache2 httpdconf 中文版,包括了apache struts2方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

apache 的 /etc/httpd/conf/httpd.conf 和 /usr/local/apache2/conf/httpd.conf 区别

apache 的 /etc/httpd/conf/httpd.conf 和 /usr/local/apache2/conf/httpd.conf 区别

一、问题

centos 系统用 yum 安装完 apache 后,重启后有时会失效,然后去网上找资料,发现有的说重启命令是这样的:

/etc/init.d/httpd restart

而有的呢,说重启命令应该是这样的:

service httpd restart

这两行命令写法不同,但其实是同一个东西,都是重启 httpd 服务。

但很多时候发现改了配置文件后,重启并不生效,然后网上的资料有的让改 /etc/httpd/conf/httpd.conf 这个文件,有的让改 /usr/local/apache2/conf/httpd.conf 文件。那这两个文件到底哪一个对呢?这两个文件有什么区别呢?

二、区别

这两个文件都是 apache 的配置文件,只是一个是系统自带的(/etc/httpd/conf/httpd.conf),一个是 yum 安装产生的(/usr/local/apache2/conf/httpd.conf)。

三、解决办法

上面的命令不起作用的原因,往往是因为 /etc/init.d/httpd 中用的是系统自带的 apache,但我们改的是 yum 安装的 apache 的配置文件。既然知道原因了,解决就简单了,有两种办法:

1、把 /etc/init.d/httpd 中的 apache 改为我们要使用的那个

2、在要使用的 apache 的安装目录下启动 apache,如在 /usr/local/apache2/bin 下执行命令:

$ sudo apachectl restart

我们今天的关于PHP的-Wamp服务器:更改httpd.conf的Apache?wampserver 如何更换php版本的分享就到这里,谢谢您的阅读,如果想了解更多关于Apache 2.4.8的httpd.conf的配置信息、Apache HTTP服务器 2.2.12 发布、apache struts2 Apache2 httpdconf 中文版、apache 的 /etc/httpd/conf/httpd.conf 和 /usr/local/apache2/conf/httpd.conf 区别的相关信息,可以在本站进行搜索。

本文标签: