1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 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 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
<TITLE>HTTP server </TITLE>
<SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
ALINK="#FF0000">
<CENTER>
<A HREF="http://www.erlang.se"><IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif"></A>
</CENTER>
<A NAME="4"><!-- Empty --></A>
<H2>4 HTTP server </H2>
<A NAME="4.1"><!-- Empty --></A>
<H3>4.1 Introduction</H3>
<P>The HTTP server, also refered to as httpd, handles HTTP requests
as described in RFC 2616 with a few exceptions such as gateway
and proxy functionality. (The same is true for servers written
by NCSA and others.) The server supports ipv6 as long as the
underlying mechanisms also do so.
<P>The server implements numerous features such as SSL (Secure Sockets
Layer), ESI (Erlang Scripting Interface), CGI (Common Gateway
Interface), User Authentication(using Mnesia, dets or plain text
database), Common Logfile Format (with or without disk_log(3)
support), URL Aliasing, Action Mappings, Directory Listings and SSI
(Server-Side Includes).
<P>The configuration of the server is done using Apache-style
configuration directives..
<P>Allmost all server functionality has been implemented using an
especially crafted server API, it is described in the Erlang Web
Server API. This API can be used to advantage by all who wants
to enhance the server core functionality, for example custom
logging and authentication.<A NAME="4.2"><!-- Empty --></A>
<H3>4.2 Basic Configuration</H3>
<P>It is possible to start a number of Web servers in an
embedded system using the services config parameter from an
application config file. A minimal application config file
(from now on referred to as inets.config) starting two HTTP
servers typically looks as follows:
<PRE>
[{inets,
[{services, [{httpd, "/var/tmp/server_root/conf/8888.conf"},
{httpd, "/var/tmp/server_root/conf/8080.conf"}]
}
]
}
].
</PRE>
<P> or:
<PRE>
[{inets,
[{services, [{httpd, [{file,"/var/tmp/server_root/conf/8888.conf"}]},
{httpd, [{file,"/var/tmp/server_root/conf/8080.conf"}]}]
}
]
}
].
</PRE>
<P>According to the new syntax which allows more functionality in
the configuration. The possible options here are a customer
configurable request accept timeout, the default value is 15000
milliseconds, and some trace functionality to debug the http
server. The syntax must match the following grammar:
<PRE>
httpd_service() -> {httpd, httpd()}
httpd() -> [httpd_config()] | file()
httpd_config() -> {file, file()} |
{debug, debug()} |
{accept_timeout, integer()}
debug() -> disable | [debug_options()]
debug_options() -> {all_functions, modules()} |
{exported_functions, modules()} |
{disable, modules()}
modules() -> [atom()]
</PRE>
<P>{file, file()} corresponds to the functionality of the old
version.
<P>{debug, debug()} is the new trace option. It can trace on all
functions or only exported functions on choosen modules.
<P>{accept_timeout, integer()} sets the wanted timeout value for
the server to set up a request connection.
<P>A server config file is specified for each HTTP server to be
started. The server config file syntax and semantics is described in
the run time configuration section.
<P>An easy way to test the setup of inets webservers can be done
by copying the example server root
(UNIX: $INETS_ROOT/examples/server_root/conf/, Windows:
%INETS_ROOT%\examples\server_root\conf\) to a specific
installation directory (/var/tmp/server_root/conf in this
example). Then manualy start the Erlang
node, using inets.config.
<PRE>
$ erl -config ./inets
Erlang (BEAM) emulator version 4.9
Eshell V4.9 (abort with ^G) 1> application:start(inets).
ok
</PRE>
<P>Now there should be two HTTP servers started
listening on the ports 8888 and 8080. You can
test it by using any browser or the inets HTTP client
requesting the urls: http://localhost:8888 and
http://localhost:8080<A NAME="4.3"><!-- Empty --></A>
<H3>4.3 Server Runtime Configuration</H3>
<P>All functionality in the server can be configured using
Apache-style configuration directives stored in a
configuration file. A minimal configuration file could look something
like:
<PRE>
ServerName web.server.net
ServerRoot /var/tmp/server_root
DocumentRoot /var/tmp/server_root/htdocs
</PRE>
<P>E.i the syntax is Directive followed by a withspace followed by
the value of the directive followed by a new line.
<P>The available directives are described in the section Server
Configuration Directives.<A NAME="4.4"><!-- Empty --></A>
<H3>4.4 Server Configuration Directives</H3>
<A NAME="4.4.1"><!-- Empty --></A>
<H4>4.4.1 Mandantory Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "ServerName"</STRONG><BR>
<STRONG>Syntax:</STRONG>
<CODE>ServerName</CODE> fully-qualified domain name<BR>
<STRONG>Default:</STRONG> - Mandatory - <BR>
<BR>
<CODE>ServerName</CODE> sets the <CODE>fully-qualified domain
name</CODE> of the server.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "ServerRoot"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ServerRoot</CODE> directory-filename<BR>
<STRONG>Default:</STRONG> - Mandatory -<BR>
<BR>
<CODE>ServerRoot</CODE> defines a <CODE>directory-filename</CODE>
where the server has it's operational home, e.g. used to store
log files and system icons. Relative paths specified in the
config file refer to this <CODE>directory-filename</CODE>.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "DocumentRoot"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>DocumentRoot</CODE> directory-filename<BR>
<STRONG>Default:</STRONG> - Mandatory -<BR>
<BR>
<CODE>DocumentRoot</CODE> points the Web server to the document
space from which to serve documents from. Unless matched by
a directive like Alias, the server appends the path
from the requested URL to the <CODE>DocumentRoot</CODE> to make
the path to the document, for example:
<BR>
<PRE>
DocumentRoot /usr/web
</PRE>
and an access to <CODE>http://your.server.org/index.html</CODE>
would refer to <CODE>/usr/web/index.html</CODE>.<BR>
</LI>
</UL>
<A NAME="4.4.2"><!-- Empty --></A>
<H4>4.4.2 Communication Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "BindAddress"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>BindAddress</CODE> address<BR>
<STRONG>Default:</STRONG> <CODE>BindAddress *</CODE><BR>
<CODE>BindAddress</CODE> defines which address the server will
listen to. If the argument is * then the server listens to
all addresses otherwise the server will only listen to the
address specified. Address can be given either as an IP
address or a hostname.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "Port"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>Port</CODE> number<BR>
<STRONG>Default:</STRONG> <CODE>Port 80</CODE><BR>
<BR>
<CODE>Port</CODE> defines which port <CODE>number</CODE> the server should
use (0 to 65535). Certain port numbers are reserved for
particular protocols, i.e. examine your
OS characteristics <FONT SIZE="-2">(<CODE>UNIX: /etc/services, Windows: </CODE>)</FONT> for a list
of reserved ports. The standard port for HTTP is 80.<BR>
All ports numbered below 1024 are reserved for system use and
regular (non-root) users cannot use them, i.e. to use
port 80 you must start the Erlang node as root. (sic!) If you
do not have root access choose an unused port above 1024
typically 8000, 8080 or 8888.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SocketType"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SocketType</CODE> type<BR>
<STRONG>Default:</STRONG> <CODE>SocketType ip_comm</CODE><BR>
<BR>
<CODE>SocketType</CODE> defines which underlying communication
<CODE>type</CODE> to be used. Valid socket types are:
<BR>
<DL>
<DT>
<CODE>ip_comm</CODE>
</DT>
<DD>
the default and preferred
communication type. ip_comm is also used for all remote
message passing in Erlang.
</DD>
<DT>
<CODE>ssl</CODE>
</DT>
<DD>
the
communication type to be used to support SSL.
</DD>
</DL>
</LI>
</UL>
<A NAME="4.4.3"><!-- Empty --></A>
<H4>4.4.3 Limit Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "DisableChunkedTransferEncodingSend"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>DisableChunkedTransferEncodingSend</CODE>
true | false<BR>
<STRONG>Default:</STRONG> false<BR>
<BR>
This directive tells the server whether to use chunked
transfer-encoding when sending a response to a HTTP/1.1
client.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "KeepAlive"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>KeepAlive</CODE> true | false<BR>
<STRONG>Default:</STRONG> true<BR>
<BR>
This directive tells the server whether to use persistent
connection or not when the client claims to be HTTP/1.1
compliant.<STRONG>Note:</STRONG>the value of KeepAlive has changed
from previous versions to be compliant with Apache.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "KeepAliveTimeout"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>KeepAliveTimeout</CODE> seconds<BR>
<STRONG>Default:</STRONG>150<BR>
<BR>
The number of seconds the server will wait for a subsequent
request from the client before closing the connection. If the
load on the server is high you may want to shorten this.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "MaxBodyAction"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>MaxBodyAction</CODE> action<BR>
<STRONG>Default:</STRONG> <CODE>MaxBodyAction close</CODE><BR>
<BR>
<CODE>MaxBodyAction</CODE> specifies the action to be taken when the
message body limit has been passed.
<BR>
<DL>
<DT>
<CODE>close</CODE>
</DT>
<DD>
the default and preferred communication type. ip_comm is
also used for all remote message passing in Erlang.
</DD>
<DT>
<CODE>reply414</CODE>
</DT>
<DD>
a reply (status) message with code 414 will be sent to the
client <STRONG>prior</STRONG> to closing the socket. Note that this
code is <STRONG>not</STRONG> defined in the HTTP/1.0 version of the
protocol.
</DD>
</DL>
</LI>
<LI>
<STRONG>DIRECTIVE: "MaxBodySize"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>MaxBodySize</CODE> size<BR>
<STRONG>Default:</STRONG> <CODE>MaxBodySize nolimit</CODE><BR>
<BR>
<CODE>MaxBodySize</CODE> limits the <CODE>size</CODE> of the message
body of HTTP request. The reply to this is specified by the
<CODE>MaxBodyAction</CODE> directive. Valid size is:
<BR>
<DL>
<DT>
<CODE>nolimit</CODE>
</DT>
<DD>
the default message body limit, e.g. no limit.
</DD>
<DT>
<CODE>integer()</CODE>
</DT>
<DD>
any positive number.
</DD>
</DL>
</LI>
<LI>
<STRONG>DIRECTIVE: "MaxClients"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>MaxClients</CODE> number<BR>
<STRONG>Default:</STRONG> <CODE>MaxClients 150</CODE><BR>
<BR>
<CODE>MaxClients</CODE> limits the <CODE>number</CODE> of simultaneous
requests that can be supported. No more than this <CODE>number</CODE>
of child server process's can be created.<BR>
</LI>
<LI>
<A NAME="MaxHeaderAction"><!-- Empty --></A>
<STRONG>DIRECTIVE: "MaxHeaderAction"</STRONG> <BR>
<STRONG>Syntax:</STRONG> <CODE>MaxHeaderAction</CODE> action<BR>
<STRONG>Default:</STRONG> <CODE>MaxHeaderAction close</CODE>
<BR>
<CODE>MaxHeaderAction</CODE> specifies the action to be taken
when the message Header limit has been passed.
<BR>
<DL>
<DT>
<CODE>close</CODE>
</DT>
<DD>
the socket is closed without any
message to the client. This is the default action.
</DD>
<DT>
<CODE>reply414</CODE>
</DT>
<DD>
a reply (status) message with
code 414 will be sent to the client <STRONG>prior</STRONG> to
closing the socket. Note that this code is <STRONG>not</STRONG>
defined in the HTTP/1.0 version of the protocol.
</DD>
</DL>
</LI>
<LI>
<STRONG>DIRECTIVE: "MaxHeaderSize"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>MaxHeaderSize</CODE> size<BR>
<STRONG>Default:</STRONG> <CODE>MaxHeaderSize 10240</CODE><BR>
<BR>
<CODE>MaxHeaderSize</CODE> limits the <CODE>size</CODE> of the message
header of HTTP request. The reply to this is specified by
the <CODE>MaxHeaderAction</CODE> directive. Valid size is:
<BR>
<DL>
<DT>
<CODE>integer()</CODE>
</DT>
<DD>
any positive number (default is 10240)
</DD>
<DT>
<CODE>nolimit</CODE>
</DT>
<DD>
no limit should be applied
</DD>
</DL>
</LI>
<LI>
<STRONG>DIRECTIVE: "MaxKeepAliveRequests"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>MaxKeepAliveRequests</CODE> NumberOfRequests<BR>
<STRONG>Default:</STRONG>- Disabled -<BR>
<BR>
The number of request that a client can do on one
connection. When the server has responded to the number of
requests defined by MaxKeepAliveRequests the server close
the connection. The server will close it even if there are
queued request.<BR>
</LI>
</UL>
<A NAME="4.4.4"><!-- Empty --></A>
<H4>4.4.4 Administrative Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "DefaultType"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>DefaultType</CODE> mime-type<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
When the server is asked to provide a document type which
cannot be determined by the MIME Type Settings, the server
must inform the client about the content type of documents
and <CODE>mime-type</CODE> is used if an unknown type is
encountered.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "Modules"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>Modules</CODE> module module ...<BR>
<STRONG>Default:</STRONG> <CODE>Modules mod_get mod_head mod_log</CODE><BR>
<BR>
<CODE>Modules</CODE> defines which Erlang Webserver API modules to be used in a
specific server setup. <CODE>module</CODE> is a module in the code
path of the server which has been written in accordance with
the section Erlang Web Server API. The server executes
functionality in each module, from left to right (from now
on called <STRONG>Erlang Webserver API Module Sequence</STRONG>).
<BR>
Before altering the Erlang Webserver API Modules Sequence please observe what
types of data each module uses and propagates.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "ServerAdmin"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ServerAdmin</CODE> email-address<BR>
<STRONG>Default:</STRONG> <CODE>ServerAdmin unknown@unknown</CODE><BR>
<BR>
<CODE>ServerAdmin</CODE> defines the <CODE>email-address</CODE> of the
server administrator, to be included in any error messages
returned by the server. It may be worth setting up a dedicated
user for this because clients do not always state which server
they have comments about, for example:<BR>
<PRE>
ServerAdmin www-admin@white-house.com
</PRE>
</LI>
</UL>
<A NAME="4.4.5"><!-- Empty --></A>
<H4>4.4.5 SSL Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "SSLCACertificateFile"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SSLCACertificateFile</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>SSLCACertificateFile</CODE> points at a PEM encoded
certificate of the certification authorities. Read more
about PEM encoded certificates in the SSL application
documentation. Read more about PEM encoded certificates in
the SSL application documentation.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SSLCertificateFile"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SSLCertificateFile</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>SSLCertificateFile</CODE> points at a PEM encoded
certificate. Read more about PEM encoded certificates in
the SSL application documentation. The dummy certificate
server.pem <FONT SIZE="-2">(<CODE>UNIX: $INETS/examples/server_root/ssl/, Windows: %INETS%\examples\server_root\ssl\</CODE>)</FONT>,
in the Inets distribution, can be used for test
purposes. Read more about PEM encoded certificates in
the SSL application documentation.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SSLCertificateKeyFile"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SSLCertificateKeyFile</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>SSLCertificateKeyFile</CODE> is used to point at a
certificate key file. This directive should only be used if
a certificate key has not been bundled with the certificate
file pointed at by SSLCertificateFile .
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SSLVerifyClient"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SSLVerifyClient</CODE> type<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
Set <CODE>type</CODE> to:
<BR>
<DL>
<DT>
0
</DT>
<DD>
if no client certificate is required.
</DD>
<DT>
1
</DT>
<DD>
if the client <STRONG>may</STRONG> present a valid
certificate.
</DD>
<DT>
2
</DT>
<DD>
if the client <STRONG>must</STRONG>
present a valid certificate.
</DD>
<DT>
3
</DT>
<DD>
if the client <STRONG>may</STRONG> present a valid
certificate but it is <STRONG>not</STRONG> required to have a
valid CA.
</DD>
</DL>
Read more about SSL in the application documentation.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SSLVerifyDepth"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SSLVerifyDepth</CODE> integer<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
This directive specifies how far up or down the
(certification) chain we are prepared to go before giving up.
<BR>
Read more about SSL in the application documentation.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SSLCiphers"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SSLCiphers</CODE> ciphers<BR>
<STRONG>Default:</STRONG> - None - <BR>
<BR>
<CODE>SSLCihers</CODE> is a colon separated list of ciphers.
<BR>
Read more about SSL in the application documentation.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SSLPasswordCallbackFunction"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SSLPasswordCallbackFunction</CODE>
function<BR>
<STRONG> Default:</STRONG> - None - <BR>
<BR>
The <CODE>SSLPasswordCallbackFunction</CODE> function in module
<CODE>SSLPasswordCallbackModule</CODE> is called in order to
retrieve the user's password.<BR>
Read more about SSL in
the application documentation.<BR>
</LI>
<LI>
<A NAME="SSLPasswordCallbackModule"><!-- Empty --></A>
<STRONG>DIRECTIVE: "SSLPasswordCallbackModule"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>SSLPasswordCallbackModule</CODE> function<BR>
<STRONG>Default:</STRONG> - None - <BR>
<BR>
The <CODE>SSLPasswordCallbackFunction</CODE> function in the
<CODE>SSLPasswordCallbackModule</CODE> module is called in order
to retrieve the user's password.<BR>
Read more about SSL in the application documentation.<BR>
</LI>
</UL>
<A NAME="4.4.6"><!-- Empty --></A>
<H4>4.4.6 URL Aliasing</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "Alias"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>Alias</CODE> url-path directory-filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
The Alias directive allows documents to be stored in the
local file system instead of the DocumentRoot
location. URLs with a path that begins with
<CODE>url-path</CODE> is mapped to local files that begins with
<CODE>directory-filename</CODE>, for example:<BR>
<PRE>
Alias /image /ftp/pub/image
</PRE>
and an access to
<CODE>http://your.server.org/image/foo.gif</CODE> would refer to the
file <CODE>/ftp/pub/image/foo.gif</CODE>.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "DirectoryIndex"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>DirectoryIndex</CODE> file file ...<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>DirectoryIndex</CODE> specifies a list of resources to
look for if a client requests a directory using a <CODE>/</CODE>
at the end of the directory name. <CODE>file</CODE> depicts the
name of a file in the directory. Several files may be
given, in which case the server will return the first it
finds, for example:<BR>
<PRE>
DirectoryIndex index.html
</PRE>
and access to <CODE>http://your.server.org/docs/</CODE> would
return <CODE>http://your.server.org/docs/index.html</CODE> if it
existed.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "ScriptAlias"</STRONG><BR>
<STRONG>Syntax:</STRONG>
<CODE>ScriptAlias</CODE> url-path directory-filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
The ScriptAlias directive has the same behavior as the
Alias
directive, except that it also marks the target directory
as containing CGI scripts. URLs with a path beginning with
<CODE>url-path</CODE> are mapped to scripts beginning with
<CODE>directory-filename</CODE>, for example:<BR>
<PRE>
ScriptAlias /cgi-bin/ /web/cgi-bin/
</PRE>
and an access to <CODE>http://your.server.org/cgi-bin/foo</CODE>
would cause the server to run the script
<CODE>/web/cgi-bin/foo</CODE>.<BR>
</LI>
</UL>
<A NAME="4.4.7"><!-- Empty --></A>
<H4>4.4.7 CGI Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "ScriptNoCache"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ScritpNoCache</CODE> true | false<BR>
<STRONG>Default:</STRONG> - false -<BR>
<BR>
If ScriptNoCache is set to true the Web server will by
default add the header fields necessary to prevent proxies from
caching the page. Generally this is something you want.<BR>
<PRE>
ScriptNoCache true
</PRE>
</LI>
<LI>
<STRONG>DIRECTIVE: "ScriptTimeout"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ScritpTimeout</CODE> Seconds<BR>
<STRONG>Default:</STRONG> 15 <BR>
<BR>
The time in seconds the web server will wait between
each chunk of data from the script. If the CGI-script
not delivers any data before the timeout the connection
to the client will be closed.
<BR>
<PRE>
ScriptTimeout 15
</PRE>
</LI>
<LI>
<STRONG>DIRECTIVE: "Action"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>Action</CODE> mime-type cgi-script<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>Action</CODE> adds an action, which will activate a
<CODE>cgi-script</CODE> whenever a file of a certain
<CODE>mime-type</CODE> is requested. It propagates the URL and
file path of the requested document using the standard CGI
<CODE>PATH_INFO</CODE> and <CODE>PATH_TRANSLATED</CODE> environment
variables.
<BR>
Examples:<BR>
<PRE>
Action text/plain /cgi-bin/log_and_deliver_text
Action home-grown/mime-type1 /~bob/do_special_stuff
</PRE>
</LI>
<LI>
<STRONG>DIRECTIVE: "Script"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>Script</CODE> method cgi-script<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>Script</CODE> adds an action, which will activate a
<CODE>cgi-script</CODE> whenever a file is requested using a certain
HTTP <CODE>method</CODE>. The <CODE>method</CODE> is either <CODE>GET</CODE> or
<CODE>POST</CODE> as defined in RFC 1945. It propagates the URL and
file path of the requested document using the standard CGI
<CODE>PATH_INFO</CODE> and <CODE>PATH_TRANSLATED</CODE> environment
variables.<BR>
Examples:<BR>
<PRE>
Script GET /cgi-bin/get
Script POST /~bob/put_and_a_little_more
</PRE>
</LI>
</UL>
<A NAME="4.4.8"><!-- Empty --></A>
<H4>4.4.8 ESI Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "ErlScriptAlias"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ErlScriptAlias</CODE> url-path
allowed-module allowed-module ...<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>ErlScriptAlias</CODE> marks all URLs matching <CODE>url-path</CODE>
as erl scheme scripts. A
matching URL is mapped into a specific module and
function. The module must be one of the
<CODE>allowed-module</CODE>:s. For example:
<BR>
<PRE>
ErlScriptAlias /cgi-bin/hit_me httpd_example md4
</PRE>
and a request to
<CODE>http://your.server.org/cgi-bin/hit_me/httpd_example:yahoo</CODE>
would refer to <CODE>httpd_example:yahoo/2</CODE>.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "ErlScriptNoCache"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ErlScriptNoCache</CODE> true | false<BR>
<STRONG>Default:</STRONG> false <BR>
<BR>
If <CODE>ErlScriptNoCache</CODE> is set to true the server will add
http header fields that prevents proxies from caching the page.
This is generally a good idea for dynamic content, since the
content often vary between each request.<BR>
<PRE>
ErlScriptNoCache true
</PRE>
</LI>
<LI>
<STRONG>DIRECTIVE: "ErlScriptTimeout"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ErlScriptTimeout</CODE> seconds<BR>
<STRONG>Default:</STRONG> 15 <BR>
<BR>
If <CODE>ErlScriptTimeout</CODE> sets the time in seconds the
server will wait between each chunk of data is delivered
through mod_esi:deliver/2 when the new Erl Scheme format,
that takes three argument is used.
<BR>
<PRE>
ErlScriptTimeout 15
</PRE>
</LI>
<LI>
<STRONG>DIRECTIVE: "EvalScriptAlias"</STRONG><BR>
<STRONG>Syntax:</STRONG>
<CODE>EvalScriptAlias</CODE> url-path allowed-module
allowed-module ...<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>EvalScriptAlias</CODE> marks all URLs matching
<CODE>url-path</CODE> as eval scheme
scripts. A matching URL is mapped into a specific module
and function. The module must be one of the
<CODE>allowed-module</CODE>:s. For example:
<BR>
<PRE>
EvalScriptAlias /cgi-bin/hit_me_to httpd_example md5
</PRE>
and a request to
<CODE>http://your.server.org/cgi-bin/hit_me_to/httpd_example:print("Hi!")</CODE>
would refer to <CODE>httpd_example:print/1</CODE>.<BR>
</LI>
</UL>
<A NAME="4.4.9"><!-- Empty --></A>
<H4>4.4.9 Auth Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "Directory"</STRONG><BR>
<STRONG>Syntax:</STRONG>
<CODE><Directory</CODE> regexp-filename<CODE>></CODE><BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE><Directory></CODE> and </Directory> are used
to enclose a group of directives which applies only to the
named directory and sub-directories of that
directory. <CODE>regexp-filename</CODE> is an extended regular
expression (See <CODE>regexp(3)</CODE>). For example:
<BR>
<PRE>
<Directory /usr/local/httpd[12]/htdocs>
AuthAccessPassword sOmEpAsSwOrD
AuthDBType plain
AuthName My Secret Garden
AuthUserFile /var/tmp/server_root/auth/user
AuthGroupFile /var/tmp/server_root/auth/group
require user ragnar edward
require group group1
allow from 123.145.244.5
</Directory>
</PRE>
If multiple directory sections match the directory (or its
parents), then the directives are applied with the shortest
match first. For example if you have one directory section
for <CODE>garden/</CODE> and one for <CODE>garden/flowers</CODE>, the
<CODE>garden/</CODE> section matches first.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "AuthDBType"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>AuthDBType</CODE> plain | dets | mnesia<BR>
<STRONG>Default:</STRONG> - None -<BR>
<STRONG>Context:</STRONG> Directory<BR>
<BR>
<CODE>AuthDBType</CODE> sets the type of authentication database
that is used for the directory.The key difference between the
different methods is that dynamic data can be saved when Mnesia
and Dets is used.
<BR>
If Mnesia is used as storage method, Mnesia must be
started prio to the webserver. The first time Mnesia is started
the schema and the tables must be created before Mnesia is
started. A naive example of a module with two functions that
creates and start mnesia is provided here. The function shall
be sued the first time. <CODE>first_start/0</CODE> creates the schema
and the tables. The second function <CODE>start/0</CODE> shall be used
in consecutive startups. <CODE>start/0</CODE> Starts Mnesia and wait
for the tables to be initiated. This function must only be used
when the schema and the tables already is created.
<BR>
<PRE>
-module(mnesia_test).
-export([start/0,load_data/0]).
-include("mod_auth.hrl").
first_start()->
mnesia:create_schema([node()]),
mnesia:start(),
mnesia:create_table(httpd_user,
[{type,bag},{disc_copies,[node()]},
{attributes,record_info(fields,httpd_user)}]),
mnesia:create_table(httpd_group,
[{type,bag},{disc_copies,[node()]},
{attributes,record_info(fields,httpd_group)}]),
mnesia:wait_for_tables([httpd_user,httpd_group],60000).
start()->
mnesia:start(),
mnesia:wait_for_tables([httpd_user,httpd_group],60000).
</PRE>
To create the Mnesia tables we use two records defined in
mod_auth.hrl so the file must be included.
<BR>
The first function <CODE>first_start/0</CODE> creates a schema
that specify on which nodes the database shall reside. Then it
starts Mnesia and creates the tables. The first argument is the
name of the tables, the second argument is a list of options how
the table will be created, see Mnesia documentation for more
information. Since the current implementation of the
mod_auth_mnesia saves one row for each user the type must be
bag.
<BR>
When the schema and the tables is created the second
function <CODE>start/0</CODE>shall be used to start Mensia. It
starts Mnesia and wait for the tables to be loaded. Mnesia
use the directory specified as <CODE>mnesia_dir</CODE> at startup
if specified, otherwise Mnesia use the current directory.
<BR>
For security reasons, make sure that the Mnesia tables
are stored outside the document tree of the Web server. If it
is placed in the directory which it protects, clients will
be able to download the tables.
<BR>
Only the <CODE>dets</CODE> and <CODE>mnesia</CODE> storage methods allow
writing of dynamic user data to disk. <CODE>plain</CODE> is a read
only method.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "AuthUserFile"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>AuthUserFile</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<STRONG>Context:</STRONG> Directory<BR>
<BR>
<CODE>AuthUserFile</CODE> sets the name of a file which
contains the list of users and passwords for user
authentication. <CODE>filename</CODE> can be either absolute or
relative to the <CODE>ServerRoot</CODE>.
<BR>
If using the <CODE>plain</CODE> storage method, this file is a
plain text file, where each line contains a user name followed
by a colon, followed by the <STRONG>non-encrypted</STRONG> password.
The behavior is undefined if user names are duplicated. For
example:
<BR>
<PRE>
ragnar:s7Xxv7
edward:wwjau8
</PRE>
If using the <CODE>dets</CODE> storage method, the user database is
maintained by <CODE>dets</CODE> and <STRONG>should not</STRONG> be edited by
hand. Use the API functions in mod_auth
module to create / edit the user database.
<BR>
This directive is ignored if using the <CODE>mnesia</CODE> storage
method.
<BR>
For security reasons, make sure that the <CODE>AuthUserFile</CODE>
is stored outside the document tree of the Web server. If it
is placed in the directory which it protects, clients will
be able to download it.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "AuthGroupFile"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>AuthGroupFile</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<STRONG>Context:</STRONG> Directory<BR>
<BR>
<CODE>AuthGroupFile</CODE> sets the name of a file which contains the
list of user groups for user authentication. <CODE>filename</CODE> can
be either absolute or relative to the <CODE>ServerRoot</CODE>.
<BR>
If you use the <CODE>plain</CODE> storage method, the group file is
a plain text file, where each line contains a group name
followed by a colon, followed by the member user names
separated by spaces. For example:
<BR>
<PRE>
group1: bob joe ante
</PRE>
If using the <CODE>dets</CODE> storage method, the group database is
maintained by <CODE>dets</CODE> and <STRONG>should not</STRONG> be edited by
hand. Use the API for mod_auth
module to create / edit the group database.
<BR>
This directive is ignored if using the <CODE>mnesia</CODE> storage
method.
<BR>
For security reasons, make sure that the <CODE>AuthGroupFile</CODE>
is stored outside the document tree of the Web server. If it
is placed in the directory which it protects, clients will
be able to download it.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "AuthName"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>AuthName</CODE> auth-domain<BR>
<STRONG>Default:</STRONG> - None -<BR>
<STRONG>Context:</STRONG> Directory<BR>
<BR>
<CODE>AuthName</CODE> sets the name of the authorization realm
(<CODE>auth-domain</CODE>) for a directory. This string informs the
client about which user name and password to use.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "AuthAccessPassword"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>AuthAccessPassword</CODE> password<BR>
<STRONG>Default:</STRONG> NoPassword <BR>
<STRONG>Context:</STRONG> Directory<BR>
<BR>
If <CODE>AuthAccessPassword</CODE> is set to other than
NoPassword the password is required for all API calls. If
the password is set to DummyPassword the password must be
changed before any other API calls. To secure the
authenticating data the password must be changed after the
webserver is started since it otherwise is written in
clear text in the configuration file.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "allow"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>allow from</CODE> host host ...<BR>
<STRONG>Default:</STRONG> <CODE>allow from all</CODE><BR>
<STRONG>Context:</STRONG> Directory <BR>
<BR>
<CODE>allow</CODE> defines a set of hosts which should be
granted access to a given directory. <CODE>host</CODE> is one of
the following:
<BR>
<DL>
<DT>
<CODE>all</CODE>
</DT>
<DD>
All hosts are allowed access.
</DD>
<DT>
A regular expression (Read <CODE>regexp(3)</CODE>)
</DT>
<DD>
All hosts having a numerical IP address matching the
specific regular expression are allowed access.
</DD>
</DL>
For example:
<BR>
<PRE>
allow from 123.34.56.11 150.100.23
</PRE>
The host 123.34.56.11 and all machines on the 150.100.23
subnet are allowed access.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "deny"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>deny from</CODE> host host ...<BR>
<STRONG>Default:</STRONG> <CODE>deny from all</CODE><BR>
<STRONG>Context:</STRONG> Directory<BR>
<BR>
<CODE>deny</CODE> defines a set of hosts which should not be
granted access to a given directory. <CODE>host</CODE> is one of
the following:
<BR>
<DL>
<DT>
<CODE>all</CODE>
</DT>
<DD>
All hosts are denied access.
</DD>
<DT>
A regular expression (Read <CODE>regexp(3)</CODE>)
</DT>
<DD>
All hosts having a numerical IP address matching the
specific regular expression are denied access.
</DD>
</DL>
For example:
<BR>
<PRE>
deny from 123.34.56.11 150.100.23
</PRE>
The host 123.34.56.11 and all machines on the 150.100.23 subnet
are denied access. <BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "require"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>require</CODE> entity-name entity entity ...<BR>
<STRONG>Default:</STRONG> - None -<BR>
<STRONG>Context:</STRONG> Directory<BR>
<BR>
<CODE>require</CODE> defines users which should be granted
access to a given directory using a secret password. The allowed
syntaxes are:
<BR>
<DL>
<DT>
<CODE>require user user-name user-name ...</CODE>
</DT>
<DD>
Only the named users can access the directory.
</DD>
<DT>
<CODE>require group group-name group-name ...</CODE>
</DT>
<DD>
Only users in the named groups can access the directory.
</DD>
</DL>
</LI>
</UL>
<A NAME="4.4.10"><!-- Empty --></A>
<H4>4.4.10 Htacess Authentication Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "AccessFileName"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>AccessFileName</CODE><CODE>FileName1
FileName2</CODE><BR>
<STRONG>Default:</STRONG> .htaccess
<BR>
<CODE>AccessFileName</CODE> Specify which filenames that are
used for access-files. When a request comes every directory in
the path to the requested asset will be searched after files
with the names specified by this parameter. If such a file is
found the file will be parsed and the restrictions specified
in it will be applied to the request.
<BR>
</LI>
</UL>
<A NAME="4.4.11"><!-- Empty --></A>
<H4>4.4.11 Auth Filter Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "SecurityDataFile"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SecurityDataFile</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<STRONG>Context:</STRONG> Directory
<BR>
<CODE>SecurityDataFile</CODE> sets the name of the security
modules for a directory. The filename can be either absolute
or relative to the <CODE>ServerRoot</CODE>. This file is used to
store persistent data for the mod_security module.
<BR>
Several directories can have the same
<CODE>SecurityDataFile</CODE>.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SecurityMaxRetries"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SecurityMaxRetries</CODE> integer() | infinity<BR>
<STRONG>Default:</STRONG> 3<BR>
<STRONG>Context:</STRONG><BR>
<BR>
<CODE>SecurityMaxRetries</CODE> specifies the maximum number of
tries to authenticate a user has before he is blocked
out. If a user successfully authenticates when he is
blocked, he will receive a 403 (Forbidden) response from the
server.<BR>
For security reasons, failed authentications made by this
user will return a message 401 (Unauthorized), even if the
user is blocked.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SecurityBlockTime"</STRONG> <BR>
<STRONG>Syntax:</STRONG> <CODE>SecurityBlockTime</CODE> integer() | infinity<BR>
<STRONG>Default:</STRONG> 60<BR>
<STRONG>Context:</STRONG> Directory<BR>
<BR>
<CODE>SecurityBlockTime</CODE> specifies the number of minutes a user
is blocked. After this amount of time, he automatically
regains access.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SecurityFailExpireTime"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SecurityFailExpireTime</CODE> integer() | infinity<BR>
<STRONG>Default:</STRONG> 30<BR>
<STRONG>Context:</STRONG> Directory <BR>
<BR>
<CODE>SecurityFailExpireTime</CODE> specifies the number of
minutes a failed user authentication is remembered. If a user
authenticates after this amount of time, his previous failed
authentications are forgotten.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SecurityAuthTimeout"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SecurityAuthTimeout</CODE> integer() | infinity<BR>
<STRONG>Default:</STRONG> 30<BR>
<STRONG>Context:</STRONG> Directory<BR>
<BR>
<CODE>SecurityAuthTimeout</CODE> specifies the number of
seconds a successful user authentication is
remembered. After this time has passed, the authentication
will no longer be reported.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SecurityCallbackModule"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SecurityCallbackModule</CODE> atom()<BR>
<STRONG>Default:</STRONG> - None -<BR>
<STRONG>Context:</STRONG> Directory <BR>
<BR>
<CODE>SecurityCallbackModule</CODE> specifies the name of a callback
module. <BR>
</LI>
</UL>
<A NAME="4.4.12"><!-- Empty --></A>
<H4>4.4.12 Logging Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "ErrorLog"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ErrorLog</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>ErrorLog</CODE> defines the <CODE>filename</CODE> of the error log
file to be used to log server errors. If the <CODE>filename</CODE>
does not begin with a slash (<CODE>/</CODE>) it is assumed to be
relative to the ServerRoot, for example:
<BR>
<PRE>
ErrorLog logs/error_log_8080
</PRE>
and errors will be logged in the
server
root <FONT SIZE="-2">(<CODE>UNIX: $SERVER_ROOT/logs/error_log_8080, Windows: %SERVER_ROOT%\logs\error_log_8080</CODE>)</FONT> space.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SecurityLog"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SecurityLog</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>SecurityLog</CODE> defines the <CODE>filename</CODE> of the
access log file to be used to log security events. If the
<CODE>filename</CODE> does not begin with a slash (<CODE>/</CODE>) it is
assumed to be relative to the ServerRoot. For example:
<BR>
<PRE>
SecurityLog logs/security_log_8080
</PRE>
and security events will be logged in the
server
root <FONT SIZE="-2">(<CODE>UNIX: $SERVER_ROOT/logs/security_log_8080, Windows: %SERVER_ROOT%\logs\security_log_8080</CODE>)</FONT> space.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "TransferLog"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>TransferLog</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>TransferLog</CODE> defines the <CODE>filename</CODE> of the
access log file to be used to log incoming requests. If the
<CODE>filename</CODE> does not begin with a slash (<CODE>/</CODE>) it is
assumed to be relative to the ServerRoot. For example:<BR>
<PRE>
TransferLog logs/access_log_8080
</PRE>
and errors will be logged in the
server
root <FONT SIZE="-2">(<CODE>UNIX: $SERVER_ROOT/logs/access_log_8080, Windows: %SERVER_ROOT%\logs\access_log_8080</CODE>)</FONT> space.
<BR>
</LI>
</UL>
<A NAME="4.4.13"><!-- Empty --></A>
<H4>4.4.13 Disk Log Directives</H4>
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "DiskLogFormat"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>DiskLogFormat</CODE> internal|external<BR>
<STRONG>Default:</STRONG> - external -<BR>
<BR>
<CODE>DiskLogFormat</CODE> defines the file-format of the
log files see <STRONG>disk_log</STRONG> for more information.
If the internal file-format is used, the logfile
will be repaired after a crash. When a log file is repaired
data might get lost. When the external file-format is used
httpd will not start if the log file is broken. <BR>
<PRE>
DiskLogFormat external
</PRE>
</LI>
<LI>
<STRONG>DIRECTIVE: "ErrorDiskLog"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ErrorDiskLog</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>ErrorDiskLog</CODE> defines the <CODE>filename</CODE> of the
<CODE>(disk_log(3))</CODE> error log file to be used to log server
errors. If the <CODE>filename</CODE> does not begin with a slash
(<CODE>/</CODE>) it is assumed to be relative to the ServerRoot,
for example:<BR>
<PRE>
ErrorDiskLog logs/error_disk_log_8080
</PRE>
and errors will be logged in the
server
root <FONT SIZE="-2">(<CODE>UNIX: $SERVER_ROOT/logs/error_disk_log_8080, Windows: %SERVER_ROOT%\logs\error_disk_log_8080</CODE>)</FONT> space.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "ErrorDiskLogSize"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>ErrorDiskLogSize</CODE> max-bytes
max-files<BR>
<STRONG>Default:</STRONG> <CODE>ErrorDiskLogSize 512000
8</CODE><BR>
<BR>
<CODE>ErrorDiskLogSize</CODE> defines the
properties of the <CODE>(disk_log(3))</CODE> error log file. The
<CODE>disk_log(3)</CODE> error log file is of type <STRONG>wrap
log</STRONG> and <CODE>max-bytes</CODE> will be written to each file
and <CODE>max-files</CODE> will be used before the first file is
truncated and reused.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SecurityDiskLog"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SecurityDiskLog</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>SecurityDiskLog</CODE> defines the <CODE>filename</CODE> of the
<CODE>(disk_log(3))</CODE> access log file which logs incoming
security events i.e authenticated requests.
If the <CODE>filename</CODE> does not begin with a slash
(<CODE>/</CODE>) it is assumed to be relative to the ServerRoot.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "SecurityDiskLogSize"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>SecurityDiskLogSize</CODE> max-bytes max-files<BR>
<STRONG>Default:</STRONG> <CODE>SecurityDiskLogSize 512000 8</CODE><BR>
<BR>
<CODE>SecurityDiskLogSize</CODE> defines the properties of the
<CODE>disk_log(3)</CODE> access log file. The <CODE>disk_log(3)</CODE>
access log file is of type <STRONG>wrap log</STRONG> and
<CODE>max-bytes</CODE> will be written to each file and
<CODE>max-files</CODE> will be used before the first file is
truncated and reused.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "TransferDiskLog"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>TransferDiskLog</CODE> filename<BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE>TransferDiskLog</CODE> defines the <CODE>filename</CODE> of the
<CODE>(disk_log(3))</CODE> access log file which logs incoming
requests. If the <CODE>filename</CODE> does not begin with a slash
(<CODE>/</CODE>) it is assumed to be relative to the
ServerRoot, for example:
<BR>
<PRE>
TransferDiskLog logs/transfer_disk_log_8080
</PRE>
and errors will be logged in the
server
root <FONT SIZE="-2">(<CODE>UNIX: $SERVER_ROOT/logs/transfer_disk_log_8080, Windows: %SERVER_ROOT%\logs\transfer_disk_log_8080</CODE>)</FONT> space.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "TransferDiskLogSize"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>TransferDiskLogSize</CODE> max-bytes max-files<BR>
<STRONG>Default:</STRONG> <CODE>TransferDiskLogSize 512000 8</CODE><BR>
<BR>
<CODE>TransferDiskLogSize</CODE> defines the properties of the
<CODE>disk_log(3)</CODE> access log file. The <CODE>disk_log(3)</CODE>
access log file is of type <STRONG>wrap log</STRONG> and
<CODE>max-bytes</CODE> will be written to each file and
<CODE>max-files</CODE> will be used before the first file is truncated
and reused.<BR>
</LI>
</UL>
<A NAME="4.5"><!-- Empty --></A>
<H3>4.5 Mime Type Configuration</H3>
<P>Files delivered to the client are MIME typed according to RFC
1590. File suffixes are mapped to MIME types before file delivery.
<P>The mapping between file suffixes and MIME types are specified in
the mime.types file. The mime.types reside within the conf
directory of the ServerRoot. MIME types may be added as
required to the mime.types file and the DefaultType config
directive can be used to specify a default mime type.
An example of a very small mime.types file:
<PRE>
# MIME type Extension
text/html html htm
text/plain asc txt
</PRE>
<A NAME="4.6"><!-- Empty --></A>
<H3>4.6 Htaccess - User Configurable Authentication.</H3>
<P> If users of the webserver needs to manage authentication of
webpages that are local to their user and do not have
server administrative privileges. They can use the
per-directory runtime configurable user-authentication scheme
that Inets calls htaccess. It works the following way:
<P>
<UL>
<LI>
Each directory in the path to the requested asset is
searched for an access-file (default .htaccess), that restricts
the webservers rights to respond to a request. If an access-file
is found the rules in that file is applied to the
request.
</LI>
<LI>
The rules in an access-file applies both to files in the same
directories and in subdirectories. If there exists more than one
access-file in the path to an asset, the rules in the
access-file nearest the requested asset will be applied.
</LI>
<LI>
To change the rules that restricts the use of
an asset. The user only needs to have write access
to the directory where the asset exists.
</LI>
<LI>
All the access-files in the path to a requested asset is read
once per request, this means that the load on the server will
increase when this scheme is used.
</LI>
<LI>
If a directory is
limited both by auth directives in the HTTP server configuration
file and by the htaccess files. The user must be allowed to get
access the file by both methods for the request to succed.
</LI>
</UL>
<A NAME="4.6.1"><!-- Empty --></A>
<H4>4.6.1 Access Files Directives</H4>
<P> In every directory under the <CODE>DocumentRoot</CODE> or under an
<CODE>Alias</CODE> a user can place an access-file. An access-file
is a plain text file that specify the restrictions that
shall be considered before the webserver answer to a
request. If there are more than one access-file in the path
to the requested asset, the directives in the access-file in
the directory nearest the asset will be used.
<P>
<UL>
<LI>
<STRONG>DIRECTIVE: "allow"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>Allow</CODE> from subnet subnet|from all<BR>
<STRONG>Default:</STRONG> <CODE> from all </CODE><BR>
<BR>
Same as the directive allow for the server config file.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "AllowOverRide"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>AllowOverRide</CODE> all | none |
Directives<BR>
<STRONG>Default:</STRONG> <CODE> - None -</CODE><BR>
<CODE>AllowOverRide</CODE> Specify which parameters that not
access-files in subdirectories are allowed to alter the value
for. If the parameter is set to none no more
access-files will be parsed.
<BR>
If only one access-file exists setting this parameter to
none can lessen the burden on the server since the server
will stop looking for access-files.<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "AuthGroupfile"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>AuthGroupFile</CODE> Filename<BR>
<STRONG>Default:</STRONG> <CODE> - None -</CODE><BR>
<BR>
AuthGroupFile indicates which file that contains the list
of groups. Filename must contain the absolute path to the
file. The format of the file is one group per row and
every row contains the name of the group and the members
of the group separated by a space, for example:
<BR>
<PRE>
GroupName: Member1 Member2 .... MemberN
</PRE>
</LI>
<LI>
<STRONG>DIRECTIVE: "AuthName"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>AuthName</CODE> auth-domain<BR>
<STRONG>Default:</STRONG> <CODE> - None -</CODE><BR>
<BR>
Same as the directive AuthName for the server config file.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "AuthType"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>AuthType</CODE> Basic<BR>
<STRONG>Default:</STRONG> <CODE>Basic</CODE><BR>
<BR>
<CODE>AuthType</CODE> Specify which authentication scheme that shall
be used. Today only Basic Authenticating using UUEncoding of
the password and user ID is implemented. <BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "AuthUserFile"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>AuthUserFile</CODE> Filename<BR>
<STRONG>Default:</STRONG> <CODE> - None -</CODE><BR>
<BR>
<CODE>AuthUserFile</CODE> indicate which file that contains the list
of users. Filename must contain the absolute path to the
file. The users name and password are not encrypted so do not
place the file with users in a directory that is accessible
via the webserver. The format of the file is one user per row
and every row contains User Name and Password separated by a
colon, for example:
<BR>
<PRE>
UserName:Password
UserName:Password
</PRE>
</LI>
<LI>
<STRONG>DIRECTIVE: "deny"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>deny</CODE> from subnet subnet|from all<BR>
<STRONG>Context:</STRONG> Limit
<BR>
Same as the directive deny for the server config file.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "Limit"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE><Limit</CODE> RequestMethods<CODE>></CODE><BR>
<STRONG>Default:</STRONG> - None -<BR>
<BR>
<CODE><Limit></CODE> and </Limit> are used to enclose
a group of directives which applies only to requests using
the specified methods. If no request method is specified
all request methods are verified against the restrictions.
<BR>
<PRE>
<Limit POST GET HEAD>
order allow deny
require group group1
allow from 123.145.244.5
</Limit>
</PRE>
</LI>
<LI>
<STRONG>DIRECTIVE: "order"</STRONG><BR>
<STRONG>Syntax:</STRONG> <CODE>order</CODE> allow deny | deny allow<BR>
<STRONG>Default:</STRONG> allow deny<BR>
<CODE>order</CODE>, defines if the deny or allow control shall
be preformed first.
<BR>
If the order is set to allow deny, then first the users
network address is controlled to be in the allow subset. If
the users network address is not in the allowed subset he will
be denied to get the asset. If the network-address is in the
allowed subset then a second control will be preformed, that
the users network address is not in the subset of network
addresses that shall be denied as specified by the deny
parameter.
<BR>
If the order is set to deny allow then only users from networks
specified to be in the allowed subset will succeed to request
assets in the limited area.
<BR>
</LI>
<LI>
<STRONG>DIRECTIVE: "require"</STRONG>
<STRONG>Syntax:</STRONG> <CODE>require</CODE>
group group1 group2...|user user1 user2...<BR>
<STRONG>Default:</STRONG> <CODE> - None -</CODE><BR>
<STRONG>Context:</STRONG> Limit<BR>
<BR>
See the require directive in the documentation of mod_auth(3)
for more information.
<BR>
</LI>
</UL>
<A NAME="4.7"><!-- Empty --></A>
<H3>4.7 Dynamic Web Pages</H3>
<P>The Inets HTTP server provides two ways of creating dynamic web
pages, each with its own advantages and disadvantages.
<P>First there are CGI-scripts that can be written in any programming
language. CGI-scripts are standardized and supported by most
webservers. The drawback with CGI-scripts is that they are resource
intensive because of their design. CGI requires the server to fork a
new OS process for each executable it needs to start.
<P>Second there are ESI-functions that provide a tight and efficient
interface to the execution of Erlang functions, this interface
on the other hand is Inets specific. <A NAME="4.7.1"><!-- Empty --></A>
<H4>4.7.1 The Common Gateway Interface (CGI) Version 1.1,
RFC 3875.</H4>
<P>The mod_cgi module makes it possible to execute CGI scripts
in the server. A file that matches the definition of a
ScriptAlias config directive is treated as a CGI script. A CGI
script is executed by the server and it's output is returned to
the client.
<P> The CGI Script response comprises a message-header and a
message-body, separated by a blank line. The message-header
contains one or more header fields. The body may be
empty. Example:
<PRE>
"Content-Type:text/plain\nAccept-Ranges:none\n\nsome very
plain text"
</PRE>
<P> The server will interpret the cgi-headers and most of them
will be transformed into HTTP headers and sent back to the
client together with the body.
<P>Support for CGI-1.1 is implemented in accordance with the RFC
3875. <A NAME="4.7.2"><!-- Empty --></A>
<H4>4.7.2 Erlang Server Interface (ESI)</H4>
<P>The erlang server interface is implemented by the
module mod_esi.<A NAME="4.7.2.1"><!-- Empty --></A>
<H5>4.7.2.1 ERL Scheme </H5>
<P>The erl scheme is designed to mimic plain CGI, but without
the extra overhead. An URL which calls an Erlang erl function
has the following syntax (regular expression):
<PRE>
http://your.server.org/***/Module[:/]Function(?QueryString|/PathInfo)
</PRE>
<P>*** above depends on how the ErlScriptAlias config
directive has been used
<P>The module (Module) referred to must be found in the code
path, and it must define a function (Function) with an arity
of two or three. It is preferable to implement a funtion
with arity three as it permitts you to send chunks of the
webpage beeing generated to the client during the generation
phase instead of first generating the whole web page and
then sending it to the client. The option to implement a
function with arity two is only keept for
backwardcompatibilty reasons. See <A HREF="mod_esi.html"> mod_esi(3)</A> for implementation details of the esi
callback function.<A NAME="4.7.2.2"><!-- Empty --></A>
<H5>4.7.2.2 EVAL Scheme </H5>
<P>The eval scheme is straight-forward and does not mimic the
behavior of plain CGI. An URL which calls an Erlang eval
function has the following syntax:
<PRE>
http://your.server.org/***/Mod:Func(Arg1,...,ArgN)
</PRE>
<P>*** above depends on how the ErlScriptAlias config
directive has been used
<P>The module (Mod) referred to must be found in the code
path, and data returned by the function (Func) is passed
back to the client. Data returned from the
function must furthermore take the form as specified in
the CGI specification. See <A HREF="mod_esi.html"> mod_esi(3)</A> for implementation details of the esi
callback function.
<P>
<TABLE CELLPADDING=4>
<TR>
<TD VALIGN=TOP><IMG ALT="Note!" SRC="note.gif"></TD>
<TD>
<P> The eval scheme can seriously threaten the
integrity of the Erlang node housing a Web server, for
example:
<PRE>
http://your.server.org/eval?httpd_example:print(atom_to_list(apply(erlang,halt,[])))
</PRE>
<P>which effectively will close down the Erlang node,
that is use the erl scheme instead, until this
security breach has been fixed.
<P>Today there are no good way of solving this problem
and therefore Eval Scheme may be removed in future
release of Inets. </TD>
</TR>
</TABLE>
<A NAME="4.8"><!-- Empty --></A>
<H3>4.8 Logging </H3>
<P> There are three types of logs supported. Transfer logs,
security logs and error logs. The de-facto standard Common
Logfile Format is used for the transfer and security logging.
There are numerous statistics programs available to analyze Common
Logfile Format. The Common Logfile Format looks as follows:
<P><STRONG>remotehost rfc931 authuser [date] "request" status bytes</STRONG>
<P>
<DL>
<DT>
<STRONG>remotehost</STRONG>
</DT>
<DD>
Remote hostname
</DD>
<DT>
<STRONG>rfc931</STRONG>
</DT>
<DD>
The client's remote username (RFC 931).
</DD>
<DT>
<STRONG>authuser</STRONG>
</DT>
<DD>
The username with which the user authenticated himself.
</DD>
<DT>
<STRONG>[date]</STRONG>
</DT>
<DD>
Date and time of the request (RFC 1123).
</DD>
<DT>
<STRONG>"request"</STRONG>
</DT>
<DD>
The request line exactly as it came from the client (RFC 1945).
</DD>
<DT>
<STRONG>status</STRONG>
</DT>
<DD>
The HTTP status code returned to the client (RFC 1945).
</DD>
<DT>
<STRONG>bytes</STRONG>
</DT>
<DD>
The content-length of the document transferred.
</DD>
</DL>
<P>Internal server errors are recorde in the error log file. The
format of this file is a more ad hoc format than the logs using
Common Logfile Format, but conforms to the following syntax:
<P><STRONG>[date]</STRONG> access to <STRONG>path</STRONG> failed for
<STRONG>remotehost</STRONG>, reason: <STRONG>reason</STRONG>
<A NAME="4.9"><!-- Empty --></A>
<H3>4.9 Server Side Includes</H3>
<P>Server Side Includes enables the server to run code embedded
in HTML pages to generate the response to the client.
<P>
<TABLE CELLPADDING=4>
<TR>
<TD VALIGN=TOP><IMG ALT="Note!" SRC="note.gif"></TD>
<TD>
<P>Having the server parse HTML pages is a double edged sword!
It can be costly for a heavily loaded server to perform
parsing of HTML pages while sending them. Furthermore, it can
be considered a security risk to have average users executing
commands in the name of the Erlang node user. Carefully
consider these items before activating server-side includes.
</TD>
</TR>
</TABLE>
<A NAME="ssi_setup"><!-- Empty --></A><A NAME="4.9.1"><!-- Empty --></A>
<H4>4.9.1 SERVER-SIDE INCLUDES (SSI) SETUP</H4>
<P>The server must be told which filename extensions to be used
for the parsed files. These files, while very similar to HTML,
are not HTML and are thus not treated the same. Internally, the
server uses the magic MIME type <CODE>text/x-server-parsed-html</CODE>
to identify parsed documents. It will then perform a format
conversion to change these files into HTML for the
client. Update the <CODE>mime.types</CODE> file, as described in the
Mime Type Settings, to tell the server which extension to use
for parsed files, for example:
<PRE>
text/x-server-parsed-html shtml shtm
</PRE>
<P>This makes files ending with <CODE>.shtml</CODE> and <CODE>.shtm</CODE>
into parsed files. Alternatively, if the performance hit is not a
problem, <STRONG>all</STRONG> HTML pages can be marked as parsed:
<PRE>
text/x-server-parsed-html html htm
</PRE>
<A NAME="ssi_format"><!-- Empty --></A><A NAME="4.9.2"><!-- Empty --></A>
<H4>4.9.2 Server-Side Includes (SSI) Format</H4>
<P>All server-side include directives to the server are formatted
as SGML comments within the HTML page. This is in case the
document should ever find itself in the client's hands
unparsed. Each directive has the following format:
<PRE>
<!--#command tag1="value1" tag2="value2" -->
</PRE>
<P>Each command takes different arguments, most only accept one
tag at a time. Here is a breakdown of the commands and their
associated tags:
<P>
<DL>
<DT>
<CODE>config</CODE>
</DT>
<DD>
The config directive controls various aspects of the
file parsing. There are two valid tags:
<BR>
<DL>
<DT>
<CODE>errmsg</CODE>
</DT>
<DD>
controls the message sent back to the client if an
error occurred while parsing the document. All errors are
logged in the server's error log.
<BR>
</DD>
<DT>
<CODE>sizefmt</CODE>
</DT>
<DD>
determines the format used to display the size of
a file. Valid choices are <CODE>bytes</CODE> or
<CODE>abbrev</CODE>. <CODE>bytes</CODE> for a formatted byte count
or <CODE>abbrev</CODE> for an abbreviated version displaying
the number of kilobytes.
<BR>
</DD>
</DL>
</DD>
<DT>
<CODE>include</CODE>
</DT>
<DD>
will insert the text of a document into the parsed
document. This command accepts two tags:
<BR>
<DL>
<DT>
<CODE>virtual</CODE>
</DT>
<DD>
gives a virtual path to a document on the
server. Only normal files and other parsed documents can
be accessed in this way.
<BR>
</DD>
<DT>
<CODE>file</CODE>
</DT>
<DD>
gives a pathname relative to the current
directory. <CODE>../</CODE> cannot be used in this pathname, nor
can absolute paths. As above, you can send other parsed
documents, but you cannot send CGI scripts.
<BR>
</DD>
</DL>
</DD>
<DT>
<CODE>echo</CODE>
</DT>
<DD>
prints the value of one of the include variables
(defined below). The only valid tag to this command is
<CODE>var</CODE>, whose value is the name of the variable you wish
to echo.
<BR>
</DD>
<DT>
<CODE>fsize</CODE>
</DT>
<DD>
prints the size of the specified file. Valid tags are
the same as with the <CODE>include</CODE> command. The resulting
format of this command is subject to the <CODE>sizefmt</CODE>
parameter to the <CODE>config</CODE> command.
<BR>
</DD>
<DT>
<CODE>flastmod</CODE>
</DT>
<DD>
prints the last modification date of the specified
file. Valid tags are the same as with the <CODE>include</CODE>
command.
<BR>
</DD>
<DT>
<CODE>exec</CODE>
</DT>
<DD>
executes a given shell command or CGI script. Valid
tags are:
<BR>
<DL>
<DT>
<CODE>cmd</CODE>
</DT>
<DD>
executes the given string using <CODE>/bin/sh</CODE>. All
of the variables defined below are defined, and can be
used in the command.
<BR>
</DD>
<DT>
<CODE>cgi</CODE>
</DT>
<DD>
executes the given virtual path to a CGI script and
includes its output. The server does not perform error
checking on the script output.
<BR>
</DD>
</DL>
</DD>
</DL>
<A NAME="ssi_environment_variables"><!-- Empty --></A><A NAME="4.9.3"><!-- Empty --></A>
<H4>4.9.3 Server-Side Includes (SSI) Environment Variables</H4>
<P>A number of variables are made available to parsed
documents. In addition to the CGI variable set, the following
variables are made available:
<P>
<DL>
<DT>
<CODE>DOCUMENT_NAME</CODE>
</DT>
<DD>
The current filename.
<BR>
</DD>
<DT>
<CODE>DOCUMENT_URI</CODE>
</DT>
<DD>
The virtual path to this document (such as
<CODE>/docs/tutorials/foo.shtml</CODE>).
<BR>
</DD>
<DT>
<CODE>QUERY_STRING_UNESCAPED</CODE>
</DT>
<DD>
The unescaped version of any search query the client
sent, with all shell-special characters escaped with
<CODE>\</CODE>.
<BR>
</DD>
<DT>
<CODE>DATE_LOCAL</CODE>
</DT>
<DD>
The current date, local time zone.
<BR>
</DD>
<DT>
<CODE>DATE_GMT</CODE>
</DT>
<DD>
Same as DATE_LOCAL but in Greenwich mean time.
<BR>
</DD>
<DT>
<CODE>LAST_MODIFIED</CODE>
</DT>
<DD>
The last modification date of the current document.
<BR>
</DD>
</DL>
<A NAME="4.10"><!-- Empty --></A>
<H3>4.10 The Erlang Webserver API</H3>
<P>The process of handling a HTTP request involves several steps
such as:
<P>
<UL>
<LI>
Seting up connections, sending and receiving data.
</LI>
<LI>
URI to filename translation
</LI>
<LI>
Authenication/access cheks.
</LI>
<LI>
Retriving/generating the response.
</LI>
<LI>
Logging
</LI>
</UL>
<P>To provide customization and extensibility of the HTTP servers
request handling most of these steps are handled by one or more
modules that may be replaced or removed at runtime, and ofcourse
new ones can be added. For each request all modules will be
traversed in the order specified by the modules directive in the
server configuration file. Some parts mainly the communication
related steps are considered server core functionallity and are
not implemented using the Erlang Webserver API. A description of
functionality implemented by the Erlang Webserver API is described
in the section Inets Webserver Modules.
<P>A module can use data generated by previous modules in the
Erlang Webserver API module sequence or generate data to be used
by consecutive Erlang Webserver API modules. This is made
possible due to an internal list of key-value tuples, also refered to
as interaction data.
<P>
<TABLE CELLPADDING=4>
<TR>
<TD VALIGN=TOP><IMG ALT="Note!" SRC="note.gif"></TD>
<TD>
<P>Interaction data enforces module dependencies and
should be avoided if possible. This means the order
of modules in the Modules config directive is significant. </TD>
</TR>
</TABLE>
<A NAME="4.10.1"><!-- Empty --></A>
<H4>4.10.1 API Description</H4>
<P>Each module implements server functionality
using the Erlang Webserver API should implement the following
call back functions:
<P>
<UL>
<LI>
do/1 (mandatory) - the function called when
a request should be handled.
</LI>
<LI>
load/2
</LI>
<LI>
store/2
</LI>
<LI>
remove/1
</LI>
</UL>
<P>The latter functions are needed only when new config
directives are to be introduced. For details see
<A HREF="httpd.html"> httpd(3)</A><A NAME="4.11"><!-- Empty --></A>
<H3>4.11 Inets Webserver Modules</H3>
<P> The convention is that all modules implementing some
webserver functionallity has the name mod_*. When
configuring the webserver an appropriate selection of these
modules should be present in the Module directve. Please note that there
are some interaction dependencies to take into account
so the order of the modules can not be totally random.<A NAME="4.11.1"><!-- Empty --></A>
<H4>4.11.1 mod_action - Filetype/Method-Based Script
Execution.</H4>
<P> Runs CGI scripts whenever a file of a
certain type or HTTP method (See RFC 1945) is requested.
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
real_name - from mod_alias
</LI>
</UL>
<P>Exports the following Erlang Webserver API interaction data, if possible:
<P>
<DL>
<DT>
<CODE>{new_request_uri, RequestURI}</CODE>
</DT>
<DD>
An alternative <CODE>RequestURI</CODE> has been generated.
</DD>
</DL>
<A NAME="4.11.2"><!-- Empty --></A>
<H4>4.11.2 mod_alias - URL Aliasing</H4>
<P>This module makes it possible to map different parts of the
host file system into the document tree e.i. creates aliases and
redirections.
<P>Exports the following Erlang Webserver API interaction data, if possible:
<P>
<DL>
<DT>
<CODE>{real_name, PathData}</CODE>
</DT>
<DD>
PathData is the argument used for API function mod_alias:path/3.
</DD>
</DL>
<A NAME="4.11.3"><!-- Empty --></A>
<H4>4.11.3 mod_auth - User Authentication </H4>
<P> This module provides for basic user authentication using
textual files, dets databases as well as mnesia databases.
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
real_name - from mod_alias
</LI>
</UL>
<P>Exports the following Erlang Webserver API interaction data, if possible:
<P>
<DL>
<DT>
<CODE>{remote_user, User}</CODE>
</DT>
<DD>
The user name with which the user has authenticated himself.
</DD>
</DL>
<A NAME="4.11.4"><!-- Empty --></A>
<H4>4.11.4 mod_cgi - CGI Scripts</H4>
<P>This module handles invoking of CGI scripts<A NAME="4.11.5"><!-- Empty --></A>
<H4>4.11.5 mod_dir - Directories</H4>
<P>This module generates an HTML directory listing
(Apache-style) if a client sends a request for a directory
instead of a file. This module needs to be removed from the
Modules config directive if directory listings is unwanted.
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
real_name - from mod_alias
</LI>
</UL>
<P>Exports the following Erlang Webserver API interaction data, if possible:
<P>
<DL>
<DT>
<CODE>{mime_type, MimeType}</CODE>
</DT>
<DD>
The file suffix of the incoming URL mapped into a
<CODE>MimeType</CODE>.
</DD>
</DL>
<A NAME="4.11.6"><!-- Empty --></A>
<H4>4.11.6 mod_disk_log - Logging Using disk_log.</H4>
<P>Standard logging using the "Common Logfile Format" and
disk_log(3).
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
remote_user - from mod_auth
</LI>
</UL>
<A NAME="4.11.7"><!-- Empty --></A>
<H4>4.11.7 mod_esi - Erlang Server Interface</H4>
<P> This module implements
the Erlang Server Interface (ESI) that provides a tight and
efficient interface to the execution of Erlang functions.
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
remote_user - from mod_auth
</LI>
</UL>
<P>Exports the following Erlang Webserver API interaction data, if possible:
<P>
<DL>
<DT>
<CODE>{mime_type, MimeType}</CODE>
</DT>
<DD>
The file suffix of the incoming URL mapped into a
<CODE>MimeType</CODE>
</DD>
</DL>
<A NAME="4.11.8"><!-- Empty --></A>
<H4>4.11.8 mod_get - Regular GET Requests</H4>
<P> This module is responsible for handling GET requests to regular
files. GET requests for parts of files is handled by mod_range.
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
real_name - from mod_alias
</LI>
</UL>
<A NAME="4.11.9"><!-- Empty --></A>
<H4>4.11.9 mod_head - Regular HEAD Requests</H4>
<P> This module is responsible for handling HEAD requests to regular
files. HEAD requests for dynamic content is handled by each module
responsible for dynamic content.
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
real_name - from mod_alias
</LI>
</UL>
<A NAME="4.11.10"><!-- Empty --></A>
<H4>4.11.10 mod_htacess - User Configurable Access</H4>
<P>This module provides per-directory user configurable access
control.
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
real_name - from mod_alias
</LI>
</UL>
<P>Exports the following Erlang Webserver API interaction data, if possible:
<P>
<DL>
<DT>
<CODE>{remote_user_name, User}</CODE>
</DT>
<DD>
The user name with which the user has authenticated himself.
</DD>
</DL>
<A NAME="4.11.11"><!-- Empty --></A>
<H4>4.11.11 mod_include - SSI</H4>
<P>This module makes it possible to expand "macros" embedded in
HTML pages before they are delivered to the client, that is
Server-Side Includes (SSI).
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
real_name - from mod_alias
</LI>
<LI>
remote_user - from mod_auth
</LI>
</UL>
<P>Exports the following Erlang Webserver API interaction data, if possible:
<P>
<DL>
<DT>
<CODE>{mime_type, MimeType}</CODE>
</DT>
<DD>
The file suffix of the incoming URL mapped into a
<CODE>MimeType</CODE> as defined in the Mime Type Settings
section.
</DD>
</DL>
<A NAME="4.11.12"><!-- Empty --></A>
<H4>4.11.12 mod_log - Logging Using Text Files.</H4>
<P> Standard logging using the "Common Logfile Format" and text
files.
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
remote_user - from mod_auth
</LI>
</UL>
<A NAME="4.11.13"><!-- Empty --></A>
<H4>4.11.13 mod_range - Requests with Range Headers</H4>
<P> This module response to requests for one or many ranges of a
file. This is especially useful when downloading large files,
since a broken download may be resumed.
<P>Note that request for multiple parts of a document will report a
size of zero to the log file.
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
real_name - from mod_alias
</LI>
</UL>
<A NAME="4.11.14"><!-- Empty --></A>
<H4>4.11.14 mod_response_control - Requests with If* Headers</H4>
<P>This module controls that the conditions in the requests is
fullfilled. For example a request may specify that the answer
only is of interest if the content is unchanged since last
retrieval. Or if the content is changed the range-request shall
be converted to a request for the whole file instead.
<P> If a client sends more then one of the header fields that
restricts the servers right to respond, the standard does not
specify how this shall be handled. httpd will control each
field in the following order and if one of the fields not match
the current state the request will be rejected with a proper
response.<BR>
1.If-modified<BR>
2.If-Unmodified<BR>
3.If-Match<BR>
4.If-Nomatch<BR>
<P>Uses the following Erlang Webserver API interaction data, if available:
<P>
<UL>
<LI>
real_name - from mod_alias
</LI>
</UL>
<P>Exports the following Erlang Webserver API interaction data, if possible:
<P>
<DL>
<DT>
<CODE>{if_range, send_file}</CODE>
</DT>
<DD>
The conditions for the range request was not fullfilled.
The response must not be treated as a range request, instead it
must be treated as a ordinary get request.
</DD>
</DL>
<A NAME="4.11.15"><!-- Empty --></A>
<H4>4.11.15 mod_security - Security Filter</H4>
<P>This module serves as a filter for authenticated requests
handled in mod_auth. It provides possibility to restrict users
from access for a specified amount of time if they fail to
authenticate several times. It logs failed authentication as
well as blocking of users, and it also calls a configurable
call-back module when the events occur.
<P>There is also an
API to manually block, unblock and list blocked users or users,
who have been authenticated within a configurable amount of
time.
<A NAME="4.11.16"><!-- Empty --></A>
<H4>4.11.16 mod_trace - TRACE Request</H4>
<P>mod_trace is responsible for handling of TRACE requests.
Trace is a new request method in HTTP/1.1. The intended use of
trace requests is for testing. The body of the trace response is
the request message that the responding Web server or proxy
received.<CENTER>
<HR>
<SMALL>
Copyright © 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>
|