apache启动时没错误,可没httpd这个进程,apachectl启动时说不能启动!

由 funpower 在 10-14-2004 13:07 发表:

apache启动时没错误,可没httpd这个进程,apachectl启动时说不能启动!

funpower# ls

ab apachectl apxs httpd logresolve rotatelogs

funpower# apachectl start

/usr/local/sbin/apachectl start: httpd could not be started

funpower#

httpd.conf有个user和group都是www。可是我没有添加这个用户,不知道会不会影响,还有,我是有固定IP的,但没有域名,就想直接用IP访问,可不知道在httpd.conf的哪边设置!麻烦大侠们了。

我的httpd.conf是:

httpd.conf -- Apache HTTP server configuration file

Based upon the NCSA server configuration files originally by Rob McCool.

This is the main Apache server configuration file. It contains the

configuration directives that give the server its instructions.

See

   1<url: docs="" http:="" www.apache.org=""> for detailed information about   
   2  
   3# the directives.   
   4  
   5#   
   6  
   7# Do NOT simply read the instructions in here without understanding   
   8  
   9# what they do. They're here only as hints or reminders. If you are unsure   
  10  
  11# consult the online docs. You have been warned.   
  12  
  13#   
  14  
  15# After this file is processed, the server will look for and process   
  16  
  17# /usr/local/etc/apache/srm.conf and then /usr/local/etc/apache/access.conf   
  18  
  19# unless you have overridden these with ResourceConfig and/or   
  20  
  21# AccessConfig directives here.   
  22  
  23#   
  24  
  25# The configuration directives are grouped into three basic sections:   
  26  
  27# 1. Directives that control the operation of the Apache server process as a   
  28  
  29# whole (the 'global environment').   
  30  
  31# 2. Directives that define the parameters of the 'main' or 'default' server,   
  32  
  33# which responds to requests that aren't handled by a virtual host.   
  34  
  35# These directives also provide default values for the settings   
  36  
  37# of all virtual hosts.   
  38  
  39# 3. Settings for virtual hosts, which allow Web requests to be sent to   
  40  
  41# different IP addresses or hostnames and have them handled by the   
  42  
  43# same Apache server process.   
  44  
  45#   
  46  
  47# Configuration and logfile names: If the filenames you specify for many   
  48  
  49# of the server's control files begin with "/" (or "drive:/" for Win32), the   
  50  
  51# server will use that explicit path. If the filenames do *not* begin   
  52  
  53# with "/", the value of ServerRoot is prepended -- so "logs/foo.log"   
  54  
  55# with ServerRoot set to "/usr/local/apache" will be interpreted by the   
  56  
  57# server as "/usr/local/apache/logs/foo.log".   
  58  
  59#   
  60  
  61  
  62  
  63### Section 1: Global Environment   
  64  
  65#   
  66  
  67# The directives in this section affect the overall operation of Apache,   
  68  
  69# such as the number of concurrent requests it can handle or where it   
  70  
  71# can find its configuration files.   
  72  
  73#   
  74  
  75  
  76  
  77#   
  78  
  79# ServerType is either inetd, or standalone. Inetd mode is only supported on   
  80  
  81# Unix platforms.   
  82  
  83#   
  84  
  85ServerType standalone   
  86  
  87  
  88  
  89#   
  90  
  91# ServerRoot: The top of the directory tree under which the server's   
  92  
  93# configuration, error, and log files are kept.   
  94  
  95#   
  96  
  97# NOTE! If you intend to place this on an NFS (or otherwise network)   
  98  
  99# mounted filesystem then please read the LockFile documentation   
 100  
 101# (available at <url: core.html#lockfile="" docs="" http:="" mod="" www.apache.org=""> );   
 102  
 103# you will save yourself a lot of trouble.   
 104  
 105#   
 106  
 107ServerRoot "/usr/local"   
 108  
 109  
 110  
 111#   
 112  
 113# The LockFile directive sets the path to the lockfile used when Apache   
 114  
 115# is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or   
 116  
 117# USE_FLOCK_SERIALIZED_ACCEPT. This directive should normally be left at   
 118  
 119# its default value. The main reason for changing it is if the logs   
 120  
 121# directory is NFS mounted, since the lockfile MUST BE STORED ON A LOCAL   
 122  
 123# DISK. The PID of the main server process is automatically appended to   
 124  
 125# the filename.   
 126  
 127#   
 128  
 129#LockFile /var/run/httpd.lock   
 130  
 131  
 132  
 133#   
 134  
 135# PidFile: The file in which the server should record its process   
 136  
 137# identification number when it starts.   
 138  
 139#   
 140  
 141PidFile /var/run/httpd.pid   
 142  
 143  
 144  
 145#   
 146  
 147# ScoreBoardFile: File used to store internal server process information.   
 148  
 149# Not all architectures require this. But if yours does (you'll know because   
 150  
 151# this file will be created when you run Apache) then you *must* ensure that   
 152  
 153# no two invocations of Apache share the same scoreboard file.   
 154  
 155#   
 156  
 157ScoreBoardFile /var/run/httpd.scoreboard   
 158  
 159  
 160  
 161#   
 162  
 163# In the standard configuration, the server will process httpd.conf (this   
 164  
 165# file, specified by the -f command line option), srm.conf, and access.conf   
 166  
 167# in that order. The latter two files are now distributed empty, as it is   
 168  
 169# recommended that all directives be kept in a single file for simplicity.   
 170  
 171# The commented-out values below are the built-in defaults. You can have the   
 172  
 173# server ignore these files altogether by using "/dev/null" (for Unix) or   
 174  
 175# "nul" (for Win32) for the arguments to the directives.   
 176  
 177#   
 178  
 179#ResourceConfig /usr/local/etc/apache/srm.conf   
 180  
 181#AccessConfig /usr/local/etc/apache/access.conf   
 182  
 183  
 184  
 185#   
 186  
 187# Timeout: The number of seconds before receives and sends time out.   
 188  
 189#   
 190  
 191Timeout 300   
 192  
 193  
 194  
 195#   
 196  
 197# KeepAlive: Whether or not to allow persistent connections (more than   
 198  
 199# one request per connection). Set to "Off" to deactivate.   
 200  
 201#   
 202  
 203KeepAlive On   
 204  
 205  
 206  
 207#   
 208  
 209# MaxKeepAliveRequests: The maximum number of requests to allow   
 210  
 211# during a persistent connection. Set to 0 to allow an unlimited amount.   
 212  
 213# We recommend you leave this number high, for maximum performance.   
 214  
 215#   
 216  
 217MaxKeepAliveRequests 100   
 218  
 219  
 220  
 221#   
 222  
 223# KeepAliveTimeout: Number of seconds to wait for the next request from the   
 224  
 225# same client on the same connection.   
 226  
 227#   
 228  
 229KeepAliveTimeout 15   
 230  
 231  
 232  
 233#   
 234  
 235# Server-pool size regulation. Rather than making you guess how many   
 236  
 237# server processes you need, Apache dynamically adapts to the load it   
 238  
 239# sees --- that is, it tries to maintain enough server processes to   
 240  
 241# handle the current load, plus a few spare servers to handle transient   
 242  
 243# load spikes (e.g., multiple simultaneous requests from a single   
 244  
 245# Netscape browser).   
 246  
 247#   
 248  
 249# It does this by periodically checking how many servers are waiting   
 250  
 251# for a request. If there are fewer than MinSpareServers, it creates   
 252  
 253# a new spare. If there are more than MaxSpareServers, some of the   
 254  
 255# spares die off. The default values are probably OK for most sites.   
 256  
 257#   
 258  
 259MinSpareServers 5   
 260  
 261MaxSpareServers 10   
 262  
 263  
 264  
 265#   
 266  
 267# Number of servers to start initially --- should be a reasonable ballpark   
 268  
 269# figure.   
 270  
 271#   
 272  
 273StartServers 5   
 274  
 275  
 276  
 277#   
 278  
 279# Limit on total number of servers running, i.e., limit on the number   
 280  
 281# of clients who can simultaneously connect --- if this limit is ever   
 282  
 283# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.   
 284  
 285# It is intended mainly as a brake to keep a runaway server from taking   
 286  
 287# the system with it as it spirals down...   
 288  
 289#   
 290  
 291MaxClients 150   
 292  
 293  
 294  
 295#   
 296  
 297# MaxRequestsPerChild: the number of requests each child process is   
 298  
 299# allowed to process before the child dies. The child will exit so   
 300  
 301# as to avoid problems after prolonged use when Apache (and maybe the   
 302  
 303# libraries it uses) leak memory or other resources. On most systems, this   
 304  
 305# isn't really needed, but a few (such as Solaris) do have notable leaks   
 306  
 307# in the libraries. For these platforms, set to something like 10000   
 308  
 309# or so; a setting of 0 means unlimited.   
 310  
 311#   
 312  
 313# NOTE: This value does not include keepalive requests after the initial   
 314  
 315# request per connection. For example, if a child process handles   
 316  
 317# an initial request and 10 subsequent "keptalive" requests, it   
 318  
 319# would only count as 1 request towards this limit.   
 320  
 321#   
 322  
 323MaxRequestsPerChild 0   
 324  
 325  
 326  
 327#   
 328  
 329# Listen: Allows you to bind Apache to specific IP addresses and/or   
 330  
 331# ports, instead of the default. See also the <virtualhost>   
 332  
 333# directive.   
 334  
 335#   
 336  
 337#Listen 3000   
 338  
 339#Listen 218.104.52.217:80   
 340  
 341  
 342  
 343#   
 344  
 345# BindAddress: You can support virtual hosts with this option. This directive   
 346  
 347# is used to tell the server which IP address to listen to. It can either   
 348  
 349# contain "*", an IP address, or a fully qualified Internet domain name.   
 350  
 351# See also the <virtualhost> and Listen directives.   
 352  
 353#   
 354  
 355#BindAddress *   
 356  
 357  
 358  
 359#   
 360  
 361# Dynamic Shared Object (DSO) Support   
 362  
 363#   
 364  
 365# To be able to use the functionality of a module which was built as a DSO you   
 366  
 367# have to place corresponding `LoadModule' lines at this location so the   
 368  
 369# directives contained in it are actually available _before_ they are used.   
 370  
 371# Please read the file http://httpd.apache.org/docs/dso.html for more   
 372  
 373# details about the DSO mechanism and run `httpd -l' for the list of already   
 374  
 375# built-in (statically linked and thus always available) modules in your httpd   
 376  
 377# binary.   
 378  
 379#   
 380  
 381# Note: The order in which modules are loaded is important. Don't change   
 382  
 383# the order below without expert advice.   
 384  
 385#   
 386  
 387# Example:   
 388  
 389# LoadModule foo_module libexec/mod_foo.so   
 390  
 391LoadModule mmap_static_module libexec/apache/mod_mmap_static.so   
 392  
 393LoadModule vhost_alias_module libexec/apache/mod_vhost_alias.so   
 394  
 395LoadModule env_module libexec/apache/mod_env.so   
 396  
 397LoadModule config_log_module libexec/apache/mod_log_config.so   
 398  
 399LoadModule mime_magic_module libexec/apache/mod_mime_magic.so   
 400  
 401LoadModule mime_module libexec/apache/mod_mime.so   
 402  
 403LoadModule negotiation_module libexec/apache/mod_negotiation.so   
 404  
 405LoadModule status_module libexec/apache/mod_status.so   
 406  
 407LoadModule info_module libexec/apache/mod_info.so   
 408  
 409LoadModule includes_module libexec/apache/mod_include.so   
 410  
 411LoadModule autoindex_module libexec/apache/mod_autoindex.so   
 412  
 413LoadModule dir_module libexec/apache/mod_dir.so   
 414  
 415LoadModule cgi_module libexec/apache/mod_cgi.so   
 416  
 417LoadModule asis_module libexec/apache/mod_asis.so   
 418  
 419LoadModule imap_module libexec/apache/mod_imap.so   
 420  
 421LoadModule action_module libexec/apache/mod_actions.so   
 422  
 423LoadModule speling_module libexec/apache/mod_speling.so   
 424  
 425LoadModule userdir_module libexec/apache/mod_userdir.so   
 426  
 427LoadModule alias_module libexec/apache/mod_alias.so   
 428  
 429LoadModule rewrite_module libexec/apache/mod_rewrite.so   
 430  
 431LoadModule access_module libexec/apache/mod_access.so   
 432  
 433LoadModule auth_module libexec/apache/mod_auth.so   
 434  
 435LoadModule anon_auth_module libexec/apache/mod_auth_anon.so   
 436  
 437LoadModule db_auth_module libexec/apache/mod_auth_db.so   
 438  
 439LoadModule digest_module libexec/apache/mod_digest.so   
 440  
 441LoadModule proxy_module libexec/apache/libproxy.so   
 442  
 443LoadModule cern_meta_module libexec/apache/mod_cern_meta.so   
 444  
 445LoadModule expires_module libexec/apache/mod_expires.so   
 446  
 447LoadModule headers_module libexec/apache/mod_headers.so   
 448  
 449LoadModule usertrack_module libexec/apache/mod_usertrack.so   
 450  
 451LoadModule unique_id_module libexec/apache/mod_unique_id.so   
 452  
 453LoadModule setenvif_module libexec/apache/mod_setenvif.so   
 454  
 455LoadModule php4_module libexec/apache/libphp4.so   
 456  
 457#LoadModule gzip_module libexec/apache/mod_gzip.so   
 458  
 459LoadModule fastcgi_module libexec/apache/mod_fastcgi.so   
 460  
 461LoadModule perl_module libexec/apache/libperl.so   
 462  
 463  
 464  
 465# Reconstruction of the complete module list from all available modules   
 466  
 467# (static and shared ones) to achieve correct module execution order.   
 468  
 469# [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]   
 470  
 471ClearModuleList   
 472  
 473AddModule mod_mmap_static.c   
 474  
 475AddModule mod_vhost_alias.c   
 476  
 477AddModule mod_env.c   
 478  
 479AddModule mod_log_config.c   
 480  
 481AddModule mod_mime_magic.c   
 482  
 483AddModule mod_mime.c   
 484  
 485AddModule mod_negotiation.c   
 486  
 487AddModule mod_status.c   
 488  
 489AddModule mod_info.c   
 490  
 491AddModule mod_include.c   
 492  
 493AddModule mod_autoindex.c   
 494  
 495AddModule mod_dir.c   
 496  
 497AddModule mod_cgi.c   
 498  
 499AddModule mod_asis.c   
 500  
 501AddModule mod_imap.c   
 502  
 503AddModule mod_actions.c   
 504  
 505AddModule mod_speling.c   
 506  
 507AddModule mod_userdir.c   
 508  
 509AddModule mod_alias.c   
 510  
 511AddModule mod_rewrite.c   
 512  
 513AddModule mod_access.c   
 514  
 515AddModule mod_auth.c   
 516  
 517AddModule mod_auth_anon.c   
 518  
 519AddModule mod_auth_db.c   
 520  
 521AddModule mod_digest.c   
 522  
 523AddModule mod_proxy.c   
 524  
 525AddModule mod_cern_meta.c   
 526  
 527AddModule mod_expires.c   
 528  
 529AddModule mod_headers.c   
 530  
 531AddModule mod_usertrack.c   
 532  
 533AddModule mod_unique_id.c   
 534  
 535AddModule mod_so.c   
 536  
 537AddModule mod_setenvif.c   
 538  
 539AddModule mod_php4.c   
 540  
 541#AddModule mod_gzip.c   
 542  
 543AddModule mod_fastcgi.c   
 544  
 545AddModule mod_perl.c   
 546  
 547  
 548  
 549#   
 550  
 551# ExtendedStatus controls whether Apache will generate "full" status   
 552  
 553# information (ExtendedStatus On) or just basic information (ExtendedStatus   
 554  
 555# Off) when the "server-status" handler is called. The default is Off.   
 556  
 557#   
 558  
 559#ExtendedStatus On   
 560  
 561  
 562  
 563### Section 2: 'Main' server configuration   
 564  
 565#   
 566  
 567# The directives in this section set up the values used by the 'main'   
 568  
 569# server, which responds to any requests that aren't handled by a   
 570  
 571# <virtualhost> definition. These values also provide defaults for   
 572  
 573# any <virtualhost> containers you may define later in the file.   
 574  
 575#   
 576  
 577# All of these directives may appear inside <virtualhost> containers,   
 578  
 579# in which case these default settings will be overridden for the   
 580  
 581# virtual host being defined.   
 582  
 583#   
 584  
 585  
 586  
 587#   
 588  
 589# If your ServerType directive (set earlier in the 'Global Environment'   
 590  
 591# section) is set to "inetd", the next few directives don't have any   
 592  
 593# effect since their settings are defined by the inetd configuration.   
 594  
 595# Skip ahead to the ServerAdmin directive.   
 596  
 597#   
 598  
 599  
 600  
 601#   
 602  
 603# Port: The port to which the standalone server listens. For   
 604  
 605# ports &lt; 1023, you will need httpd to be run as root initially.   
 606  
 607#   
 608  
 609Port 80   
 610  
 611DirectoryIndex index.php index.html   
 612  
 613  
 614  
 615AddType appilcation/x-httpd-php .php   
 616  
 617AddType application/x-httpd-php-source .phps   
 618  
 619AddHandler fastcgi-script fcgi fcgi fpl   
 620  
 621#   
 622  
 623# If you wish httpd to run as a different user or group, you must run   
 624  
 625# httpd as root initially and it will switch.   
 626  
 627#   
 628  
 629# User/Group: The name (or #number) of the user/group to run httpd as.   
 630  
 631# . On SCO (ODT 3) use "User nouser" and "Group nogroup".   
 632  
 633# . On HPUX you may not be able to use shared memory as nobody, and the   
 634  
 635# suggested workaround is to create a user www and use that user.   
 636  
 637# NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)   
 638  
 639# when the value of (unsigned)Group is above 60000;   
 640  
 641# don't use Group "#-1" on these systems!   
 642  
 643#   
 644  
 645User www   
 646  
 647Group www   
 648  
 649  
 650  
 651#   
 652  
 653# ServerAdmin: Your address, where problems with the server should be   
 654  
 655# e-mailed. This address appears on some server-generated pages, such   
 656  
 657# as error documents.   
 658  
 659#   
 660  
 661ServerAdmin [email protected]   
 662  
 663  
 664  
 665#   
 666  
 667# ServerName allows you to set a host name which is sent back to clients for   
 668  
 669# your server if it's different than the one the program would get (i.e., use   
 670  
 671# "www" instead of the host's real name).   
 672  
 673#   
 674  
 675# Note: You cannot just invent host names and hope they work. The name you   
 676  
 677# define here must be a valid DNS name for your host. If you don't understand   
 678  
 679# this, ask your network administrator.   
 680  
 681# If your host doesn't have a registered DNS name, enter its IP address here.   
 682  
 683# You will have to access it by its address (e.g., http://123.45.67.89/ )   
 684  
 685# anyway, and this will make redirections work in a sensible way.   
 686  
 687#   
 688  
 689# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your   
 690  
 691# machine always knows itself by this address. If you use Apache strictly for   
 692  
 693# local testing and development, you may use 127.0.0.1 as the server name.   
 694  
 695#   
 696  
 697ServerName 127.0.0.1   
 698  
 699  
 700  
 701#   
 702  
 703# DocumentRoot: The directory out of which you will serve your   
 704  
 705# documents. By default, all requests are taken from this directory, but   
 706  
 707# symbolic links and aliases may be used to point to other locations.   
 708  
 709#   
 710  
 711DocumentRoot "/usr/local/www/data"   
 712  
 713  
 714  
 715#   
 716  
 717# Each directory to which Apache has access, can be configured with respect   
 718  
 719# to which services and features are allowed and/or disabled in that   
 720  
 721# directory (and its subdirectories).   
 722  
 723#   
 724  
 725# First, we configure the "default" to be a very restrictive set of   
 726  
 727# permissions.   
 728  
 729#   
 730  
 731<directory></directory>   
 732  
 733Options FollowSymLinks   
 734  
 735AllowOverride None   
 736  
 737   
 738  
 739  
 740  
 741#   
 742  
 743# Note that from this point forward you must specifically allow   
 744  
 745# particular features to be enabled - so if something's not working as   
 746  
 747# you might expect, make sure that you have specifically enabled it   
 748  
 749# below.   
 750  
 751#   
 752  
 753  
 754  
 755#   
 756  
 757# This should be changed to whatever you set DocumentRoot to.   
 758  
 759#   
 760  
 761<directory "="" data"="" local="" usr="" www="">   
 762  
 763  
 764  
 765#   
 766  
 767# This may also be "None", "All", or any combination of "Indexes",   
 768  
 769# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".   
 770  
 771#   
 772  
 773# Note that "MultiViews" must be named *explicitly* --- "Options All"   
 774  
 775# doesn't give it to you.   
 776  
 777#   
 778  
 779Options Indexes FollowSymLinks MultiViews   
 780  
 781  
 782  
 783#   
 784  
 785# This controls which options the .htaccess files in directories can   
 786  
 787# override. Can also be "All", or any combination of "Options", "FileInfo",   
 788  
 789# "AuthConfig", and "Limit"   
 790  
 791#   
 792  
 793AllowOverride None   
 794  
 795  
 796  
 797#   
 798  
 799# Controls who can get stuff from this server.   
 800  
 801#   
 802  
 803Order allow,deny   
 804  
 805Allow from all   
 806  
 807</directory>   
 808  
 809  
 810  
 811#   
 812  
 813# UserDir: The name of the directory which is appended onto a user's home   
 814  
 815# directory if a ~user request is received.   
 816  
 817#   
 818  
 819<ifmodule mod_userdir.c="">   
 820  
 821UserDir public_html   
 822  
 823</ifmodule>   
 824  
 825  
 826  
 827#   
 828  
 829# Control access to UserDir directories. The following is an example   
 830  
 831# for a site where these directories are restricted to read-only.   
 832  
 833#   
 834  
 835#<directory *="" home="" public_html="">   
 836  
 837# AllowOverride FileInfo AuthConfig Limit   
 838  
 839# Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec   
 840  
 841# <limit get="" options="" post="" propfind="">   
 842  
 843# Order allow,deny   
 844  
 845# Allow from all   
 846  
 847# </limit>   
 848  
 849# <limitexcept get="" options="" post="" propfind="">   
 850  
 851# Order deny,allow   
 852  
 853# Deny from all   
 854  
 855# </limitexcept>   
 856  
 857#</directory>   
 858  
 859  
 860  
 861#   
 862  
 863# DirectoryIndex: Name of the file or files to use as a pre-written HTML   
 864  
 865# directory index. Separate multiple entries with spaces.   
 866  
 867#   
 868  
 869<ifmodule mod_dir.c="">
 870<ifmodule mod_php3.c="">
 871<ifmodule mod_php4.c="">   
 872  
 873DirectoryIndex index.php index.php3 index.html   
 874  
 875</ifmodule>
 876<ifmodule !mod_php4.c="">   
 877  
 878DirectoryIndex index.php3 index.html   
 879  
 880</ifmodule>
 881</ifmodule>
 882<ifmodule !mod_php3.c="">
 883<ifmodule mod_php4.c="">   
 884  
 885DirectoryIndex index.php index.html   
 886  
 887</ifmodule>
 888<ifmodule !mod_php4.c="">   
 889  
 890DirectoryIndex index.html   
 891  
 892</ifmodule>
 893</ifmodule>
 894</ifmodule>   
 895  
 896  
 897  
 898#   
 899  
 900# AccessFileName: The name of the file to look for in each directory   
 901  
 902# for access control information.   
 903  
 904#   
 905  
 906AccessFileName .htaccess   
 907  
 908  
 909  
 910#   
 911  
 912# The following lines prevent .htaccess files from being viewed by   
 913  
 914# Web clients. Since .htaccess files often contain authorization   
 915  
 916# information, access is disallowed for security reasons. Comment   
 917  
 918# these lines out if you want Web visitors to see the contents of   
 919  
 920# .htaccess files. If you change the AccessFileName directive above,   
 921  
 922# be sure to make the corresponding changes here.   
 923  
 924#   
 925  
 926# Also, folks tend to use names such as .htpasswd for password   
 927  
 928# files, so this will protect those as well.   
 929  
 930#   
 931  
 932<files "^\\.ht"="" ~="">   
 933  
 934Order allow,deny   
 935  
 936Deny from all   
 937  
 938Satisfy All   
 939  
 940</files>   
 941  
 942  
 943  
 944#   
 945  
 946# CacheNegotiatedDocs: By default, Apache sends "Pragma: no-cache" with each   
 947  
 948# document that was negotiated on the basis of content. This asks proxy   
 949  
 950# servers not to cache the document. Uncommenting the following line disables   
 951  
 952# this behavior, and proxies will be allowed to cache the documents.   
 953  
 954#   
 955  
 956#CacheNegotiatedDocs   
 957  
 958  
 959  
 960#   
 961  
 962# UseCanonicalName: (new for 1.3) With this setting turned on, whenever   
 963  
 964# Apache needs to construct a self-referencing URL (a URL that refers back   
 965  
 966# to the server the response is coming from) it will use ServerName and   
 967  
 968# Port to form a "canonical" name. With this setting off, Apache will   
 969  
 970# use the hostname ![](http://linuxsir.zahui.net/html/11/images/smilies/tongue.gif) ort that the client supplied, when possible. This   
 971  
 972# also affects SERVER_NAME and SERVER_PORT in CGI scripts.   
 973  
 974#   
 975  
 976UseCanonicalName On   
 977  
 978  
 979  
 980#   
 981  
 982# TypesConfig describes where the mime.types file (or equivalent) is   
 983  
 984# to be found.   
 985  
 986#   
 987  
 988<ifmodule mod_mime.c="">   
 989  
 990TypesConfig /usr/local/etc/apache/mime.types   
 991  
 992</ifmodule>   
 993  
 994  
 995  
 996#   
 997  
 998# DefaultType is the default MIME type the server will use for a document   
 999  
1000# if it cannot otherwise determine one, such as from filename extensions.   
1001  
1002# If your server contains mostly text or HTML documents, "text/plain" is   
1003  
1004# a good value. If most of your content is binary, such as applications   
1005  
1006# or images, you may want to use "application/octet-stream" instead to   
1007  
1008# keep browsers from trying to display binary files as though they are   
1009  
1010# text.   
1011  
1012#   
1013  
1014DefaultType text/plain   
1015  
1016  
1017  
1018#   
1019  
1020# The mod_mime_magic module allows the server to use various hints from the   
1021  
1022# contents of the file itself to determine its type. The MIMEMagicFile   
1023  
1024# directive tells the module where the hint definitions are located.   
1025  
1026# mod_mime_magic is not part of the default server (you have to add   
1027  
1028# it yourself with a LoadModule [see the DSO paragraph in the 'Global   
1029  
1030# Environment' section], or recompile the server and include mod_mime_magic   
1031  
1032# as part of the configuration), so it's enclosed in an <ifmodule> container.   
1033  
1034# This means that the MIMEMagicFile directive will only be processed if the   
1035  
1036# module is part of the server.   
1037  
1038#   
1039  
1040<ifmodule mod_mime_magic.c="">   
1041  
1042MIMEMagicFile /usr/local/etc/apache/magic   
1043  
1044</ifmodule>   
1045  
1046  
1047  
1048#   
1049  
1050# HostnameLookups: Log the names of clients or just their IP addresses   
1051  
1052# e.g., www.apache.org (on) or 204.62.129.132 (off).   
1053  
1054# The default is off because it'd be overall better for the net if people   
1055  
1056# had to knowingly turn this feature on, since enabling it means that   
1057  
1058# each client request will result in AT LEAST one lookup request to the   
1059  
1060# nameserver.   
1061  
1062#   
1063  
1064HostnameLookups Off   
1065  
1066  
1067  
1068#   
1069  
1070# ErrorLog: The location of the error log file.   
1071  
1072# If you do not specify an ErrorLog directive within a <virtualhost>   
1073  
1074# container, error messages relating to that virtual host will be   
1075  
1076# logged here. If you *do* define an error logfile for a <virtualhost>   
1077  
1078# container, that host's errors will be logged there and not here.   
1079  
1080#   
1081  
1082ErrorLog /var/log/httpd-error.log   
1083  
1084  
1085  
1086#   
1087  
1088# LogLevel: Control the number of messages logged to the error_log.   
1089  
1090# Possible values include: debug, info, notice, warn, error, crit,   
1091  
1092# alert, emerg.   
1093  
1094#   
1095  
1096LogLevel warn   
1097  
1098  
1099  
1100#   
1101  
1102# The following directives define some format nicknames for use with   
1103  
1104# a CustomLog directive (see below).   
1105  
1106#   
1107  
1108LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined   
1109  
1110LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common   
1111  
1112LogFormat "%{Referer}i -&gt; %U" referer   
1113  
1114LogFormat "%{User-agent}i" agent   
1115  
1116  
1117  
1118#   
1119  
1120# The location and format of the access logfile (Common Logfile Format).   
1121  
1122# If you do not define any access logfiles within a <virtualhost>   
1123  
1124# container, they will be logged here. Contrariwise, if you *do*   
1125  
1126# define per-<virtualhost> access logfiles, transactions will be   
1127  
1128# logged therein and *not* in this file.   
1129  
1130#   
1131  
1132#CustomLog /var/log/httpd-access.log common   
1133  
1134  
1135  
1136#   
1137  
1138# If you would like to have agent and referer logfiles, uncomment the   
1139  
1140# following directives.   
1141  
1142#   
1143  
1144#CustomLog /var/log/httpd-referer.log referer   
1145  
1146#CustomLog /var/log/httpd-agent.log agent   
1147  
1148  
1149  
1150#   
1151  
1152# If you prefer a single logfile with access, agent, and referer information   
1153  
1154# (Combined Logfile Format) you can use the following directive.   
1155  
1156#   
1157  
1158CustomLog /var/log/httpd-access.log combined   
1159  
1160  
1161  
1162#   
1163  
1164# Optionally add a line containing the server version and virtual host   
1165  
1166# name to server-generated pages (error documents, FTP directory listings,   
1167  
1168# mod_status and mod_info output etc., but not CGI generated documents).   
1169  
1170# Set to "EMail" to also include a mailto: link to the ServerAdmin.   
1171  
1172# Set to one of: On | Off | EMail   
1173  
1174#   
1175  
1176ServerSignature On   
1177  
1178  
1179  
1180# EBCDIC configuration:   
1181  
1182# (only for mainframes using the EBCDIC codeset, currently one of:   
1183  
1184# Fujitsu-Siemens' BS2000/OSD, IBM's OS/390 and IBM's TPF)!!   
1185  
1186# The following default configuration assumes that "text files"   
1187  
1188# are stored in EBCDIC (so that you can operate on them using the   
1189  
1190# normal POSIX tools like grep and sort) while "binary files" are   
1191  
1192# stored with identical octets as on an ASCII machine.   
1193  
1194#   
1195  
1196# The directives are evaluated in configuration file order, with   
1197  
1198# the EBCDICConvert directives applied before EBCDICConvertByType.   
1199  
1200#   
1201  
1202# If you want to have ASCII HTML documents and EBCDIC HTML documents   
1203  
1204# at the same time, you can use the file extension to force   
1205  
1206# conversion off for the ASCII documents:   
1207  
1208# &gt; AddType text/html .ahtml   
1209  
1210# &gt; EBCDICConvert Off=InOut .ahtml   
1211  
1212#   
1213  
1214# EBCDICConvertByType On=InOut text/* message/* multipart/*   
1215  
1216# EBCDICConvertByType On=In application/x-www-form-urlencoded   
1217  
1218# EBCDICConvertByType On=InOut application/postscript model/vrml   
1219  
1220# EBCDICConvertByType Off=InOut */*   
1221  
1222  
1223  
1224  
1225  
1226#   
1227  
1228# Aliases: Add here as many aliases as you need (with no limit). The format is   
1229  
1230# Alias fakename realname   
1231  
1232#   
1233  
1234<ifmodule mod_alias.c="">   
1235  
1236  
1237  
1238#   
1239  
1240# Note that if you include a trailing / on fakename then the server will   
1241  
1242# require it to be present in the URL. So "/icons" isn't aliased in this   
1243  
1244# example, only "/icons/". If the fakename is slash-terminated, then the   
1245  
1246# realname must also be slash terminated, and if the fakename omits the   
1247  
1248# trailing slash, the realname must also omit it.   
1249  
1250#   
1251  
1252Alias /icons/ "/usr/local/www/icons/"   
1253  
1254  
1255  
1256<directory "="" icons"="" local="" usr="" www="">   
1257  
1258Options Indexes MultiViews   
1259  
1260AllowOverride None   
1261  
1262Order allow,deny   
1263  
1264Allow from all   
1265  
1266</directory>   
1267  
1268  
1269  
1270# This Alias will project the on-line documentation tree under /manual/   
1271  
1272# even if you change the DocumentRoot. Comment it if you don't want to   
1273  
1274# provide access to the on-line documentation.   
1275  
1276#   
1277  
1278Alias /manual/ "/usr/local/share/doc/apache/"   
1279  
1280  
1281  
1282<directory "="" apache"="" doc="" local="" share="" usr="">   
1283  
1284Options Indexes FollowSymlinks MultiViews   
1285  
1286AllowOverride None   
1287  
1288Order allow,deny   
1289  
1290Allow from all   
1291  
1292</directory>   
1293  
1294  
1295  
1296#   
1297  
1298# ScriptAlias: This controls which directories contain server scripts.   
1299  
1300# ScriptAliases are essentially the same as Aliases, except that   
1301  
1302# documents in the realname directory are treated as applications and   
1303  
1304# run by the server when requested rather than as documents sent to the client.   
1305  
1306# The same rules about trailing "/" apply to ScriptAlias directives as to   
1307  
1308# Alias.   
1309  
1310#   
1311  
1312ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/"   
1313  
1314  
1315  
1316#   
1317  
1318# "/usr/local/www/cgi-bin" should be changed to whatever your ScriptAliased   
1319  
1320# CGI directory exists, if you have that configured.   
1321  
1322#   
1323  
1324<directory "="" cgi-bin"="" local="" usr="" www="">   
1325  
1326AllowOverride None   
1327  
1328Options None   
1329  
1330Order allow,deny   
1331  
1332Allow from all   
1333  
1334</directory>
1335</ifmodule>   
1336  
1337# End of aliases.   
1338  
1339  
1340  
1341#   
1342  
1343# Redirect allows you to tell clients about documents which used to exist in   
1344  
1345# your server's namespace, but do not anymore. This allows you to tell the   
1346  
1347# clients where to look for the relocated document.   
1348  
1349# Format: Redirect old-URI new-URL   
1350  
1351#   
1352  
1353  
1354  
1355#   
1356  
1357# Directives controlling the display of server-generated directory listings.   
1358  
1359#   
1360  
1361<ifmodule mod_autoindex.c="">   
1362  
1363  
1364  
1365#   
1366  
1367# FancyIndexing is whether you want fancy directory indexing or standard   
1368  
1369#   
1370  
1371IndexOptions FancyIndexing   
1372  
1373  
1374  
1375#   
1376  
1377# AddIcon* directives tell the server which icon to show for different   
1378  
1379# files or filename extensions. These are only displayed for   
1380  
1381# FancyIndexed directories.   
1382  
1383#   
1384  
1385AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip   
1386  
1387  
1388  
1389AddIconByType (TXT,/icons/text.gif) text/*   
1390  
1391AddIconByType (IMG,/icons/image2.gif) image/*   
1392  
1393AddIconByType (SND,/icons/sound2.gif) audio/*   
1394  
1395AddIconByType (VID,/icons/movie.gif) video/*   
1396  
1397  
1398  
1399AddIcon /icons/binary.gif .bin .exe   
1400  
1401AddIcon /icons/binhex.gif .hqx   
1402  
1403AddIcon /icons/tar.gif .tar   
1404  
1405AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv   
1406  
1407AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip   
1408  
1409AddIcon /icons/a.gif .ps .ai .eps   
1410  
1411AddIcon /icons/layout.gif .html .shtml .htm .pdf   
1412  
1413AddIcon /icons/text.gif .txt   
1414  
1415AddIcon /icons/c.gif .c   
1416  
1417AddIcon /icons/p.gif .pl .py   
1418  
1419AddIcon /icons/f.gif .for   
1420  
1421AddIcon /icons/dvi.gif .dvi   
1422  
1423AddIcon /icons/uuencoded.gif .uu   
1424  
1425AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl   
1426  
1427AddIcon /icons/tex.gif .tex   
1428  
1429AddIcon /icons/bomb.gif core   
1430  
1431  
1432  
1433AddIcon /icons/back.gif ..   
1434  
1435AddIcon /icons/hand.right.gif README   
1436  
1437AddIcon /icons/folder.gif ^^DIRECTORY^^   
1438  
1439AddIcon /icons/blank.gif ^^BLANKICON^^   
1440  
1441  
1442  
1443#   
1444  
1445# DefaultIcon is which icon to show for files which do not have an icon   
1446  
1447# explicitly set.   
1448  
1449#   
1450  
1451DefaultIcon /icons/unknown.gif   
1452  
1453  
1454  
1455#   
1456  
1457# AddDescription allows you to place a short description after a file in   
1458  
1459# server-generated indexes. These are only displayed for FancyIndexed   
1460  
1461# directories.   
1462  
1463# Format: AddDescription "description" filename   
1464  
1465#   
1466  
1467#AddDescription "GZIP compressed document" .gz   
1468  
1469#AddDescription "tar archive" .tar   
1470  
1471#AddDescription "GZIP compressed tar archive" .tgz   
1472  
1473  
1474  
1475#   
1476  
1477# ReadmeName is the name of the README file the server will look for by   
1478  
1479# default, and append to directory listings.   
1480  
1481#   
1482  
1483# HeaderName is the name of a file which should be prepended to   
1484  
1485# directory indexes.   
1486  
1487#   
1488  
1489ReadmeName README   
1490  
1491HeaderName HEADER   
1492  
1493  
1494  
1495#   
1496  
1497# IndexIgnore is a set of filenames which directory indexing should ignore   
1498  
1499# and not include in the listing.</ifmodule></virtualhost></virtualhost></virtualhost></virtualhost></ifmodule></virtualhost></virtualhost></virtualhost></virtualhost></virtualhost></url:></url:>
Published At
Categories with 服务器类
Tagged with
comments powered by Disqus