当前位置: 移动技术网 > 网络运营>服务器>Linux > apache 局域网访问配置方案第1/2页

apache 局域网访问配置方案第1/2页

2019年05月07日  | 移动技术网网络运营  | 我要评论
#   # this is the main apache http server
#  

# 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 "g:/appserv/apache2.2" will be interpreted by the  

# server as "g:/appserv/apache2.2/logs/foo.log".  

#  

# note: where filenames are specified, you must use forward slashes  

# instead of backslashes (e.g., "c:/apache" instead of "c:\apache").  

# if a drive letter is omitted, the drive on which apache.exe is located  

# will be used by default.  it is recommended that you always supply  

# an explicit drive letter in absolute paths, however, to avoid  

# confusion.  

#  

 

# prefork mpm  

# startservers: number of server processes to start  

# minspareservers: minimum number of server processes which are kept spare  

# maxspareservers: maximum number of server processes which are kept spare  

# maxclients: maximum number of server processes allowed to start  

# maxrequestsperchild: maximum number of requests a server process serves   

<ifmodule mpm_prefork_module>   

    startservers          5   

    minspareservers       5   

    maxspareservers      10   

    maxclients          150   

    maxrequestsperchild   0   

</ifmodule>  

 

# threadsperchild: constant number of worker threads in the server process  

# maxrequestsperchild: maximum  number of requests a server process serves  

#threadsperchild 250   

maxrequestsperchild  0  

 

#  

# 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 "g:/appserv/apache2.2" 

 

#  

# 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 (0.0.0.0)  

#  

#listen 192.168.1.4:80   

listen 80  

 

#  

# this configuration file reflects default settings for apache http server.  

#  

# you may change these, but chances are that you may not need to.  

#  

 

#  

# timeout: the number of seconds before receives and sends time out.  

#   

timeout 300  

 

#  

# keepalive: whether or not to allow persistent connections (more than  

# one request per connection). set to "off" to deactivate.  

#   

keepalive on  

 

#  

# maxkeepaliverequests: the maximum number of requests to allow  

# during a persistent connection. set to 0 to allow an unlimited amount.  

# we recommend you leave this number high, for maximum performance.  

#   

maxkeepaliverequests 100  

 

#  

# keepalivetimeout: number of seconds to wait for the next request from the  

# same client on the same connection.  

#   

keepalivetimeout 5  

 

#  

# usecanonicalname: determines how apache constructs self-referencing   

# urls and the server_name and server_port variables.  

# when set "off", apache will use the hostname and port supplied  

# by the client.  when set "on", apache will use the value of the  

# servername directive.  

#   

usecanonicalname off  

 

#  

# accessfilename: the name of the file to look for in each directory  

# for additional configuration directives.  see also the allowoverride   

# directive.  

#   

accessfilename .htaccess  

 

#  

# servertokens  

# this directive configures what you return as the server http response  

# header. the default is 'full' which sends information about the os-type  

# and compiled in modules.  

# set to one of:  full | os | minor | minimal | major | prod  

# where full conveys the most information, and prod the least.  

#   

servertokens full  

 

#  

# optionally add a line containing the server version and virtual host  

# name to server-generated pages (internal error documents, ftp directory   

# listings, mod_status and mod_info output etc., but not cgi generated   

# documents or custom error documents).  

# set to "email" to also include a mailto: link to the serveradmin.  

# set to one of:  on | off | email  

#   

serversignature on  

 

#  

# hostnamelookups: log the names of clients or just their ip addresses  

# e.g., www.apache.org (on) or 204.62.129.132 (off).  

# the default is off because it'd be overall better for the net if people  

# had to knowingly turn this feature on, since enabling it means that  

# each client request will result in at least one lookup request to the  

# nameserver.  

#   

hostnamelookups off  

 

#  

# 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 actions_module modules/mod_actions.so   

loadmodule alias_module modules/mod_alias.so   

loadmodule asis_module modules/mod_asis.so   

loadmodule auth_basic_module modules/mod_auth_basic.so  

#loadmodule auth_digest_module modules/mod_auth_digest.so  

#loadmodule authn_anon_module modules/mod_authn_anon.so  

#loadmodule authn_dbm_module modules/mod_authn_dbm.so   

loadmodule authn_default_module modules/mod_authn_default.so   

loadmodule authn_file_module modules/mod_authn_file.so  

#loadmodule authz_dbm_module modules/mod_authz_dbm.so   

loadmodule authz_default_module modules/mod_authz_default.so   

loadmodule authz_groupfile_module modules/mod_authz_groupfile.so   

loadmodule authz_host_module modules/mod_authz_host.so   

loadmodule authz_user_module modules/mod_authz_user.so   

loadmodule autoindex_module modules/mod_autoindex.so  

#loadmodule cern_meta_module modules/mod_cern_meta.so   

loadmodule cgi_module modules/mod_cgi.so  

#loadmodule dav_module modules/mod_dav.so  

#loadmodule dav_fs_module modules/mod_dav_fs.so  

#loadmodule deflate_module modules/mod_deflate.so   

loadmodule dir_module modules/mod_dir.so   

loadmodule env_module modules/mod_env.so  

#loadmodule expires_module modules/mod_expires.so  

#loadmodule file_cache_module modules/mod_file_cache.so  

#loadmodule headers_module modules/mod_headers.so   

loadmodule imagemap_module modules/mod_imagemap.so   

loadmodule include_module modules/mod_include.so  

#loadmodule info_module modules/mod_info.so   

loadmodule isapi_module modules/mod_isapi.so   

loadmodule log_config_module modules/mod_log_config.so   

loadmodule mime_module modules/mod_mime.so  

#loadmodule mime_magic_module modules/mod_mime_magic.so  

#loadmodule proxy_module modules/mod_proxy.so  

#loadmodule proxy_ajp_module modules/mod_proxy_ajp.so  

#loadmodule proxy_balancer_module modules/mod_proxy_balancer.so  

#loadmodule proxy_connect_module modules/mod_proxy_connect.so  

#loadmodule proxy_http_module modules/mod_proxy_http.so  

#loadmodule proxy_ftp_module modules/mod_proxy_ftp.so   

loadmodule negotiation_module modules/mod_negotiation.so  

#loadmodule rewrite_module modules/mod_rewrite.so   

loadmodule setenvif_module modules/mod_setenvif.so  

#loadmodule speling_module modules/mod_speling.so  

#loadmodule status_module modules/mod_status.so  

#loadmodule unique_id_module modules/mod_unique_id.so   

loadmodule userdir_module modules/mod_userdir.so  

#loadmodule usertrack_module modules/mod_usertrack.so  

#loadmodule vhost_alias_module modules/mod_vhost_alias.so  

#loadmodule ssl_module modules/mod_ssl.so   

loadmodule php5_module g:/appserv\php5\php5apache2_2.dll  

 

# '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 admin@jswkj.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 192.168.1.4  

#bindaddress 192.168.1.4   

 

#  

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

#   

documentroot "g:/appserv/www" 

 

#  

# 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 followsymlinks execcgi indexes   

    allowoverride none   

    order deny,allow   

    deny from all   

    satisfy all   

</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 "g:/appserv/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 multiviews execcgi  

 

    #  

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

 

#  

# directoryindex: sets the file that apache will serve if a directory  

# is requested.  

#   

<ifmodule dir_module>   

    directoryindex index.php  index.htm   

</ifmodule>  

 

#  

# the following lines prevent .htaccess and .htpasswd files from being   

# viewed by web clients.   

#   

<filesmatch "^\.ht">   

    order allow,deny   

    deny from all   

</filesmatch>  

 

#  

# 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 logs/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 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 logs/access.log common   

 
1

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网