~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/inets/doc/src/http_server.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2010-03-09 17:34:57 UTC
  • mfrom: (10.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100309173457-4yd6hlcb2osfhx31
Tags: 1:13.b.4-dfsg-3
Manpages in section 1 are needed even if only arch-dependent packages are
built. So, re-enabled them.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
<chapter>
5
5
  <header>
6
6
    <copyright>
7
 
      <year>2004</year><year>2009</year>
 
7
      <year>2004</year><year>2010</year>
8
8
      <holder>Ericsson AB. All Rights Reserved.</holder>
9
9
    </copyright>
10
10
    <legalnotice>
13
13
      compliance with the License. You should have received a copy of the
14
14
      Erlang Public License along with this software. If not, it can be
15
15
      retrieved online at http://www.erlang.org/.
16
 
    
 
16
 
17
17
      Software distributed under the License is distributed on an "AS IS"
18
18
      basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
19
19
      the License for the specific language governing rights and limitations
20
20
      under the License.
21
 
    
 
21
 
22
22
    </legalnotice>
23
23
 
24
24
    <title>HTTP server </title>
82
82
 
83
83
    <p>The server is configured using an erlang property list.
84
84
      For the available properties see
85
 
      <seealso marker="inets:inets">httpd(3)</seealso>
 
85
      <seealso marker="httpd">httpd(3)</seealso>
86
86
      For backwards compatibility also apache-like config files
87
87
      are supported.
88
88
    </p>
246
246
              every row contains the name of the group and the members
247
247
              of the group separated by a space, for example:</p>
248
248
            <pre>
249
 
\011    GroupName: Member1 Member2 .... MemberN
 
249
GroupName: Member1 Member2 .... MemberN
250
250
            </pre>
251
251
          </item>
252
252
          <item>
278
278
              and every row contains User Name and Password separated by a
279
279
              colon, for example:</p>
280
280
            <pre>
281
 
\011    UserName:Password
282
 
\011    UserName:Password
 
281
UserName:Password
 
282
UserName:Password
283
283
            </pre>
284
284
          </item>
285
285
          <item>
299
299
              the specified methods. If no request method is specified
300
300
              all request methods are verified against the restrictions.</p>
301
301
            <pre>
302
 
\011    &lt;Limit POST GET HEAD&gt;
303
 
\011    order allow deny
304
 
\011    require group group1
305
 
\011    allow from 123.145.244.5
306
 
\011    &lt;/Limit&gt;
 
302
&lt;Limit POST GET HEAD&gt;
 
303
  order allow deny
 
304
  require group group1
 
305
  allow from 123.145.244.5
 
306
&lt;/Limit&gt;
307
307
            </pre>
308
308
          </item>
309
309
          <item>
363
363
          message-body, separated by a blank line.  The message-header
364
364
          contains one or more header fields. The body may be
365
365
          empty. Example: </p>
366
 
        <code type="none">
367
 
"Content-Type:text/plain\
368
 
Accept-Ranges:none\
369
 
\
370
 
some very
371
 
\011plain text"         </code>
 
366
      
 
367
      <code>"Content-Type:text/plain\nAccept-Ranges:none\n\nsome very
 
368
        plain text" </code>
 
369
      
372
370
        <p>The server will interpret the cgi-headers and most of them
373
371
          will be transformed into HTTP headers and sent back to the
374
372
          client together with the body.</p>
387
385
            the extra overhead. An URL which calls an Erlang erl function
388
386
            has the following syntax (regular expression): </p>
389
387
          <code type="none">
390
 
\011  http://your.server.org/***/Module[:/]Function(?QueryString|/PathInfo)
 
388
http://your.server.org/***/Module[:/]Function(?QueryString|/PathInfo)
391
389
          </code>
392
390
          <p>*** above depends on how the ErlScriptAlias config
393
391
            directive has been used</p>
428
426
http://your.server.org/eval?httpd_example:print(atom_to_list(apply(erlang,halt,[])))
429
427
            </code>
430
428
            <p>which effectively will close down the Erlang node,
431
 
              that is use the erl scheme instead, until this
 
429
              therefor, use the erl scheme instead, until this
432
430
              security breach has been fixed.</p>
433
431
            <p>Today there are no good way of solving this problem
434
432
              and therefore Eval Scheme may be removed in future
498
496
          for parsed files, for example:
499
497
          </p>
500
498
        <pre>
501
 
\011text/x-server-parsed-html shtml shtm
 
499
        text/x-server-parsed-html shtml shtm
502
500
        </pre>
503
501
        <p>This makes files ending with <c>.shtml</c> and <c>.shtm</c>
504
502
          into parsed files. Alternatively, if the performance hit is not a
505
503
          problem, <em>all</em> HTML pages can be marked as parsed:
506
504
          </p>
507
505
        <pre>
508
 
\011text/x-server-parsed-html html htm
 
506
        text/x-server-parsed-html html htm
509
507
        </pre>
510
508
      </section>
511
509
 
518
516
          unparsed. Each directive has the following format:
519
517
          </p>
520
518
        <pre>
521
 
\011&lt;!--#command tag1="value1" tag2="value2" --&gt;
 
519
        &lt;!--#command tag1="value1" tag2="value2" --&gt;
522
520
        </pre>
523
521
        <p>Each command takes different arguments, most only accept one
524
522
          tag at a time. Here is a breakdown of the commands and their
612
610
          <item>
613
611
            <p>The unescaped version of any search query the client
614
612
              sent, with all shell-special characters escaped with
615
 
              <c>\\</c>.</p>
 
613
              <c>\</c>.</p>
616
614
          </item>
617
615
          <tag><c>DATE_LOCAL</c></tag>
618
616
          <item>
753
751
          schema and the tables already is created. </p>
754
752
        
755
753
        <code>
756
 
          -module(mnesia_test).
757
 
          -export([start/0,load_data/0]).
758
 
          -include("mod_auth.hrl").   
759
 
          
760
 
          first_start()->
761
 
          mnesia:create_schema([node()]),
762
 
          mnesia:start(),
763
 
          mnesia:create_table(httpd_user,
764
 
          [{type,bag},{disc_copies,[node()]},
765
 
          {attributes,record_info(fields,httpd_user)}]),
766
 
          mnesia:create_table(httpd_group,
767
 
                             [{type,bag},{disc_copies,[node()]},          
768
 
          {attributes,record_info(fields,httpd_group)}]),
769
 
          mnesia:wait_for_tables([httpd_user,httpd_group],60000).
770
 
          
771
 
          start()->
772
 
          mnesia:start(),
773
 
          mnesia:wait_for_tables([httpd_user,httpd_group],60000).                 
 
754
-module(mnesia_test).
 
755
-export([start/0,load_data/0]).
 
756
-include("mod_auth.hrl").   
 
757
 
 
758
first_start() ->
 
759
    mnesia:create_schema([node()]),
 
760
    mnesia:start(),
 
761
    mnesia:create_table(httpd_user,
 
762
                        [{type, bag},
 
763
                         {disc_copies, [node()]},
 
764
                         {attributes, record_info(fields, 
 
765
                                                  httpd_user)}]),
 
766
    mnesia:create_table(httpd_group,
 
767
                        [{type, bag},
 
768
                         {disc_copies, [node()]},          
 
769
                         {attributes, record_info(fields, 
 
770
                                                  httpd_group)}]),
 
771
    mnesia:wait_for_tables([httpd_user, httpd_group], 60000).
 
772
 
 
773
start() ->
 
774
    mnesia:start(),
 
775
    mnesia:wait_for_tables([httpd_user, httpd_group], 60000).                 
774
776
        </code>
775
777
        
776
778
        <p>To create the Mnesia tables we use two records defined in