Linux-apache httd.conf文件详解

  1. # This is the main Apache server configuration file. It contains the
  2. # configuration directives that give the server its instructions.
  3. # See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
  4. # In particular, see
  5. # <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
  6. # for a discussion of each configuration directive.
  7. #
  8. #
  9. # Do NOT simply read the instructions in here 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 been warned.
  12. #
  13. # The configuration directives are grouped into three basic sections:
  14. # 1. Directives that control the operation of the Apache server process as a
  15. # whole (the 'global environment').
  16. # 2. Directives that define the parameters of the 'main' or 'default' server,
  17. # which responds to requests that aren't handled by a virtual host.
  18. # These directives also provide default values for the settings
  19. # of all virtual hosts.
  20. # 3. Settings for virtual hosts, which allow Web requests to be sent to
  21. # different IP addresses or hostnames and have them handled by the
  22. # same Apache server process.
  23. #
  24. # Configuration and logfile names: If the filenames you specify for many
  25. # of the server's control files begin with "/" (or "drive:/" for Win32), the
  26. # server will use that explicit path. If the filenames do *not* begin
  27. # with "/", the value of ServerRoot is prepended -- so "logs/foo.log"
  28. # with ServerRoot set to "/etc/httpd" will be interpreted by the
  29. # server as "/etc/httpd/logs/foo.log".
  30. #
  31.  
  32. ### Section 1: Global Environment
  33. #
  34. # The directives in this section affect the overall operation of Apache,
  35. # such as the number of concurrent requests it can handle or where it
  36. # can find its configuration files.
  37. #
  38.  
  39. #
  40. # Don't give away too much information about all the subcomponents
  41. # we are running. Comment out this line if you don't mind remote sites
  42. # finding out what major optional modules you are runnin
  43.  
  44. ServerTokens OS
  45. //在出现错误页的时候是否显示服务器操作系统的名称,ServerTokens Prod为不显示
  46.  
  47. # ServerRoot: The top of the directory tree under which the server's
  48. # configuration, error, and log files are kept.
  49. #
  50. # NOTE! If you intend to place this on an NFS (or otherwise network)
  51. # mounted filesystem then please read the LockFile documentation
  52. # (available at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
  53. # you will save yourself a lot of trouble.
  54. #
  55. # Do NOT add a slash at the end of the directory path.
  56.  
  57. ServerRoot "/etc/httpd"
  58. //用于指定Apache的运行目录,服务启动之后自动将目录改变为当前目录,在后面使用到的所有相对路径都是想对这个目录下
  59.  
  60. # PidFile: The file in which the server should record its process
  61. # identification number when it starts. Note the PIDFILE variable in
  62. # /etc/sysconfig/httpd must be set appropriately if this location is
  63. # changed.
  64.  
  65. PidFile run/httpd.pid
  66. //记录httpd守护进程的pid号码,这是系统识别一个进程的方法,系统中httpd进程可以有多个,但这个PID对应的进程是其他的父进程
  67.  
  68. # Timeout: The number of seconds before receives and sends time out.
  69.  
  70. Timeout 60
  71. //第二次连接前服务器与客户端断开的时间
  72.  
  73. # KeepAlive: Whether or not to allow persistent connections (more than
  74. # one request per connection). Set to "Off" to deactivate.
  75.  
  76. KeepAlive Off
  77. //是否持续连接(因为每次连接都得三次握手,如果是访问量不大,建议打开此项,如果网站访问量比较大关闭此项比较好),修改为:KeepAlive On 表示允许程序性联机
  78.  
  79. # MaxKeepAliveRequests: The maximum number of requests to allow
  80. # during a persistent connection. Set to 0 to allow an unlimited amount.
  81. # We recommend you leave this number high, for maximum performance.
  82.  
  83. MaxKeepAliveRequests 100
  84. //限制一个连接的最大请求数,0表示不限制
  85.  
  86. # KeepAliveTimeout: Number of seconds to wait for the next request from the
  87. # same client on the same connection.
  88. #
  89. KeepAliveTimeout 15
  90. //
  91. ##
  92. ## Server-Pool Size Regulation (MPM specific)
  93.  
  94. //apche的两种工作模式 prefork模式和worker模式
  95. # prefork MPM
  96. # StartServers: number of server processes to start
  97. # MinSpareServers: minimum number of server processes which are kept spare
  98. # MaxSpareServers: maximum number of server processes which are kept spare
  99. # ServerLimit: maximum value for MaxClients for the lifetime of the server
  100. # MaxClients: maximum number of server processes allowed to start
  101. # MaxRequestsPerChild: maximum number of requests a server process serves
  102. <IfModule prefork.c>
  103. StartServers 8
  104. MinSpareServers 5
  105. MaxSpareServers 20
  106. ServerLimit 256
  107. MaxClients 256
  108. MaxRequestsPerChild 4000
  109. </IfModule>
  110. 系统默认的模块,表示为每个访问启动一个进程(即当有多个连接公用一个进程的时候,在同一时刻只能有一个获得服务)。
  111. StartServer 开始服务时启动8个进程,最小空闲5个进程,最多空闲20个进程。
  112. ServerLimit 设置了MaxClients最大允许配置的数值
  113. MaxClient 限制同一时刻客户端的最大连接请求数量超过的要进入等候队列。
  114. MaxRequestsPerChild 每个进程生存期内允许服务的最大请求数量,0表示永不结束
  115.  
  116. # worker MPM
  117. # StartServers: initial number of server processes to start
  118. # MaxClients: maximum number of simultaneous client connections
  119. # MinSpareThreads: minimum number of worker threads which are kept spare
  120. # MaxSpareThreads: maximum number of worker threads which are kept spare
  121. # ThreadsPerChild: constant number of worker threads in each server process
  122. # MaxRequestsPerChild: maximum number of requests a server process serves
  123. <IfModule worker.c>
  124. StartServers 4
  125. MaxClients 300
  126. MinSpareThreads 25
  127. MaxSpareThreads 75
  128. ThreadsPerChild 25
  129. MaxRequestsPerChild 0
  130. </IfModule>
  131. Apache配置线程访问,即每对WEB服务访问启动一个线程,这样对内存占用率比较小。
  132. ServerLimit服务器允许配置进程数的上限。
  133. ThreadLimit每个子进程可能配置的线程上限
  134. StartServers启动两个httpd进程,
  135. MaxClients同时最多能发起250个访问,超过的要进入队列等待,其大小有ServerLimitThreadsPerChild的乘积决定
  136. ThreadsPerChild每个子进程生存期间常驻执行线程数,子线程建立之后将不再增加
  137. MaxRequestsPerChild每个进程启动的最大线程数,如达到限制数时进程将结束,如置为0则子线程永不结束
  138.  
  139. 0111# Listen: Allows you to bind Apache to specific IP addresses and/or
  140. # ports, in addition to the default. See also the <VirtualHost>
  141. # directive.
  142. #
  143. # Change this to Listen on specific IP addresses as shown below to
  144. # prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
  145.  
  146. #Listen 12.34.56.78:80
  147. Listen 80
  148. //监听的端口,如有多块网卡,默认监听所有网卡
  149.  
  150. # Dynamic Shared Object (DSO) Support
  151. #
  152. # To be able to use the functionality of a module which was built as a DSO you
  153. # have to place corresponding `LoadModule' lines at this location so the
  154. # directives contained in it are actually available _before_ they are used.
  155. # Statically compiled modules (those listed by `httpd -l') do not need
  156. # to be loaded here.
  157. #
  158. # Example:
  159. # LoadModule foo_module modules/mod_foo.so
  160.  
  161. //启动时加载的模块
  162. LoadModule auth_basic_module modules/mod_auth_basic.so
  163. LoadModule auth_digest_module modules/mod_auth_digest.so
  164. LoadModule authn_file_module modules/mod_authn_file.so
  165. LoadModule authn_alias_module modules/mod_authn_alias.so
  166. LoadModule authn_anon_module modules/mod_authn_anon.so
  167. LoadModule authn_dbm_module modules/mod_authn_dbm.so
  168. LoadModule authn_default_module modules/mod_authn_default.so
  169. LoadModule authz_host_module modules/mod_authz_host.so
  170. LoadModule authz_user_module modules/mod_authz_user.so
  171. LoadModule authz_owner_module modules/mod_authz_owner.so
  172. LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
  173. LoadModule authz_dbm_module modules/mod_authz_dbm.so
  174. LoadModule authz_default_module modules/mod_authz_default.so
  175. LoadModule ldap_module modules/mod_ldap.so
  176. LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
  177. LoadModule include_module modules/mod_include.so
  178. LoadModule log_config_module modules/mod_log_config.so
  179. LoadModule logio_module modules/mod_logio.so
  180. LoadModule env_module modules/mod_env.so
  181. LoadModule ext_filter_module modules/mod_ext_filter.so
  182. LoadModule mime_magic_module modules/mod_mime_magic.so
  183. LoadModule expires_module modules/mod_expires.so
  184. LoadModule deflate_module modules/mod_deflate.so
  185. LoadModule headers_module modules/mod_headers.so
  186. LoadModule usertrack_module modules/mod_usertrack.so
  187. LoadModule setenvif_module modules/mod_setenvif.so
  188. LoadModule mime_module modules/mod_mime.so
  189. LoadModule dav_module modules/mod_dav.so
  190. LoadModule status_module modules/mod_status.so
  191. LoadModule autoindex_module modules/mod_autoindex.so
  192. LoadModule info_module modules/mod_info.so
  193. LoadModule dav_fs_module modules/mod_dav_fs.so
  194. LoadModule vhost_alias_module modules/mod_vhost_alias.so
  195. LoadModule negotiation_module modules/mod_negotiation.so
  196. LoadModule dir_module modules/mod_dir.so
  197. LoadModule actions_module modules/mod_actions.so
  198. LoadModule speling_module modules/mod_speling.so
  199. LoadModule userdir_module modules/mod_userdir.so
  200. LoadModule alias_module modules/mod_alias.so
  201. LoadModule substitute_module modules/mod_substitute.so
  202. LoadModule rewrite_module modules/mod_rewrite.so
  203. LoadModule proxy_module modules/mod_proxy.so
  204. LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
  205. LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
  206. LoadModule proxy_http_module modules/mod_proxy_http.so
  207. LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
  208. LoadModule proxy_connect_module modules/mod_proxy_connect.so
  209. LoadModule cache_module modules/mod_cache.so
  210. LoadModule suexec_module modules/mod_suexec.so
  211. LoadModule disk_cache_module modules/mod_disk_cache.so
  212. LoadModule cgi_module modules/mod_cgi.so
  213. LoadModule version_module modules/mod_version.so
  214.  
  215. #
  216. # The following modules are not loaded by default:
  217. #
  218. #LoadModule asis_module modules/mod_asis.so
  219. #LoadModule authn_dbd_module modules/mod_authn_dbd.so
  220. #LoadModule cern_meta_module modules/mod_cern_meta.so
  221. #LoadModule cgid_module modules/mod_cgid.so
  222. #LoadModule dbd_module modules/mod_dbd.so
  223. #LoadModule dumpio_module modules/mod_dumpio.so
  224. #LoadModule filter_module modules/mod_filter.so
  225. #LoadModule ident_module modules/mod_ident.so
  226. #LoadModule log_forensic_module modules/mod_log_forensic.so
  227. #LoadModule unique_id_module modules/mod_unique_id.so
  228. #
  229.  
  230. #
  231. # Load config files from the config directory "/etc/httpd/conf.d".
  232.  
  233. //加载配置文件
  234. Include conf.d/*.conf
  235.  
  236. #
  237. # ExtendedStatus controls whether Apache will generate "full" status
  238. # information (ExtendedStatus On) or just basic information (ExtendedStatus
  239. # Off) when the "server-status" handler is called. The default is Off.
  240. #
  241. #ExtendedStatus On
  242.  
  243. #
  244. # If you wish httpd to run as a different user or group, you must run
  245. # httpd as root initially and it will switch.
  246. #
  247. # User/Group: The name (or #number) of the user/group to run httpd as.
  248. # . On SCO (ODT 3) use "User nouser" and "Group nogroup".
  249. # . On HPUX you may not be able to use shared memory as nobody, and the
  250. # suggested workaround is to create a user www and use that user.
  251. # NOTE that some ker nels refuse to setgid(Group) or semctl(IPC_SET)
  252. # when the value of (unsigned)Group is above 60000;
  253. # don't use Group #-1 on these systems!
  254.  
  255. //apache的用户和用户组
  256. User apache
  257. Group apache
  258.  
  259. ### Section 2: 'Main' server configuration
  260. #
  261. # The directives in this section set up the values used by the 'main'
  262. # server, which responds to any requests that aren't handled by a
  263. # <VirtualHost> definition. These values also provide defaults for
  264. # any <VirtualHost> containers you may define later in the file.
  265. #
  266. # All of these directives may appear inside <VirtualHost> containers,
  267. # in which case these default settings will be overridden for the
  268. # virtual host being defined.
  269. #
  270.  
  271. #
  272. # ServerAdmin: Your address, where problems with the server should be
  273. # e-mailed. This address appears on some server-generated pages, such
  274. # as error documents. e.g. admin@your-domain.com
  275.  
  276. //管理员的邮箱,如果出现问题,会在首页显示
  277. ServerAdmin root@localhost
  278.  
  279. #
  280. # ServerName gives the name and port that the server uses to identify itself.
  281. # This can often be determined automatically, but we recommend you specify
  282. # it explicitly to prevent problems during startup.
  283. #
  284. # If this is not set to valid DNS name for your host, server-generated
  285. # redirections will not work. See also the UseCanonicalName directive.
  286. #
  287. # If your host doesn't have a registered DNS name, enter its IP address here.
  288. # You will have to access it by its address anyway, and this will make
  289. # redirections work in a sensible way.
  290.  
  291. #ServerName www.example.com:80
  292. 默认是不需要指定的,服务器通过名字解析过程来获得自己的名字,但如果解析有问题(如反向解析不正确),或者没有DNS名字,也可以在这里指定IP地址,当这项不正确的时候服务器不能正常启动。前面启动Apache时候提示正在启动 httpd:httpd: apr_sockaddr_info_get() failed forjustin httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1forServerName,解决方法就是启动该项把www.example.com:80修改为自己的域名或者直接修改为localhost
  293.  
  294. # UseCanonicalName: Determines how Apache constructs self-referencing
  295. # URLs and the SERVER_NAME and SERVER_PORT variables.
  296. # When set "Off", Apache will use the Hostname and Port supplied
  297. # by the client. When set "On", Apache will use the value of the
  298. # ServerName directive.
  299.  
  300. UseCanonicalName Off
  301. //如果客户端提供了主机名和端口,Apache将会使用客户端提供的这些信息来构建自引用URL。这些值与用于实现基于域名的虚拟主机的值相同,并且对于同样的客户端可用。CGI变量SERVER_NAME和SERVER_PORT也会由客户端提供的值来构建
  302.  
  303. # DocumentRoot: The directory out of which you will serve your
  304. # documents. By default, all requests are taken from this directory, but
  305. # symbolic links and aliases may be used to point to other locations.
  306.  
  307. DocumentRoot "/var/www/html"
  308. //apache的默认web站点目录路径,结尾不要添加斜线
  309.  
  310. #
  311. # Each directory to which Apache has access can be configured with respect
  312. # to which services and features are allowed and/or disabled in that
  313. # directory (and its subdirectories).
  314. #
  315. # First, we configure the "default" to be a very restrictive set of
  316. # features.
  317.  
  318. #行为对根目录的限制
  319. <Directory />
  320. Options FollowSymLinks #followsymlinks表示允许使用符号链接,默认为禁用
  321. AllowOverride None # 表示禁止用户对目录配置文件(.htaccess进行修改)重载,普通站点不建议开启
  322. </Directory>
  323.  
  324. # Note that from this point forward you must specifically allow
  325. # particular features to be enabled - so if something's not working as
  326. # you might expect, make sure that you have specifically enabled it
  327. # below.
  328. #
  329.  
  330. #
  331. # This should be changed to whatever you set DocumentRoot to.
  332.  
  333. <Directory "/var/www/html">
  334.  
  335. #
  336. # Possible values for the Options directive are "None", "All",
  337. # or any combination of:
  338. # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  339. #
  340. # Note that "MultiViews" must be named *explicitly* --- "Options All"
  341. # doesn't give it to you.
  342. #
  343. # The Options directive is both complicated and important. Please see
  344. # http://httpd.apache.org/docs/2.2/mod/core.html#options
  345. # for more information.
  346. #
  347. Options Indexes FollowSymLinks
  348.  
  349. #
  350. # AllowOverride controls what directives may be placed in .htaccess files.
  351. # It can be "All", "None", or any combination of the keywords:
  352. # Options FileInfo AuthConfig Limit
  353. #
  354. AllowOverride None
  355.  
  356. #
  357. # Controls who can get stuff from this server.
  358. #
  359. Order allow,deny
  360. Allow from all
  361.  
  362. </Directory>
  363. //对/var/www/html目录的一个权限的设置,options中Indexes表示当网页不存在的时候允许索引显示目录中的文件,FollowSymLinks是否允许访问符号链接文件。有的选项有ExecCGI表是否使用CGI,如Options Includes ExecCGI FollowSymLinks表示允许服务器执行CGI及SSI,禁止列出目录。SymLinksOwnerMatch表示当符号链接的文件和目标文件为同一用户拥有时才允许访问。AllowOverrideNone表示不允许这个目录下的访问控制文件来改变这里的配置,这也意味着不用查看这个目录下的访问控制文件,修改为:AllowOverride All 表示允许.htaccess。Order对页面的访问控制顺序后面的一项是默认选项,如allow,deny则默认是deny,Allowfromall表示允许所有的用户,通过和上一项结合可以控制对网站的访问控制
  364.  
  365. # UserDir: The name of the directory that is appended onto a user's home
  366. # directory if a ~user request is received.
  367. #
  368. # The path to the end user account 'public_html' directory must be
  369. # accessible to the webserver userid. This usually means that ~userid
  370. # must have permissions of 711, ~userid/public_html must have permissions
  371. # of 755, and documents contained therein must be world-readable.
  372. # Otherwise, the client will only receive a "403 Forbidden" message.
  373. #
  374. # See also: http://httpd.apache.org/docs/misc/FAQ.html#forbidden
  375. #
  376. <IfModule mod_userdir.c>
  377. #
  378. # UserDir is disabled by default since it can confirm the presence
  379. # of a username on the system (depending on home directory
  380. # permissions).
  381.  
  382. UserDir disabled
  383. //是否允许用户访问其家目录,默认是不允许
  384.  
  385. # To enable requests to /~user/ to serve the user's public_html
  386. # directory, remove the "UserDir disabled" line above, and uncomment
  387. # the following line instead:
  388. #
  389. #UserDir public_html
  390.  
  391. </IfModule>
  392.  
  393. #
  394. # Control access to UserDir directories. The following is an example
  395. # for a site where these directories are restricted to read-only.
  396.  
  397. #<Directory /home/*/public_html>
  398. # AllowOverride FileInfo AuthConfig Limit
  399. # Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
  400. # <Limit GET POST OPTIONS>
  401. # Order allow,deny
  402. # Allow from all
  403. # </Limit>
  404. # <LimitExcept GET POST OPTIONS>
  405. # Order deny,allow
  406. # Deny from all
  407. # </LimitExcept>
  408. #</Directory>
  409. //如果允许访问用户的家目录中的网页文件,则取消以上注释,并对其中进行修改
  410.  
  411. # DirectoryIndex: sets the file that Apache will serve if a directory
  412. # is requested.
  413. #
  414. # The index.html.var file (a type-map) is used to deliver content-
  415. # negotiated documents. The MultiViews Option can be used for the
  416. # same purpose, but it is much slower.
  417.  
  418. DirectoryIndex index.html index.html.var
  419. //指定所要访问的主页的默认主页名字,默认首页文件名为index.html
  420.  
  421. # AccessFileName: The name of the file to look for in each directory
  422. # for additional configuration directives. See also the AllowOverride
  423. # directive.
  424.  
  425. AccessFileName .htaccess
  426. //定义每个目录下的访问控制文件名,缺省为.htaccess
  427.  
  428. # The following lines prevent .htaccess and .htpasswd files from being
  429. # viewed by Web clients.
  430.  
  431. <Files ~ "^\.ht">
  432. Order allow,deny
  433. Deny from all
  434. Satisfy All
  435. </Files>
  436. //控制不让web上的用户来查看.htpasswd和.htaccess这两个文件
  437.  
  438. # TypesConfig describes where the mime.types file (or equivalent) is
  439. # to be found.
  440.  
  441. TypesConfig /etc/mime.types
  442. //用于设置保存有不同MIME类型数据的文件名
  443.  
  444. # DefaultType is the default MIME type the server will use for a document
  445. # if it cannot otherwise determine one, such as from filename extensions.
  446. # If your server contains mostly text or HTML documents, "text/plain" is
  447. # a good value. If most of your content is binary, such as applications
  448. # or images, you may want to use "application/octet-stream" instead to
  449. # keep browsers from trying to display binary files as though they are
  450. # text.
  451.  
  452. DefaultType text/plain
  453. #默认的网页的类型
  454.  
  455. # The mod_mime_magic module allows the server to use various hints from the
  456. # contents of the file itself to determine its type. The MIMEMagicFile
  457. # directive tells the module where the hint definitions are located.
  458.  
  459. <IfModule mod_mime_magic.c>
  460. # MIMEMagicFile /usr/share/magic.mime
  461. MIMEMagicFile conf/magic
  462. </IfModule>
  463. //指定判断文件真实MIME类型功能的模块
  464.  
  465. #
  466. # HostnameLookups: Log the names of clients or just their IP addresses
  467. # e.g., www.apache.org (on) or 204.62.129.132 (off).
  468. # The default is off because it'd be overall better for the net if people
  469. # had to knowingly turn this feature on, since enabling it means that
  470. # each client request will result in AT LEAST one lookup request to the
  471. # nameserver.
  472.  
  473. HostnameLookups Off
  474. /打开此项功能时,在记录日志的时候同时记录主机名,这需要服务器来反向解析域名,增加了服务器的负载,通常不建议开启
  475.  
  476. # EnableMMAP: Control whether memory-mapping is used to deliver
  477. # files (assuming that the underlying OS supports it).
  478. # The default is on; turn this off if you serve from NFS-mounted
  479. # filesystems. On some systems, turning it off (regardless of
  480. # filesystem) can improve performance; for details, please see
  481. # http://httpd.apache.org/docs/2.2/mod/core.html#enablemmap
  482.  
  483. EnableMMAP off
  484. //是否允许内存映射:如果httpd在传送过程中需要读取一个文件的内容,它是否可以使用内存映射。如果为on表示如果操作系统支持的话,将使用内存映射。在一些多核处理器的系统上,这可能会降低性能,如果在挂载了NFS的DocumentRoot上如果开启此项功能,可能造成因为分段而造成httpd崩溃
  485.  
  486. # EnableSendfile: Control whether the sendfile kernel support is
  487. # used to deliver files (assuming that the OS supports it).
  488. # The default is on; turn this off if you serve from NFS-mounted
  489. # filesystems. Please see
  490. # http://httpd.apache.org/docs/2.2/mod/core.html#enablesendfile
  491.  
  492. EnableSendfile off
  493. //个指令控制httpd是否可以使用操作系统内核的sendfile支持来将文件发送到客户端。默认情况下,当处理一个请求并不需要访问文件内部的数据时(比如发送一个静态的文件内容),如果操作系统支持,Apache将使用sendfile将文件内容直接发送到客户端而并不读取文件
  494.  
  495. #
  496. # ErrorLog: The location of the error log file.
  497. # If you do not specify an ErrorLog directive within a <VirtualHost>
  498. # container, error messages relating to that virtual host will be
  499. # logged here. If you *do* define an error logfile for a <VirtualHost>
  500. # container, that host's errors will be logged there and not here.
  501.  
  502. ErrorLog logs/error_log
  503. //错误日志存放的位置
  504.  
  505. # LogLevel: Control the number of messages logged to the error_log.
  506. # Possible values include: debug, info, notice, warn, error, crit,
  507. # alert, emerg.
  508.  
  509. LogLevel warn
  510. //Apache日志的级别
  511.  
  512. # The following directives define some format nicknames for use with
  513. # a CustomLog directive (see below).
  514.  
  515. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  516. LogFormat "%h %l %u %t \"%r\" %>s %b" common
  517. LogFormat "%{Referer}i -> %U" referer
  518. LogFormat "%{User-agent}i" agent
  519. //定义了日志的格式,并用不同的代号表示
  520.  
  521. # "combinedio" includes actual counts of actual bytes received (%I) and sent (%O); this
  522. # requires the mod_logio module to be loaded.
  523. #LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  524.  
  525. #
  526. # The location and format of the access logfile (Common Logfile Format).
  527. # If you do not define any access logfiles within a <VirtualHost>
  528. # container, they will be logged here. Contrariwise, if you *do*
  529. # define per-<VirtualHost> access logfiles, transactions will be
  530. # logged therein and *not* in this file.
  531.  
  532. CustomLog logs/access_log common
  533. //日志记录的位置,这里面使用了相对路径,所以ServerRoot需要指出,日志位置就存放在/etc/httpd/logs
  534.  
  535. # If you would like to have separate agent and referer logfiles, uncomment
  536. # the following directives.
  537. #
  538. #CustomLog logs/referer_log referer
  539. #CustomLog logs/agent_log agent
  540.  
  541. #
  542. # For a single logfile with access, agent, and referer information
  543. # (Combined Logfile Format), use the following directive:
  544. #
  545. CustomLog logs/access_log combined
  546.  
  547. #
  548. # Optionally add a line containing the server version and virtual host
  549. # name to server-generated pages (internal error documents, FTP directory
  550. # listings, mod_status and mod_info output etc., but not CGI generated
  551. # documents or custom error documents).
  552. # Set to "EMail" to also include a mailto: link to the ServerAdmin.
  553. # Set to one of: On | Off | EMail
  554. #
  555.  
  556. ServerSignature On
  557. //当客户请求的网页不存在,或者错误的时候是否提示apache的版本的一些信息
  558.  
  559. #
  560. # Aliases: Add here as many aliases as you need (with no limit). The format is
  561. # Alias fakename realname
  562. #
  563. # Note that if you include a trailing / on fakename then the server will
  564. # require it to be present in the URL. So "/icons" isn't aliased in this
  565. # example, only "/icons/". If the fakename is slash-terminated, then the
  566. # realname must also be slash terminated, and if the fakename omits the
  567. # trailing slash, the realname must also omit it.
  568. #
  569. # We include the /icons/ alias for FancyIndexed directory listings. If you
  570. # do not use FancyIndexing, you may comment this out.
  571.  
  572. Alias /icons/ "/var/www/icons/"
  573. //义一些不在DocumentRoot下的文件,而可以将其映射到网页根目录中,这也是访问其他目录的一种方法,但在声明的时候切记目录后面加”/”
  574.  
  575. <Directory "/var/www/icons">
  576. Options Indexes MultiViews FollowSymLinks
  577. AllowOverride None
  578. Order allow,deny
  579. Allow from all
  580. </Directory>
  581. //定义对/var/www/icons/的权限,修改为 Options MultiViews FollowSymLinks表示不在浏览器上显示树状目录结构
  582.  
  583. #
  584. # WebDAV module configuration section.
  585.  
  586. <IfModule mod_dav_fs.c>
  587. # Location of the WebDAV lock database.
  588. DAVLockDB /var/lib/dav/lockdb
  589. </IfModule>
  590. //对mod_dav_fs.c模块儿的管理
  591.  
  592. # ScriptAlias: This controls which directories contain server scripts.
  593. # ScriptAliases are essentially the same as Aliases, except that
  594. # documents in the realname directory are treated as applications and
  595. # run by the server when requested rather than as documents sent to the client.
  596. # The same rules about trailing "/" apply to ScriptAlias directives as to
  597. # Alias.
  598. #
  599.  
  600. ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
  601. //对CGI模块儿的的别名,与Alias相似
  602.  
  603. #
  604. # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
  605. # CGI directory exists, if you have that configured.
  606.  
  607. //对/var/www/cgi-bin文件夹的管理,方法同上
  608. <Directory "/var/www/cgi-bin">
  609. AllowOverride None
  610. Options None
  611. Order allow,deny
  612. Allow from all
  613. </Directory>
  614.  
  615. #
  616. # Redirect allows you to tell clients about documents which used to exist in
  617. # your server's namespace, but do not anymore. This allows you to tell the
  618. # clients where to look for the relocated document.
  619. # Example:
  620.  
  621. Redirect permanent /foo http://www.example.com/bar
  622. //Redirect参数是用来重写URL的,当浏览器访问服务器上的一个已经不存在的资源的时候,服务器返回给浏览器新的URL,告诉浏览器从该URL中获取资源。这主要用于原来存在于服务器上的文档改变位置之后,又需要能够使用老URL能访问到原网页
  623.  
  624. # Directives controlling the display of server-generated directory listings.
  625. #
  626.  
  627. #
  628. # IndexOptions: Controls the appearance of server-generated directory
  629. # listings.
  630.  
  631. IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable Charset=UTF-8
  632. //当一个HTTP请求的URL为一个目录的时候,服务器返回这个目录中的索引文件,如果目录中不存在索引文件,并且服务器有许可显示目录文件列表的时候,就会显示这个目录中的文件列表,为了使得这个文件列表能具有可理解性,而不仅仅是一个简单的列表,就需要前这些参数。如果使用了IndexOptionsFancyIndexing选项,可以让服务器针对不同的文件引用不同的图标。如果没有就使用DefaultIcon定义缺省图标。同样,使用AddDescription可以为不同类型的文档介入描述
  633.  
  634. #
  635. # AddIcon* directives tell the server which icon to show for different
  636. # files or filename extensions. These are only displayed for
  637. # FancyIndexed directories.
  638. #
  639.  
  640. //添加一些支持文件
  641. AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
  642.  
  643. AddIconByType (TXT,/icons/text.gif) text/*
  644. AddIconByType (IMG,/icons/image2.gif) image/*
  645. AddIconByType (SND,/icons/sound2.gif) audio/*
  646. AddIconByType (VID,/icons/movie.gif) video/*
  647.  
  648. AddIcon /icons/binary.gif .bin .exe
  649. AddIcon /icons/binhex.gif .hqx
  650. AddIcon /icons/tar.gif .tar
  651. AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
  652. AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
  653. AddIcon /icons/a.gif .ps .ai .eps
  654. AddIcon /icons/layout.gif .html .shtml .htm .pdf
  655. AddIcon /icons/text.gif .txt
  656. AddIcon /icons/c.gif .c
  657. AddIcon /icons/p.gif .pl .py
  658. AddIcon /icons/f.gif .for
  659. AddIcon /icons/dvi.gif .dvi
  660. AddIcon /icons/uuencoded.gif .uu
  661. AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
  662. AddIcon /icons/tex.gif .tex
  663. AddIcon /icons/bomb.gif /core
  664.  
  665. AddIcon /icons/back.gif ..
  666. AddIcon /icons/hand.right.gif README
  667. AddIcon /icons/folder.gif ^^DIRECTORY^^
  668. AddIcon /icons/blank.gif ^^BLANKICON^^
  669.  
  670. #
  671. # DefaultIcon is which icon to show for files which do not have an icon
  672. # explicitly set.
  673. #
  674. DefaultIcon /icons/unknown.gif
  675.  
  676. #
  677. # AddDescription allows you to place a short description after a file in
  678. # server-generated indexes. These are only displayed for FancyIndexed
  679. # directories.
  680. # Format: AddDescription "description" filename
  681. #
  682. #AddDescription "GZIP compressed document" .gz
  683. #AddDescription "tar archive" .tar
  684. #AddDescription "GZIP compressed tar archive" .tgz
  685.  
  686. #
  687. # ReadmeName is the name of the README file the server will look for by
  688. # default, and append to directory listings.
  689. #
  690. # HeaderName is the name of a file which should be prepended to
  691. # directory indexes.
  692. ReadmeName README.html
  693. HeaderName HEADER.html
  694.  
  695. #
  696. # IndexIgnore is a set of filenames which directory indexing should ignore
  697. # and not include in the listing. Shell-style wildcarding is permitted.
  698. #
  699. IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
  700.  
  701. #
  702. # DefaultLanguage and AddLanguage allows you to specify the language of
  703. # a document. You can then use content negotiation to give a browser a
  704. # file in a language the user can understand.
  705. #
  706. # Specify a default language. This means that all data
  707. # going out without a specific language tag (see below) will
  708. # be marked with this one. You probably do NOT want to set
  709. # this unless you are sure it is correct for all cases.
  710. #
  711. # * It is generally better to not mark a page as
  712. # * being a certain language than marking it with the wrong
  713. # * language!
  714. #
  715. # DefaultLanguage nl
  716. #
  717. # Note 1: The suffix does not have to be the same as the language
  718. # keyword --- those with documents in Polish (whose net-standard
  719. # language code is pl) may wish to use "AddLanguage pl .po" to
  720. # avoid the ambiguity with the common suffix for perl scripts.
  721. #
  722. # Note 2: The example entries below illustrate that in some cases
  723. # the two character 'Language' abbreviation is not identical to
  724. # the two character 'Country' code for its country,
  725. # E.g. 'Danmark/dk' versus 'Danish/da'.
  726. #
  727. # Note 3: In the case of 'ltz' we violate the RFC by using a three char
  728. # specifier. There is 'work in progress' to fix this and get
  729. # the reference data for rfc1766 cleaned up.
  730. #
  731. # Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
  732. # English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
  733. # Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
  734. # Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
  735. # Norwegian (no) - Polish (pl) - Portugese (pt)
  736. # Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
  737. # Simplified Chinese (zh-CN) - Spanish (es) - Traditional Chinese (zh-TW)
  738. #
  739. AddLanguage ca .ca
  740. AddLanguage cs .cz .cs
  741. AddLanguage da .dk
  742. AddLanguage de .de
  743. AddLanguage el .el
  744. AddLanguage en .en
  745. AddLanguage eo .eo
  746. AddLanguage es .es
  747. AddLanguage et .et
  748. AddLanguage fr .fr
  749. AddLanguage he .he
  750. AddLanguage hr .hr
  751. AddLanguage it .it
  752. AddLanguage ja .ja
  753. AddLanguage ko .ko
  754. AddLanguage ltz .ltz
  755. AddLanguage nl .nl
  756. AddLanguage nn .nn
  757. AddLanguage no .no
  758. AddLanguage pl .po
  759. AddLanguage pt .pt
  760. AddLanguage pt-BR .pt-br
  761. AddLanguage ru .ru
  762. AddLanguage sv .sv
  763. AddLanguage zh-CN .zh-cn
  764. AddLanguage zh-TW .zh-tw
  765.  
  766. #
  767. # LanguagePriority allows you to give precedence to some languages
  768. # in case of a tie during content negotiation.
  769. #
  770. # Just list the languages in decreasing order of preference. We have
  771. # more or less alphabetized them here. You probably want to change this.
  772. #
  773. LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
  774.  
  775. #
  776. # ForceLanguagePriority allows you to serve a result page rather than
  777. # MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
  778. # [in case no accepted languages matched the available variants]
  779. #
  780. ForceLanguagePriority Prefer Fallback
  781.  
  782. #
  783. # Specify a default charset for all content served; this enables
  784. # interpretation of all content as UTF-8 by default. To use the
  785. # default browser choice (ISO-8859-1), or to allow the META tags
  786. # in HTML content to override this choice, comment out this
  787. # directive:
  788. #
  789. AddDefaultCharset UTF-8
  790.  
  791. #
  792. # AddType allows you to add to or override the MIME configuration
  793. # file mime.types for specific file types.
  794. #
  795. #AddType application/x-tar .tgz
  796.  
  797. #
  798. # AddEncoding allows you to have certain browsers uncompress
  799. # information on the fly. Note: Not all browsers support this.
  800. # Despite the name similarity, the following Add* directives have nothing
  801. # to do with the FancyIndexing customization directives above.
  802. #
  803. #AddEncoding x-compress .Z
  804. #AddEncoding x-gzip .gz .tgz
  805.  
  806. # If the AddEncoding directives above are commented-out, then you
  807. # probably should define those extensions to indicate media types:
  808. #
  809. AddType application/x-compress .Z
  810. AddType application/x-gzip .gz .tgz
  811.  
  812. #
  813. # MIME-types for downloading Certificates and CRLs
  814. #
  815. AddType application/x-x509-ca-cert .crt
  816. AddType application/x-pkcs7-crl .crl
  817.  
  818. #
  819. # AddHandler allows you to map certain file extensions to "handlers":
  820. # actions unrelated to filetype. These can be either built into the server
  821. # or added with the Action directive (see below)
  822. #
  823. # To use CGI scripts outside of ScriptAliased directories:
  824. # (You will also need to add "ExecCGI" to the "Options" directive.)
  825. #
  826. #AddHandler cgi-script .cgi
  827.  
  828. #
  829. # For files that include their own HTTP headers:
  830. #
  831. #AddHandler send-as-is asis
  832.  
  833. #
  834. # For type maps (negotiated resources):
  835. # (This is enabled by default to allow the Apache "It Worked" page
  836. # to be distributed in multiple languages.)
  837. #
  838. AddHandler type-map var
  839.  
  840. #
  841. # Filters allow you to process content before it is sent to the client.
  842. #
  843. # To parse .shtml files for server-side includes (SSI):
  844. # (You will also need to add "Includes" to the "Options" directive.)
  845. #
  846. AddType text/html .shtml
  847. AddOutputFilter INCLUDES .shtml
  848.  
  849. #
  850. # Action lets you define media types that will execute a script whenever
  851. # a matching file is called. This eliminates the need for repeated URL
  852. # pathnames for oft-used CGI file processors.
  853. # Format: Action media/type /cgi-script/location
  854. # Format: Action handler-name /cgi-script/location
  855. #
  856.  
  857. #
  858. # Customizable error responses come in three flavors:
  859. # 1) plain text 2) local redirects 3) external redirects
  860. #
  861. # Some examples:
  862. #ErrorDocument 500 "The server made a boo boo."
  863. #ErrorDocument 404 /missing.html
  864. #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
  865. #ErrorDocument 402 http://www.example.com/subscription_info.html
  866. #
  867.  
  868. #
  869. # Putting this all together, we can internationalize error responses.
  870. #
  871. # We use Alias to redirect any /error/HTTP_<error>.html.var response to
  872. # our collection of by-error message multi-language collections. We use
  873. # includes to substitute the appropriate text.
  874. #
  875. # You can modify the messages' appearance without changing any of the
  876. # default HTTP_<error>.html.var files by adding the line:
  877. #
  878. # Alias /error/include/ "/your/include/path/"
  879. #
  880. # which allows you to create your own set of files by starting with the
  881. # /var/www/error/include/ files and
  882. # copying them to /your/include/path/, even on a per-VirtualHost basis.
  883. #
  884.  
  885. Alias /error/ "/var/www/error/"
  886.  
  887. <IfModule mod_negotiation.c>
  888. <IfModule mod_include.c>
  889.  
  890. <Directory "/var/www/error">
  891. AllowOverride None
  892. Options IncludesNoExec
  893. AddOutputFilter Includes html
  894. AddHandler type-map var
  895. Order allow,deny
  896. Allow from all
  897. LanguagePriority en es de fr
  898. ForceLanguagePriority Prefer Fallback
  899. </Directory>
  900. //对/var/www/error网页的权限及操作
  901.  
  902. # ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
  903. # ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
  904. # ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
  905. # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
  906. # ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
  907. # ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
  908. # ErrorDocument 410 /error/HTTP_GONE.html.var
  909. # ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
  910. # ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
  911. # ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
  912. # ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
  913. # ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
  914. # ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
  915. # ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
  916. # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
  917. # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
  918. # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
  919.  
  920. </IfModule>
  921. </IfModule>
  922.  
  923. #
  924. # The following directives modify normal HTTP response behavior to
  925. # handle known problems with browser implementations.
  926. #
  927. BrowserMatch "Mozilla/2" nokeepalive
  928. BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
  929. BrowserMatch "RealPlayer 4\.0" force-response-1.0
  930. BrowserMatch "Java/1\.0" force-response-1.0
  931. BrowserMatch "JDK/1\.0" force-response-1.0
  932.  
  933. #
  934. # The following directive disables redirects on non-GET requests for
  935. # a directory that does not include the trailing slash. This fixes a
  936. # problem with Microsoft WebFolders which does not appropriately handle
  937. # redirects for folders with DAV methods.
  938. # Same deal with Apple's DAV filesystem and Gnome VFS support for DAV.
  939.  
  940. //设置特殊的参数,以保证对老版本浏览器的兼容,并支持新浏览器的特性
  941. BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
  942. BrowserMatch "MS FrontPage" redirect-carefully
  943. BrowserMatch "^WebDrive" redirect-carefully
  944. BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully
  945. BrowserMatch "^gnome-vfs/1.0" redirect-carefully
  946. BrowserMatch "^XML Spy" redirect-carefully
  947. BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully
  948.  
  949. #
  950. # Allow server status reports generated by mod_status,
  951. # with the URL of http://servername/server-status
  952. # Change the ".example.com" to match your domain to enable.
  953. #
  954. #<Location /server-status>
  955. # SetHandler server-status
  956. # Order deny,allow
  957. # Deny from all
  958. # Allow from .example.com
  959. #</Location>
  960.  
  961. #
  962. # Allow remote server configuration reports, with the URL of
  963. # http://servername/server-info (requires that mod_info.c be loaded).
  964. # Change the ".example.com" to match your domain to enable.
  965. #
  966. #<Location /server-info>
  967. # SetHandler server-info
  968. # Order deny,allow
  969. # Deny from all
  970. # Allow from .example.com
  971. #</Location>
  972.  
  973. #
  974. # Proxy Server directives. Uncomment the following lines to
  975. # enable the proxy server:
  976. #
  977. #<IfModule mod_proxy.c>
  978. #ProxyRequests On
  979. #
  980. #<Proxy *>
  981. # Order deny,allow
  982. # Deny from all
  983. # Allow from .example.com
  984. #</Proxy>
  985.  
  986. #
  987. # Enable/disable the handling of HTTP/1.1 "Via:" headers.
  988. # ("Full" adds the server version; "Block" removes all outgoing Via: headers)
  989. # Set to one of: Off | On | Full | Block
  990. #
  991. #ProxyVia On
  992.  
  993. #
  994. # To enable a cache of proxied content, uncomment the following lines.
  995. # See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details.
  996. #
  997. #<IfModule mod_disk_cache.c>
  998. # CacheEnable disk /
  999. # CacheRoot "/var/cache/mod_proxy"
  1000. #</IfModule>
  1001. #
  1002.  
  1003. #</IfModule>
  1004. # End of proxy directives.
  1005.  
  1006. ### Section 3: Virtual Hosts
  1007. #
  1008. # VirtualHost: If you want to maintain multiple domains/hostnames on your
  1009. # machine you can setup VirtualHost containers for them. Most configurations
  1010. # use only name-based virtual hosts so the server doesn't need to worry about
  1011. # IP addresses. This is indicated by the asterisks in the directives below.
  1012. #
  1013. # Please see the documentation at
  1014. # <URL:http://httpd.apache.org/docs/2.2/vhosts/>
  1015. # for further details before you try to setup virtual hosts.
  1016. #
  1017. # You may use the command line option '-S' to verify your virtual host
  1018. # configuration.
  1019.  
  1020. #
  1021. # Use name-based virtual hosting.
  1022. #
  1023. #NameVirtualHost *:80
  1024. #
  1025. # NOTE: NameVirtualHost cannot be used without a port specifier
  1026. # (e.g. :80) if mod_ssl is being used, due to the nature of the
  1027. # SSL protocol.
  1028. #
  1029.  
  1030. //虚拟主机配置
  1031. # VirtualHost example:
  1032. # Almost any Apache directive may go into a VirtualHost container.
  1033. # The first VirtualHost section is used for requests without a known
  1034. # server name.
  1035. #
  1036. #<VirtualHost *:80>
  1037. # ServerAdmin webmaster@dummy-host.example.com
  1038. # DocumentRoot /www/docs/dummy-host.example.com
  1039. # ServerName dummy-host.example.com
  1040. # ErrorLog logs/dummy-host.example.com-error_log
  1041. # CustomLog logs/dummy-host.example.com-access_log common
  1042. #</VirtualHost>

Linux-apache httd.conf文件详解的更多相关文章

  1. VSFTPD全攻略(/etc/vsftpd/vsftpd.conf文件详解)

    /etc/vsftpd/vsftpd.conf文件详解,分好类,方便大家查找与学习 #################匿名权限控制############### anonymous_enable=YE ...

  2. linux根文件系统 /etc/resolv.conf 文件详解

    Linux根文件系统/etc/resolv.conf文件,它是DNS客户机配置文件,用于设置DNS服务器的IP地址及DNS域名,还包含了主机的域名搜索顺序.该文件是由域名解析器(resolver,以恶 ...

  3. linux 查找目录或文件详解

    查找目录:find /(查找范围) -name '查找关键字' -type d查找文件:find /(查找范围) -name 查找关键字 -print 如果需要更进一步的了解,可以参看Linux的命令 ...

  4. sysctl.conf文件详解

    本文转自:http://www.cnblogs.com/Rosanna/p/3446557.html 使文件立刻生效命令:/sbin/sysctl -p /proc/sys目录下存放着大多数内核参数, ...

  5. 【转】/etc/grub.conf文件详解

    转自:http://leejia.blog.51cto.com/4356849/788902 grub.conf是grub的主配置文件,通过这个配置文件,grub才能找到kernel,系统才能正常启动 ...

  6. 【转载】redis.conf文件详解

    转载地址:http://blog.csdn.net/zhutulang/article/details/51969760 Redis.conf文件可以在github上查看,下面是我整理的其中的配置项( ...

  7. recovery.conf文件详解

    在恢复过程中,用户可以通过使用recovery.conf文件来指定恢复的各个参数,如下: 归档恢复设置 restore_command:用于获取一个已归档段的XLOG日志文件的命令 archive_c ...

  8. linux根文件系统 /etc/resolv.conf 文件详解(转)

    大家好,今天51开源给大家介绍一个在配置文件,那就是/etc/resolv.conf.很多网友对此文件的用处不太了解.其实并不复杂,它是DNS客户机配置文件,用于设置DNS服务器的IP地址及DNS域名 ...

  9. Apache 的 httpd-mpm.conf 文件详解

    #prefork 多路处理模块 <IfModule mpm_prefork_module> StartServers              5   #设置服务器启动时建立的子进程数量, ...

随机推荐

  1. Turtlebot3新手教程:仿真

    本文章针对如何利用turtlebot3实现仿真功能进行讲解 测试环境:Ubuntu 16.04 和 ROS Kinetic Kame. 注意:TurtleBot3 Simulation 依赖 turt ...

  2. Refit集成consul在asp.net core中的实践

    前言 github:https://github.com/alphayu/ Refit.WebApiClient.Feign等都是支持声名式的Restful服务调用的开源组件. 这个几个组件都综合研究 ...

  3. String StringBuffer StringBuilder之间的区别

    String:

  4. CSS_rules

    CSS 特性 1)控制灵活,功能强大 元素-->标签 针对html的元素 2)可以设置html元素的属性,与html框架的进行分离 3)执行效率更高 CSS语法 text-indent 文字缩进 ...

  5. Syn_Flood攻击&防御手段

    Syn_Flood攻击原理 攻击者首先伪造地址对服务器发起SYN请求(我可以建立连接吗?),服务器就会回应一个ACK+SYN(可以+请确认).而真实的IP会认为,我没有发送请求,不作回应.服务器没有收 ...

  6. LeetCode235 二叉搜索树的最近公共祖先

    给定一个二叉搜索树, 找到该树中两个指定节点的最近公共祖先. 百度百科中最近公共祖先的定义为:"对于有根树 T 的两个结点 p.q,最近公共祖先表示为一个结点 x,满足 x 是 p.q 的祖 ...

  7. RecyclerView 源码分析(一) —— 绘制流程解析

    概述 对于 RecyclerView 是那么熟悉又那么陌生.熟悉是因为作为一名 Android 开发者,RecyclerView 是经常会在项目里面用到的,陌生是因为只是知道怎么用,但是却不知道 Re ...

  8. for update语句锁机制问题

    数据库小知识学习系列 问题: MySQL InnoDB中,select where xxx=123 for update:该xxx没有索引,是使用表锁还是全部数据加行锁? 答: InnoDB引擎(默认 ...

  9. CSAPP:Lab0 -Docker搭建纯净Linux环境

    1. 安装docker 在mac-os下我们可以利用homebrew很容易的安装docker. brew install docker 当然去官网下载也很容易 Empowering App Devel ...

  10. C++:I/O流的概念和流类库的结构

    一.C++输入输出包含以下三个方面的内容: 对系统指定的标准设备的输入和输出.即从键盘输入数据,输出到显示器屏幕.这种输入输出称为标准的输入输出,简称标准I/O. 以外存磁盘文件为对象进行输入和输出, ...