httpd.conf

来源:互联网 发布:淘宝一元换购怎么做 编辑:程序博客网 时间:2024/05/01 08:51

  1 #

  2 # This is the main Apache HTTP serverconfiguration file.  It contains the

  3 # configuration directives that give theserver its instructions.

  4 # See<URL:http://httpd.apache.org/docs/2.2> for detailed information.

  5 # In particular, see

  6 #<URL:http://httpd.apache.org/docs/2.2/mod/directives.html>

  7 # for a discussion of each configurationdirective.

  8 #

  9 # Do NOT simply read the instructions inhere without understanding

 10 # what they do.  They're here only as hints or reminders.  If you are unsure

 11 # consult the online docs. You have beenwarned. 

 12 #

 13 # Configuration and logfile names: If thefilenames you specify for many

 14 # of the server's control files begin with"/" (or "drive:/" for Win32), the

 15 # server will use that explicit path.  If the filenames do *not* begin

 16 # with "/", the value ofServerRoot is prepended -- so "logs/foo_log"

 17 # with ServerRoot set to"/user/local/apache" will be interpreted by the

 18 # server as "/user/local/apache/logs/foo_log".

 19

 20 #

 21 # ServerRoot: The top of the directory treeunder which the server's

 22 # configuration, error, and log files arekept.

 23 #

 24 # Do not add a slash at the end of thedirectory path.  If you point

 25 # ServerRoot at a non-local disk, be sureto point the LockFile directive

 26 # at a local disk.  If you wish to share the same ServerRoot formultiple

 27 # httpd daemons, you will need to change atleast LockFile and PidFile.

 28 #

 29 ServerRoot"/user/local/apache"

 30

31 #

 32 # Listen: Allows you to bind Apache tospecific IP addresses and/or

 33 # ports, instead of the default. See alsothe <VirtualHost>

 34 # directive.

 35 #

 36 # Change this to Listen on specific IPaddresses as shown below to

 37 # prevent Apache from glomming onto allbound IP addresses.

 38 #

 39 #Listen 12.34.56.78:80

 40 Listen80

 41 Includeconf.d/*.conf

 42 #

 43 # Dynamic Shared Object (DSO) Support

 44 #

 45 # To be able to use the functionality of amodule which was built as a DSO you

 46 # have to place corresponding `LoadModule'lines at this location so the

 47 # directives contained in it are actuallyavailable _before_ they are used.

 48 # Statically compiled modules (those listedby `httpd -l') do not need

 49 # to be loaded here.

 50 #

 51 # Example:

 52 # LoadModule foo_module modules/mod_foo.so

 53 LoadModulephp5_module        modules/libphp5.so

 54 AddTypeapplication/x-httpd-php.php

 55 #

 56

 57 <IfModule !mpm_netware_module>

 58 <IfModule !mpm_winnt_module>

 59 #

 60 # If you wish httpd to run as a differentuser or group, you must run

 61 # httpd as root initially and it willswitch. 

 62 #

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

 64 # It is usually good practice to create adedicated user and group for

 65 # running httpd, as with most systemservices.

 66 #

 67 User apache

 68 Group apache

 69

 70 <IfModuledir_module>

 71        DirectoryIndex index.php index.html

 72 </IfModule>

 73

 74 # 'Main' server configuration

 75 #

 76 # The directives in this section set up thevalues used by the 'main'

 77 # server, which responds to any requeststhat aren't handled by a

 78 # <VirtualHost> definition.  These values also provide defaults for

 79 # any <VirtualHost> containers you maydefine later in the file.

 80 #

 81 # All of these directives may appear inside<VirtualHost> containers,

 82 # in which case these default settings willbe overridden for the

 83 # virtual host being defined.

 83 # virtual host being defined.

 84 #

 85

 86 #

 87 # ServerAdmin: Your address, where problemswith the server should be

 88 # e-mailed. This address appears on some server-generated pages, such

 89 # as error documents.  e.g. admin@your-domain.com

 90 #

 91 ServerAdminyou@example.com

 92

 93 #

 94 # ServerName gives the name and port thatthe server uses to identify itself.

 95 # This can often be determinedautomatically, but we recommend you specify

 96 # it explicitly to prevent problems duringstartup.

 97 #

 98 # If your host doesn't have a registeredDNS name, enter its IP address here.

 99 #

100ServerName localhost.localdomain:80

101

102 #

103 #DocumentRoot: The directory out of which you will serve your

104 #documents. By default, all requests are taken from this directory, but

105 # symboliclinks and aliases may be used to point to other locations.

106 #

107 DocumentRoot"/user/local/apache/htdocs"

108

109 #

110 # Eachdirectory to which Apache has access can be configured with respect

111 # to whichservices and features are allowed and/or disabled in that

112 # directory(and its subdirectories).

113 #

114 # First, weconfigure the "default" to be a very restrictive set of

115 #features. 

116 #

117 <Directory />

118     Options FollowSymLinks

119     AllowOverrideNone

120     Orderdeny,allow

121     Denyfromall

122 </Directory>

123

124 #

125 # Note thatfrom this point forward you must specifically allow

126 #particular features to be enabled - so if something's not working as

127 # you mightexpect, make sure that you have specifically enabled it

128 # below.

129 #

130

131 #

132 # Thisshould be changed to whatever you set DocumentRoot to.

133 #

134 <Directory "/user/local/apache/htdocs">

135     #

136     # Possible values for the Optionsdirective are "None", "All",

137     # or any combination of:

138     #  Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews

139     #

140     # Note that "MultiViews" must benamed *explicitly* --- "Options All"

141     # doesn't give it to you.

142     #

143     # The Options directive is bothcomplicated and important.  Please see

144     #http://httpd.apache.org/docs/2.2/mod/core.html#options

145     # for more information.

146     #

147     OptionsIndexes FollowSymLinks

148

149     #

150     # AllowOverride controls what directivesmay be placed in .htaccess files.

151     # It can be "All","None", or any combination of the keywords:

152     #  Options FileInfo AuthConfig Limit

153     #

154     AllowOverrideNone

155

156     #

157     # Controls who can get stuff from thisserver.

158     #

159     Orderallow,deny

160     Allowfromall

161

162 </Directory>

163

164 #

165 #DirectoryIndex: sets the file that Apache will serve if a directory

166 # isrequested.

167 #

168#<IfModule dir_module>

169 #    DirectoryIndex index.html

170#</IfModule>

171

172 #

173 # Thefollowing lines prevent .htaccess and .htpasswd files from being

174 # viewed byWeb clients.

175 #

176 <FilesMatch "^\.ht">

177     Orderallow,deny

178     Denyfromall

179     SatisfyAll

180 </FilesMatch>

181

182 #

183 # ErrorLog:The location of the error log file.

184 # If you donot specify an ErrorLog directive within a <VirtualHost>

185 #container, error messages relating to that virtual host will be

186 # loggedhere.  If you *do* define an errorlogfile for a <VirtualHost>

187 #container, that host's errors will be logged there and not here.

188 #

189ErrorLog "logs/error_log"

190

191 #

192 # LogLevel:Control the number of messages logged to the error_log.

193 # Possiblevalues include: debug, info, notice, warn, error, crit,

194 # alert,emerg.

195 #

196LogLevel warn

197

198 <IfModulelog_config_module>

199     #

200     # The following directives define someformat nicknames for use with

201     # a CustomLog directive (see below).

202     #

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

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

205

206     <IfModule logio_module>

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

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

209     </IfModule>

210

211     #

212     # The location and format of the accesslogfile (Common Logfile Format).

213     # If you do not define any access logfileswithin a <VirtualHost>

214     # container, they will be loggedhere.  Contrariwise, if you *do*

215     # define per-<VirtualHost> accesslogfiles, transactions will be

216     # logged therein and *not* in this file.

217     #

218     CustomLog "logs/access_log"common

219

220     #

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

222     # (Combined Logfile Format) you can usethe following directive.

223     #

224     #CustomLog "logs/access_log"combined

225 </IfModule>

226

227 <IfModule alias_module>

228     #

229     # Redirect: Allows you to tell clientsabout documents that used to

230     # exist in your server's namespace, but donot anymore. The client

231     # will make a new request for the documentat its new location.

232     # Example:

233     # Redirect permanent /foohttp://www.example.com/bar

234

235     #

236     # Alias: Maps web paths into filesystempaths and is used to

237     # access content that does not live underthe DocumentRoot.

238     # Example:

239     # Alias /webpath /full/filesystem/path

240     #

241     # If you include a trailing / on /webpaththen the server will

242     # require it to be present in theURL.  You will also likely

243     # need to provide a <Directory>section to allow access to

244     # the filesystem path.

245

246     #

247     # ScriptAlias: This controls whichdirectories contain server scripts.

248     # ScriptAliases are essentially the sameas Aliases, except that

249     #documents in the target directory are treated as applications and

250     # run by the server when requested ratherthan as documents sent to the

251     # client. The same rules about trailing "/" apply to ScriptAlias

252     # directives as to Alias.

253     #

254     ScriptAlias/cgi-bin/"/user/local/apache/cgi-bin/"

255

256 </IfModule>

257

258 <IfModulecgid_module>

259     #

260     # ScriptSock: On threaded servers,designate the path to the UNIX

261     # socket used to communicate with the CGIdaemon of mod_cgid.

262     #

263     #Scriptsock logs/cgisock

264 </IfModule>

265

266 #

267 #"/user/local/apache/cgi-bin" should be changed to whatever yourScriptAliased

268 # CGIdirectory exists, if you have that configured.

269 #

270 <Directory "/user/local/apache/cgi-bin">

271     AllowOverrideNone

272     Options None

273     Orderallow,deny

274     Allowfromall

275 </Directory>

276

277 #

278 #DefaultType: the default MIME type the server will use for a document

279 # if itcannot otherwise determine one, such as from filename extensions.

280 # If yourserver contains mostly text or HTML documents, "text/plain" is

281 # a goodvalue.  If most of your content isbinary, such as applications

282 # orimages, you may want to use "application/octet-stream" instead to

283 # keepbrowsers from trying to display binary files as though they are

284 # text.

285 #

286 DefaultType text/plain

287

288 <IfModule mime_module>

289     #

290     # TypesConfig points to the filecontaining the list of mappings from

291     # filename extension to MIME-type.

292     #

293     TypesConfigconf/mime.types

294

295     #

296     # AddType allows you to add to or overridethe MIME configuration

297     # file specified in TypesConfig forspecific file types.

298     #

299     #AddType application/x-gzip .tgz

300     #

301     # AddEncoding allows you to have certainbrowsers uncompress

302     # information on the fly. Note: Not allbrowsers support this.

303     #

304     #AddEncoding x-compress .Z

305     #AddEncoding x-gzip .gz .tgz

306     #

307     # If the AddEncoding directives above arecommented-out, then you

308     # probably should define those extensionsto indicate media types:

309     #

310     AddTypeapplication/x-compress .Z

311     AddTypeapplication/x-gzip .gz .tgz

312

313     #

314     # AddHandler allows you to map certainfile extensions to "handlers":

315     # actions unrelated to filetype. These canbe either built into the server

316     # or added with the Action directive (seebelow)

317     #

318     # To use CGI scripts outside ofScriptAliased directories:

319     # (You will also need to add"ExecCGI" to the "Options" directive.)

320     #

321     #AddHandler cgi-script .cgi

322

323     # For type maps (negotiated resources):

324     #AddHandler type-map var

325

326     #

327     # Filters allow you to process contentbefore it is sent to the client.

328     #

329     # To parse .shtml files for server-sideincludes (SSI):

330     # (You will also need to add"Includes" to the "Options" directive.)

331     #

332     #AddType text/html .shtml

333     #AddOutputFilter INCLUDES .shtml

334 </IfModule>

335

336 #

337 # Themod_mime_magic module allows the server to use various hints from the

338 # contentsof the file itself to determine its type. The MIMEMagicFile

339 # directivetells the module where the hint definitions are located.

340 #

341#MIMEMagicFile conf/magic

342

343 #

344 #Customizable error responses come in three flavors:

345 # 1) plaintext 2) local redirects 3) external redirects

346 #

347 # Someexamples:

348#ErrorDocument 500 "The server made a boo boo."

349#ErrorDocument 404 /missing.html

350#ErrorDocument 404 "/cgi-bin/missing_handler.pl"

351#ErrorDocument 402 http://www.example.com/subscription_info.html

352 #

353

354 #

355 #EnableMMAP and EnableSendfile: On systems that support it,

356 #memory-mapping or the sendfile syscall is used to deliver

357 # files.  This usually improves server performance, butmust

358 # be turnedoff when serving from networked-mounted

359 #filesystems or if support for these functions is otherwise

360 # broken onyour system.

361 #

362 #EnableMMAPoff

363#EnableSendfile off

364

365 #Supplemental configuration

366 #

367 # Theconfiguration files in the conf/extra/ directory can be

368 # includedto add extra features or to modify the default configuration of

369 # theserver, or you may simply copy their contents here and change as

370 #necessary.

371

372 #Server-pool management (MPM specific)

373 #Includeconf/extra/httpd-mpm.conf

374

375 #Multi-language error messages

376 #Includeconf/extra/httpd-multilang-errordoc.conf

377

378 # Fancydirectory listings

379 #Includeconf/extra/httpd-autoindex.conf

380

381 # Languagesettings

382 #Includeconf/extra/httpd-languages.conf

383

384 # User homedirectories

385 #Includeconf/extra/httpd-userdir.conf

386

387 # Real-timeinfo on requests and configuration

388 #Includeconf/extra/httpd-info.conf

389

390 # Virtualhosts

391 #Includeconf/extra/httpd-vhosts.conf

392

393 # Localaccess to the Apache HTTP Server Manual

394 #Includeconf/extra/httpd-manual.conf

395

396 #Distributed authoring and versioning (WebDAV)

397 #Includeconf/extra/httpd-dav.conf

398

399 # Variousdefault settings

400 #Includeconf/extra/httpd-default.conf

401

402 # Secure(SSL/TLS) connections

403 #Includeconf/extra/httpd-ssl.conf

404 #

405 # Note: Thefollowing must must be present to support

406 #       starting without SSL on platforms withno /dev/random equivalent

407 #       but a statically compiled-in mod_ssl.

408 #

409 <IfModulessl_module>

410 SSLRandomSeedstartupbuiltin

411 SSLRandomSeed connectbuiltin

412 </IfModule>

                                                            

                               

0 0