core.html.es 249 KB
Newer Older
powelld's avatar
powelld committed
1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000
    <p>This memory-mapping sometimes yields a performance improvement.
    But in some environments, it is better to disable the memory-mapping
    to prevent operational problems:</p>

    <ul>
    <li>On some multiprocessor systems, memory-mapping can reduce the
    performance of the <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</li>
    <li>Deleting or truncating a file while <code class="program"><a href="../programs/httpd.html">httpd</a></code>
      has it memory-mapped can cause <code class="program"><a href="../programs/httpd.html">httpd</a></code> to
      crash with a segmentation fault.
    </li>
    </ul>

    <p>For server configurations that are vulnerable to these problems,
    you should disable memory-mapping of delivered files by specifying:</p>

    <div class="example"><p><code>
      EnableMMAP Off
    </code></p></div>

    <p>For NFS mounted files, this feature may be disabled explicitly for
    the offending files by specifying:</p>

    <div class="example"><p><code>
      &lt;Directory "/path-to-nfs-files"&gt;
      <span class="indent">
        EnableMMAP Off
      </span>
      &lt;/Directory&gt;
    </code></p></div>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Use the kernel sendfile support to deliver files to the client</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>EnableSendfile Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in version 2.0.44 and later. Default changed to Off in
version 2.3.9.</td></tr>
</table>
    <p>This directive controls whether <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use the
    sendfile support from the kernel to transmit file contents to the client.
    By default, when the handling of a request requires no access
    to the data within a file -- for example, when delivering a
    static file -- Apache httpd uses sendfile to deliver the file contents
    without ever reading the file if the OS supports it.</p>

    <p>This sendfile mechanism avoids separate read and send operations,
    and buffer allocations. But on some platforms or within some
    filesystems, it is better to disable this feature to avoid
    operational problems:</p>

    <ul>
    <li>Some platforms may have broken sendfile support that the build
    system did not detect, especially if the binaries were built on
    another box and moved to such a machine with broken sendfile
    support.</li>
    <li>On Linux the use of sendfile triggers TCP-checksum
    offloading bugs on certain networking cards when using IPv6.</li>
    <li>On Linux on Itanium, sendfile may be unable to handle files
    over 2GB in size.</li>
    <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS, SMB, CIFS, FUSE),
    the kernel may be unable to serve the network file through
    its own cache.</li>
    </ul>

    <p>For server configurations that are not vulnerable to these problems,
    you may enable this feature by specifying:</p>

    <div class="example"><p><code>
      EnableSendfile On
    </code></p></div>

    <p>For network mounted files, this feature may be disabled explicitly
    for the offending files by specifying:</p>

    <div class="example"><p><code>
      &lt;Directory "/path-to-nfs-files"&gt;
      <span class="indent">
        EnableSendfile Off
      </span>
      &lt;/Directory&gt;
    </code></p></div>
    <p>Please note that the per-directory and .htaccess configuration
       of <code class="directive">EnableSendfile</code> is not supported by
       <code class="module"><a href="../mod/mod_cache_disk.html">mod_cache_disk</a></code>.
       Only global definition of <code class="directive">EnableSendfile</code>
       is taken into account by the module.
    </p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="Error" id="Error">Error</a> <a name="error" id="error">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Abort configuration parsing with a custom error message</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Error <var>message</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>2.3.9 and later</td></tr>
</table>
    <p>If an error can be detected within the configuration, this
    directive can be used to generate a custom error message, and halt
    configuration parsing.  The typical use is for reporting required
    modules which are missing from the configuration.</p>

    <div class="example"><h3>Example</h3><p><code>
      # ensure that mod_include is loaded<br />
      &lt;IfModule !include_module&gt;<br />
      Error mod_include is required by mod_foo.  Load it with LoadModule.<br />
      &lt;/IfModule&gt;<br />
      <br />
      # ensure that exactly one of SSL,NOSSL is defined<br />
      &lt;IfDefine SSL&gt;<br />
      &lt;IfDefine NOSSL&gt;<br />
      Error Both SSL and NOSSL are defined.  Define only one of them.<br />
      &lt;/IfDefine&gt;<br />
      &lt;/IfDefine&gt;<br />
      &lt;IfDefine !SSL&gt;<br />
      &lt;IfDefine !NOSSL&gt;<br />
      Error Either SSL or NOSSL must be defined.<br />
      &lt;/IfDefine&gt;<br />
      &lt;/IfDefine&gt;<br />
    </code></p></div>


</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>What the server will return to the client
in case of an error</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>In the event of a problem or error, Apache httpd can be configured
    to do one of four things,</p>

    <ol>
      <li>output a simple hardcoded error message</li>

      <li>output a customized message</li>

      <li>redirect to a local <var>URL-path</var> to handle the
      problem/error</li>

      <li>redirect to an external <var>URL</var> to handle the
      problem/error</li>
    </ol>

    <p>The first option is the default, while options 2-4 are
    configured using the <code class="directive">ErrorDocument</code>
    directive, which is followed by the HTTP response code and a URL
    or a message. Apache httpd will sometimes offer additional information
    regarding the problem/error.</p>

    <p>URLs can begin with a slash (/) for local web-paths (relative
    to the <code class="directive"><a href="#documentroot">DocumentRoot</a></code>), or be a
    full URL which the client can resolve. Alternatively, a message
    can be provided to be displayed by the browser. Examples:</p>

    <div class="example"><p><code>
      ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
      ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
      ErrorDocument 401 /subscription_info.html<br />
      ErrorDocument 403 "Sorry can't allow you access today"
    </code></p></div>

    <p>Additionally, the special value <code>default</code> can be used
    to specify Apache httpd's simple hardcoded message.  While not required
    under normal circumstances, <code>default</code> will restore
    Apache httpd's simple hardcoded message for configurations that would
    otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p>

    <div class="example"><p><code>
      ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
      &lt;Directory /web/docs&gt;<br />
      <span class="indent">
        ErrorDocument 404 default<br />
      </span>
      &lt;/Directory&gt;
    </code></p></div>

    <p>Note that when you specify an <code class="directive">ErrorDocument</code>
    that points to a remote URL (ie. anything with a method such as
    <code>http</code> in front of it), Apache HTTP Server will send a redirect to the
    client to tell it where to find the document, even if the
    document ends up being on the same server. This has several
    implications, the most important being that the client will not
    receive the original error status code, but instead will
    receive a redirect status code. This in turn can confuse web
    robots and other clients which try to determine if a URL is
    valid using the status code. In addition, if you use a remote
    URL in an <code>ErrorDocument 401</code>, the client will not
    know to prompt the user for a password since it will not
    receive the 401 status code. Therefore, <strong>if you use an
    <code>ErrorDocument 401</code> directive then it must refer to a local
    document.</strong></p>

    <p>Microsoft Internet Explorer (MSIE) will by default ignore
    server-generated error messages when they are "too small" and substitute
    its own "friendly" error messages. The size threshold varies depending on
    the type of error, but in general, if you make your error document
    greater than 512 bytes, then MSIE will show the server-generated
    error rather than masking it.  More information is available in
    Microsoft Knowledge Base article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>

    <p>Although most error messages can be overriden, there are certain
    circumstances where the internal messages are used regardless of the
    setting of <code class="directive"><a href="#errordocument">ErrorDocument</a></code>.  In
    particular, if a malformed request is detected, normal request processing
    will be immediately halted and the internal error message returned.
    This is necessary to guard against security problems caused by
    bad requests.</p>
   
    <p>If you are using mod_proxy, you may wish to enable
    <code class="directive"><a href="../mod/mod_proxy.html#proxyerroroverride">ProxyErrorOverride</a></code> so that you can provide
    custom error messages on behalf of your Origin servers. If you don't enable ProxyErrorOverride,
    Apache httpd will not generate custom error documents for proxied content.</p>

<h3>Consulte tambin</h3>
<ul>
<li><a href="../custom-error.html">documentation of
    customizable responses</a></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Location where the server will log errors</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code> ErrorLog <var>file-path</var>|syslog[:<var>facility</var>]</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ErrorLog logs/error_log (Unix) ErrorLog logs/error.log (Windows and OS/2)</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>The <code class="directive">ErrorLog</code> directive sets the name of
    the file to which the server will log any errors it encounters. If
    the <var>file-path</var> is not absolute then it is assumed to be 
    relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>

    <div class="example"><h3>Example</h3><p><code>
    ErrorLog /var/log/httpd/error_log
    </code></p></div>

    <p>If the <var>file-path</var>
    begins with a pipe character "<code>|</code>" then it is assumed to be a
    command to spawn to handle the error log.</p>

    <div class="example"><h3>Example</h3><p><code>
    ErrorLog "|/usr/local/bin/httpd_errors"
    </code></p></div>

    <p>See the notes on <a href="../logs.html#piped">piped logs</a> for
    more information.</p>

    <p>Using <code>syslog</code> instead of a filename enables logging
    via syslogd(8) if the system supports it. The default is to use
    syslog facility <code>local7</code>, but you can override this by
    using the <code>syslog:<var>facility</var></code> syntax where
    <var>facility</var> can be one of the names usually documented in
    syslog(1).  The facility is effectively global, and if it is changed
    in individual virtual hosts, the final facility specified affects the
    entire server.</p>

    <div class="example"><h3>Example</h3><p><code>
    ErrorLog syslog:user
    </code></p></div>

    <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
    document for details on why your security could be compromised
    if the directory where log files are stored is writable by
    anyone other than the user that starts the server.</p>
    <div class="warning"><h3>Note</h3>
      <p>When entering a file path on non-Unix platforms, care should be taken
      to make sure that only forward slashed are used even though the platform
      may allow the use of back slashes. In general it is a good idea to always 
      use forward slashes throughout the configuration files.</p>
    </div>

<h3>Consulte tambin</h3>
<ul>
<li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
<li><a href="../logs.html">Apache HTTP Server Log Files</a></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ErrorLogFormat" id="ErrorLogFormat">ErrorLogFormat</a> <a name="errorlogformat" id="errorlogformat">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Format specification for error log entries</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code> ErrorLog [connection|request] <var>format</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Available in Apache httpd 2.3.9 and later</td></tr>
</table>
    <p><code class="directive">ErrorLogFormat</code> allows to specify what
    supplementary information is logged in the error log in addition to the
    actual log message.</p>

    <div class="example"><h3>Simple example</h3><p><code>
        ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
    </code></p></div>

    <p>Specifying <code>connection</code> or <code>request</code> as first
    paramter allows to specify additional formats, causing additional
    information to be logged when the first message is logged for a specific
    connection or request, respectivly. This additional information is only
    logged once per connection/request. If a connection or request is processed
    without causing any log message, the additional information is not logged
    either.</p>

    <p>It can happen that some format string items do not produce output.  For
    example, the Referer header is only present if the log message is
    associated to a request and the log message happens at a time when the
    Referer header has already been read from the client.  If no output is
    produced, the default behaviour is to delete everything from the preceeding
    space character to the next space character.  This means the log line is
    implicitly divided into fields on non-whitespace to whitespace transitions.
    If a format string item does not produce output, the whole field is
    ommitted.  For example, if the remote address <code>%a</code> in the log
    format <code>[%t] [%l] [%a] %M&nbsp;</code> is not available, the surrounding
    brackets are not logged either.  Space characters can be escaped with a
    backslash to prevent them from delimiting a field.  The combination '%&nbsp;'
    (percent space) is a zero-witdh field delimiter that does not produce any
    output.</p>

    <p>The above behaviour can be changed by adding modifiers to the format
    string item. A <code>-</code> (minus) modifier causes a minus to be logged if the
    respective item does not produce any output. In once-per-connection/request
    formats, it is also possible to use the <code>+</code> (plus) modifier. If an
    item with the plus modifier does not produce any output, the whole line is
    ommitted.</p>

    <p>A number as modifier can be used to assign a log severity level to a
    format item. The item will only be logged if the severity of the log
    message is not higher than the specified log severity level. The number can
    range from 1 (alert) over 4 (warn) and 7 (debug) to 15 (trace8).</p>

    <p>Some format string items accept additional parameters in braces.</p>

    <table class="bordered"><tr class="header"><th>Format&nbsp;String</th> <th>Description</th></tr>
<tr><td><code>%%</code></td>
        <td>The percent sign</td></tr>
<tr class="odd"><td><code>%...a</code></td>
        <td>Remote IP-address and port</td></tr>
<tr><td><code>%...A</code></td>
        <td>Local IP-address and port</td></tr>
<tr class="odd"><td><code>%...{name}e</code></td>
        <td>Request environment variable <code>name</code></td></tr>
<tr><td><code>%...E</code></td>
        <td>APR/OS error status code and string</td></tr>
<tr class="odd"><td><code>%...F</code></td>
        <td>Source file name and line number of the log call</td></tr>
<tr><td><code>%...{name}i</code></td>
        <td>Request header <code>name</code></td></tr>
<tr class="odd"><td><code>%...k</code></td>
        <td>Number of keep-alive requests on this connection</td></tr>
<tr><td><code>%...l</code></td>
        <td>Loglevel of the message</td></tr>
<tr class="odd"><td><code>%...L</code></td>
        <td>Log ID of the request</td></tr>
<tr><td><code>%...{c}L</code></td>
        <td>Log ID of the connection</td></tr>
<tr class="odd"><td><code>%...{C}L</code></td>
        <td>Log ID of the connection if used in connection scope, empty otherwise</td></tr>
<tr><td><code>%...m</code></td>
        <td>Name of the module logging the message</td></tr>
<tr class="odd"><td><code>%M</code></td>
        <td>The actual log message</td></tr>
<tr><td><code>%...{name}n</code></td>
        <td>Request note <code>name</code></td></tr>
<tr class="odd"><td><code>%...P</code></td>
        <td>Process ID of current process</td></tr>
<tr><td><code>%...T</code></td>
        <td>Thread ID of current thread</td></tr>
<tr class="odd"><td><code>%...t</code></td>
        <td>The current time</td></tr>
<tr><td><code>%...{u}t</code></td>
        <td>The current time including micro-seconds</td></tr>
<tr class="odd"><td><code>%...{cu}t</code></td>
        <td>The current time in compact ISO 8601 format, including
            micro-seconds</td></tr>
<tr><td><code>%...v</code></td>
        <td>The canonical <code class="directive"><a href="#servername">ServerName</a></code>
            of the current server.</td></tr>
<tr class="odd"><td><code>%...V</code></td>
        <td>The server name of the server serving the request according to the
            <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code>
            setting.</td></tr>
<tr><td><code>\&nbsp;</code> (backslash space)</td>
        <td>Non-field delimiting space</td></tr>
<tr class="odd"><td><code>%&nbsp;</code> (percent space)</td>
        <td>Field delimiter (no output)</td></tr>
</table>

    <p>The log ID format <code>%L</code> produces a unique id for a connection
    or request. This can be used to correlate which log lines belong to the
    same connection or request, which request happens on which connection.
    A <code>%L</code> format string is also available in
    <code class="module"><a href="../mod/mod_log_config.html">mod_log_config</a></code>, to allow to correlate access log entries
    with error log lines. If <code class="module"><a href="../mod/mod_unique_id.html">mod_unique_id</a></code> is loaded, its
    unique id will be used as log ID for requests.</p>

    <div class="example"><h3>Example (somewhat similar to default format)</h3><p><code>
        ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P] %7F: %E: [client\ %a]
        %M%&nbsp;,\&nbsp;referer\&nbsp;%{Referer}i"
    </code></p></div>

    <div class="example"><h3>Example (similar to the 2.2.x format)</h3><p><code>
        ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a]
        %M%&nbsp;,\&nbsp;referer\&nbsp;%{Referer}i"
    </code></p></div>

    <div class="example"><h3>Advanced example with request/connection log IDs</h3><p><code>
        ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M"<br />
        ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T"<br />
        ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'"<br />
        ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'"<br />
        ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"<br />
    </code></p></div>


<h3>Consulte tambin</h3>
<ul>
<li><code class="directive"><a href="#errorlog">ErrorLog</a></code></li>
<li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
<li><a href="../logs.html">Apache HTTP Server Log Files</a></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ExtendedStatus" id="ExtendedStatus">ExtendedStatus</a> <a name="extendedstatus" id="extendedstatus">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Keep track of extended status information for each 
request</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ExtendedStatus On|Off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>ExtendedStatus Off[*]</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>This option tracks additional data per worker about the
    currently executing request, and a utilization summary; you 
    can see these variables during runtime by configuring 
    <code class="module"><a href="../mod/mod_status.html">mod_status</a></code>.  Note that other modules may
    rely on this scoreboard.</p>

    <p>This setting applies to the entire server, and cannot be
    enabled or disabled on a virtualhost-by-virtualhost basis.
    The collection of extended status information can slow down
    the server.  Also note that this setting cannot be changed
    during a graceful restart.</p>

    <div class="note">
    <p>Note that loading <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> will change 
    the default behavior to ExtendedStatus On, while other
    third party modules may do the same.  Such modules rely on
    collecting detailed information about the state of all workers.
    The default is changed by <code class="module"><a href="../mod/mod_status.html">mod_status</a></code> beginning
    with version 2.3.6; the previous default was always Off.</p>
    </div>


</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>File attributes used to create the ETag
HTTP response header for static files</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>
    The <code class="directive">FileETag</code> directive configures the file
    attributes that are used to create the <code>ETag</code> (entity
    tag) response header field when the document is based on a static file.
    (The <code>ETag</code> value is used in cache management to save
    network bandwidth.) The
    <code class="directive">FileETag</code> directive allows you to choose
    which of these -- if any -- should be used. The recognized keywords are:
    </p>

    <dl>
     <dt><strong>INode</strong></dt>
     <dd>The file's i-node number will be included in the calculation</dd>
     <dt><strong>MTime</strong></dt>
     <dd>The date and time the file was last modified will be included</dd>
     <dt><strong>Size</strong></dt>
     <dd>The number of bytes in the file will be included</dd>
     <dt><strong>All</strong></dt>
     <dd>All available fields will be used. This is equivalent to:
         <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
     <dt><strong>None</strong></dt>
     <dd>If a document is file-based, no <code>ETag</code> field will be
       included in the response</dd>
    </dl>

    <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
    keywords may be prefixed with either <code>+</code> or <code>-</code>,
    which allow changes to be made to the default setting inherited
    from a broader scope. Any keyword appearing without such a prefix
    immediately and completely cancels the inherited setting.</p>

    <p>If a directory's configuration includes
    <code>FileETag&nbsp;INode&nbsp;MTime&nbsp;Size</code>, and a
    subdirectory's includes <code>FileETag&nbsp;-INode</code>,
    the setting for that subdirectory (which will be inherited by
    any sub-subdirectories that don't override it) will be equivalent to
    <code>FileETag&nbsp;MTime&nbsp;Size</code>.</p>
    <div class="warning"><h3>Warning</h3>
    Do not change the default for directories or locations that have WebDAV
    enabled and use <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> as a storage provider.
    <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> uses <code>INode&nbsp;MTime&nbsp;Size</code>
    as a fixed format for <code>ETag</code> comparisons on conditional requests.
    These conditional requests will break if the <code>ETag</code> format is
    changed via <code class="directive">FileETag</code>.
    </div>
    <div class="note"><h3>Server Side Includes</h3>
    An ETag is not generated for responses parsed by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>, 
    since the response entity can change without a change of the INode, MTime, or Size 
    of the static file with embedded SSI directives.
    </div>


</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="Files" id="Files">&lt;Files&gt;</a> <a name="files" id="files">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Contains directives that apply to matched
filenames</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>&lt;Files <var>filename</var>&gt; ... &lt;/Files&gt;</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>The <code class="directive">&lt;Files&gt;</code> directive
    limits the scope of the enclosed directives by filename. It is comparable
    to the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
    and <code class="directive"><a href="#location">&lt;Location&gt;</a></code>
    directives. It should be matched with a <code>&lt;/Files&gt;</code>
    directive. The directives given within this section will be applied to
    any object with a basename (last component of filename) matching the
    specified filename. <code class="directive">&lt;Files&gt;</code>
    sections are processed in the order they appear in the
    configuration file, after the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections and
    <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location">&lt;Location&gt;</a></code> sections. Note
    that <code class="directive">&lt;Files&gt;</code> can be nested
    inside <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections to restrict the
    portion of the filesystem they apply to.</p>

    <p>The <var>filename</var> argument should include a filename, or
    a wild-card string, where <code>?</code> matches any single character,
    and <code>*</code> matches any sequences of characters.
    <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">Regular expressions</a> 
    can also be used, with the addition of the
    <code>~</code> character. For example:</p>

    <div class="example"><p><code>
      &lt;Files ~ "\.(gif|jpe?g|png)$"&gt;
    </code></p></div>

    <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch">&lt;FilesMatch&gt;</a></code> is preferred,
    however.</p>

    <p>Note that unlike <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> and <code class="directive"><a href="#location">&lt;Location&gt;</a></code> sections, <code class="directive">&lt;Files&gt;</code> sections can be used inside
    <code>.htaccess</code> files. This allows users to control access to
    their own files, at a file-by-file level.</p>


<h3>Consulte tambin</h3>
<ul>
<li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
    and &lt;Files&gt; sections work</a> for an explanation of how these
    different sections are combined when a request is received</li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch">&lt;FilesMatch&gt;</a> <a name="filesmatch" id="filesmatch">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Contains directives that apply to regular-expression matched
filenames</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>&lt;FilesMatch <var>regex</var>&gt; ... &lt;/FilesMatch&gt;</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>The <code class="directive">&lt;FilesMatch&gt;</code> directive
    limits the scope of the enclosed directives by filename, just as the
    <code class="directive"><a href="#files">&lt;Files&gt;</a></code> directive
    does. However, it accepts a <a class="glossarylink" href="../glossary.html#regex" title="ver glosario">regular 
    expression</a>. For example:</p>

    <div class="example"><p><code>
      &lt;FilesMatch "\.(gif|jpe?g|png)$"&gt;
    </code></p></div>

    <p>would match most common Internet graphics formats.</p>

<h3>Consulte tambin</h3>
<ul>
<li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;
    and &lt;Files&gt; sections work</a> for an explanation of how these
    different sections are combined when a request is received</li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Forces all matching files to be served with the specified
media type in the HTTP Content-Type header field</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>ForceType <var>media-type</var>|None</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Moved to the core in Apache httpd 2.0</td></tr>
</table>
    <p>When placed into an <code>.htaccess</code> file or a
    <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>, or
    <code class="directive"><a href="#location">&lt;Location&gt;</a></code> or
    <code class="directive"><a href="#files">&lt;Files&gt;</a></code>
    section, this directive forces all matching files to be served
    with the content type identification given by
    <var>media-type</var>. For example, if you had a directory full of
    GIF files, but did not want to label them all with <code>.gif</code>,
    you might want to use:</p>

    <div class="example"><p><code>
      ForceType image/gif
    </code></p></div>

    <p>Note that this directive overrides other indirect media type
    associations defined in mime.types or via the
    <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code>.</p>

    <p>You can also override more general
    <code class="directive">ForceType</code> settings
    by using the value of <code>None</code>:</p>

    <div class="example"><p><code>
      # force all files to be image/gif:<br />
      &lt;Location /images&gt;<br />
        <span class="indent">
          ForceType image/gif<br />
        </span>
      &lt;/Location&gt;<br />
      <br />
      # but normal mime-type associations here:<br />
      &lt;Location /images/mixed&gt;<br />
      <span class="indent">
        ForceType None<br />
      </span>
      &lt;/Location&gt;
    </code></p></div>

    <p>This directive primarily overrides the content types generated for
    static files served out of the filesystem.  For resources other than 
    static files, where the generator of the response typically specifies 
    a Content-Type, this directive has no effect.</p>


</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="GprofDir" id="GprofDir">GprofDir</a> <a name="gprofdir" id="gprofdir">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Directory to write gmon.out profiling data to.  </td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>GprofDir <var>/tmp/gprof/</var>|<var>/tmp/gprof/</var>%</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>When the server has been compiled with gprof profiling support,
    <code class="directive">GprofDir</code> causes <code>gmon.out</code> files to
    be written to the specified directory when the process exits.  If the
    argument ends with a percent symbol ('%'), subdirectories are created
    for each process id.</p>

    <p>This directive currently only works with the <code class="module"><a href="../mod/prefork.html">prefork</a></code> 
    MPM.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>HostnameLookups Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>This directive enables DNS lookups so that host names can be
    logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
    The value <code>Double</code> refers to doing double-reverse
    DNS lookup. That is, after a reverse lookup is performed, a forward
    lookup is then performed on that result. At least one of the IP
    addresses in the forward lookup must match the original
    address. (In "tcpwrappers" terminology this is called
    <code>PARANOID</code>.)</p>

    <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
    used for controlling access by hostname, a double reverse lookup
    will be performed.  This is necessary for security. Note that the
    result of this double-reverse isn't generally available unless you
    set <code>HostnameLookups Double</code>. For example, if only
    <code>HostnameLookups On</code> and a request is made to an object
    that is protected by hostname restrictions, regardless of whether
    the double-reverse fails or not, CGIs will still be passed the
    single-reverse result in <code>REMOTE_HOST</code>.</p>

    <p>The default is <code>Off</code> in order to save the network
    traffic for those sites that don't truly need the reverse
    lookups done. It is also better for the end users because they
    don't have to suffer the extra latency that a lookup entails.
    Heavily loaded sites should leave this directive
    <code>Off</code>, since DNS lookups can take considerable
    amounts of time. The utility <code class="program"><a href="../programs/logresolve.html">logresolve</a></code>, compiled by
    default to the <code>bin</code> subdirectory of your installation
    directory, can be used to look up host names from logged IP addresses
    offline.</p>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="HttpProtocolOptions" id="HttpProtocolOptions">HttpProtocolOptions</a> <a name="httpprotocoloptions" id="httpprotocoloptions">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Modify restrictions on HTTP Request Messages</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>HttpProtocolOptions [Strict|Unsafe] [RegisteredMethods|LenientMethods]
 [Allow0.9|Require1.0]</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Valor por defecto:</a></th><td><code>HttpProtocolOptions Strict LenientMethods Allow0.9</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>2.2.32 or 2.4.24 and later</td></tr>
</table><p>La Documentacin para esta directiva 
        	no ha sido traducida an. Por favor use la versin en ingls 
        	mientras tanto.
            </p></div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="If" id="If">&lt;If&gt;</a> <a name="if" id="if">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Contains directives that apply only if a condition is
satisfied by a request at runtime</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>&lt;If <var>expression</var>&gt; ... &lt;/If&gt;</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>The <code class="directive">&lt;If&gt;</code> directive
    evaluates an expression at runtime, and applies the enclosed
    directives if and only if the expression evaluates to true.
    For example:</p>

    <div class="example"><p><code>
        &lt;If "$req{Host} = ''"&gt;
    </code></p></div>

    <p>would match HTTP/1.0 requests without a <var>Host:</var> header.</p>

    <p>You may compare the value of any variable in the request headers
    ($req), response headers ($resp) or environment ($env) in your
    expression.</p>

    <p>Apart from <code>=</code>, <code>If</code> can use the <code>IN</code>
    operator to compare if the expression is in a given range:</p>

    <div class="example"><p><code>
        &lt;If %{REQUEST_METHOD} IN GET,HEAD,OPTIONS&gt;
    </code></p></div>


<h3>Consulte tambin</h3>
<ul>
<li><a href="../expr.html">Expressions in Apache HTTP Server</a>,
for a complete reference and more examples.</li>
<li><a href="../sections.html">How &lt;Directory&gt;, &lt;Location&gt;,
    &lt;Files&gt; sections work</a> for an explanation of how these
    different sections are combined when a request is received.
    <code class="directive">&lt;If&gt;</code> has the same precedence
    and usage as <code class="directive">&lt;Files&gt;</code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="IfDefine" id="IfDefine">&lt;IfDefine&gt;</a> <a name="ifdefine" id="ifdefine">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Encloses directives that will be processed only
if a test is true at startup</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>&lt;IfDefine [!]<var>parameter-name</var>&gt; ...
    &lt;/IfDefine&gt;</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
</table>
    <p>The <code>&lt;IfDefine <var>test</var>&gt;...&lt;/IfDefine&gt;
    </code> section is used to mark directives that are conditional. The
    directives within an <code class="directive">&lt;IfDefine&gt;</code>
    section are only processed if the <var>test</var> is true. If <var>
    test</var> is false, everything between the start and end markers is
    ignored.</p>

    <p>The <var>test</var> in the <code class="directive">&lt;IfDefine&gt;</code> section directive can be one of two forms:</p>

    <ul>
      <li><var>parameter-name</var></li>

      <li><code>!</code><var>parameter-name</var></li>
    </ul>

    <p>In the former case, the directives between the start and end
    markers are only processed if the parameter named
    <var>parameter-name</var> is defined. The second format reverses
    the test, and only processes the directives if
    <var>parameter-name</var> is <strong>not</strong> defined.</p>

    <p>The <var>parameter-name</var> argument is a define as given on the
    <code class="program"><a href="../programs/httpd.html">httpd</a></code> command line via <code>-D<var>parameter</var>
    </code> at the time the server was started or by the <code class="directive"><a href="#define">Define</a></code> directive.</p>

    <p><code class="directive">&lt;IfDefine&gt;</code> sections are
    nest-able, which can be used to implement simple
    multiple-parameter tests. Example:</p>

    <div class="example"><p><code>
      httpd -DReverseProxy -DUseCache -DMemCache ...<br />
      <br />
      # httpd.conf<br />
      &lt;IfDefine ReverseProxy&gt;<br />
      <span class="indent">
        LoadModule proxy_module   modules/mod_proxy.so<br />
        LoadModule proxy_http_module   modules/mod_proxy_http.so<br />
        &lt;IfDefine UseCache&gt;<br />
        <span class="indent">
          LoadModule cache_module   modules/mod_cache.so<br />
          &lt;IfDefine MemCache&gt;<br />
          <span class="indent">
            LoadModule mem_cache_module   modules/mod_mem_cache.so<br />
          </span>
          &lt;/IfDefine&gt;<br />
          &lt;IfDefine !MemCache&gt;<br />
          <span class="indent">
            LoadModule cache_disk_module   modules/mod_cache_disk.so<br />
          </span>
          &lt;/IfDefine&gt;
        </span>
        &lt;/IfDefine&gt;
      </span>
      &lt;/IfDefine&gt;
    </code></p></div>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="IfModule" id="IfModule">&lt;IfModule&gt;</a> <a name="ifmodule" id="ifmodule">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Encloses directives that are processed conditional on the
presence or absence of a specific module</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>&lt;IfModule [!]<var>module-file</var>|<var>module-identifier</var>&gt; ...
    &lt;/IfModule&gt;</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Prevalece sobre:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Module identifiers are available in version 2.1 and
later.</td></tr>
</table>
    <p>The <code>&lt;IfModule <var>test</var>&gt;...&lt;/IfModule&gt;</code>
    section is used to mark directives that are conditional on the presence of
    a specific module. The directives within an <code class="directive">&lt;IfModule&gt;</code> section are only processed if the <var>test</var>
    is true. If <var>test</var> is false, everything between the start and
    end markers is ignored.</p>

    <p>The <var>test</var> in the <code class="directive">&lt;IfModule&gt;</code> section directive can be one of two forms:</p>

    <ul>
      <li><var>module</var></li>

      <li>!<var>module</var></li>
    </ul>

    <p>In the former case, the directives between the start and end
    markers are only processed if the module named <var>module</var>
    is included in Apache httpd -- either compiled in or
    dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
    and only processes the directives if <var>module</var> is
    <strong>not</strong> included.</p>

    <p>The <var>module</var> argument can be either the module identifier or
    the file name of the module, at the time it was compiled.  For example,
    <code>rewrite_module</code> is the identifier and
    <code>mod_rewrite.c</code> is the file name. If a module consists of
    several source files, use the name of the file containing the string
    <code>STANDARD20_MODULE_STUFF</code>.</p>

    <p><code class="directive">&lt;IfModule&gt;</code> sections are
    nest-able, which can be used to implement simple multiple-module
    tests.</p>

    <div class="note">This section should only be used if you need to have one
    configuration file that works whether or not a specific module
    is available. In normal operation, directives need not be
    placed in <code class="directive">&lt;IfModule&gt;</code>
    sections.</div>

</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directiva</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Descripcin:</a></th><td>Includes other configuration files from within
the server configuration files</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Sintaxis:</a></th><td><code>Include [<var>optional</var>|<var>strict</var>] <var>file-path</var>|<var>directory-path</var>|<var>wildcard</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Contexto:</a></th><td>server config, virtual host, directorio</td></tr>
<tr><th><a href="directive-dict.html#Status">Estado:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Mdulo:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibilidad:</a></th><td>Wildcard matching available in 2.0.41 and later, directory
wildcard matching available in 2.3.6 and later</td></tr>
</table>
    <p>This directive allows inclusion of other configuration files
    from within the server configuration files.</p>

    <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used
    in the filename or directory parts of the path to include several files
    at once, in alphabetical order. In addition, if
    <code class="directive">Include</code> points to a directory, rather than a file,
    Apache httpd will read all files in that directory and any subdirectory.
    However, including entire directories is not recommended, because it is
    easy to accidentally leave temporary files in a directory that can cause
    <code class="program"><a href="../programs/httpd.html">httpd</a></code> to fail. Instead, we encourage you to use the
    wildcard syntax shown below, to include files that match a particular
    pattern, such as *.conf, for example.</p>

    <p>When a wildcard is specified for a <strong>file</strong> component of
    the path, and no file matches the wildcard, the
    <code class="directive"><a href="#include">Include</a></code>
    directive will be <strong>silently ignored</strong>. When a wildcard is
    specified for a <strong>directory</strong> component of the path, and
    no directory matches the wildcard, the
    <code class="directive"><a href="#include">Include</a></code> directive will
    <strong>fail with an error</strong> saying the directory cannot be found.
    </p>

    <p>For further control over the behaviour of the server when no files or
    directories match, prefix the path with the modifiers <var>optional</var>
    or <var>strict</var>. If <var>optional</var> is specified, any wildcard
    file or directory that does not match will be silently ignored. If
    <var>strict</var> is specified, any wildcard file or directory that does
    not match at least one file will cause server startup to fail.</p>

    <p>When a directory or file component of the path is
    specified exactly, and that directory or file does not exist,
    <code class="directive"><a href="#include">Include</a></code> directive will fail with an
    error saying the file or directory cannot be found.</p>

    <p>The file path specified may be an absolute path, or may be relative 
    to the <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>

    <p>Examples:</p>

    <div class="example"><p><code>
      Include /usr/local/apache2/conf/ssl.conf<br />
      Include /usr/local/apache2/conf/vhosts/*.conf
    </code></p></div>

    <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>

    <div class="example"><p><code>
      Include conf/ssl.conf<br />
      Include conf/vhosts/*.conf
    </code></p></div>

    <p>Wildcards may be included in the directory or file portion of the
    path. In the following example, the server will fail to load if no
    directories match conf/vhosts/*, but will load successfully if no
    files match *.conf.</p>
  
    <div class="example"><p><code>
      Include conf/vhosts/*/vhost.conf<br />
      Include conf/vhosts/*/*.conf
    </code></p></div>

    <p>In this example, the server will fail to load if either
    conf/vhosts/* matches no directories, or if *.conf matches no files:</p>

    <div class="example"><p><code>
      Include strict conf/vhosts/*/*.conf
    </code></p></div>