Permalink
Browse files

""

git-svn-id: https://erlyaws.svn.sourceforge.net/svnroot/erlyaws/trunk/yaws@63 9fbdc01b-0d2c-0410-bfb7-fb27d70d8b52
  • Loading branch information...
1 parent 2129adc commit e16ea1b99ffb0fb9978cdce5dceb19e949679fa8 @klacke committed May 30, 2002
Showing with 127 additions and 16 deletions.
  1. +1 −1 ebin/yaws.app
  2. +9 −6 src/yaws_server.erl
  3. +1 −1 vsn.mk
  4. +101 −7 www/configuration.yaws
  5. +3 −0 www/history.yaws
  6. +12 −0 www/index.yaws
  7. +0 −1 www/todo.yaws
View
@@ -1,6 +1,6 @@
{application,yaws,
[{description,"yaws WWW server"},
- {vsn,"0.34"},
+ {vsn,"0.40"},
{modules,[yaws, yaws_app, yaws_config, yaws_server, yaws_sup, yaws_api, yaws_log, yaws_ls, yaws_debug, yaws_compile, yaws_ctl, yaws_ssl]},
{registered, []},
{mod,{yaws_app,[]}},
View
@@ -1044,23 +1044,26 @@ deliver_dyn_file(CliSock, GC, SC, _Req, _Head,_UT,DC, _Bin, _Fd, [], _ARG) ->
skip_data(List, Fd, Sz) when list(List) ->
skip_data(list_to_binary(List), Fd, Sz);
skip_data(Bin, Fd, Sz) when binary(Bin) ->
- ?Debug("Skip data ~p bytes ", [Sz]),
+ ?Debug("Skip data ~p bytes from", [Sz]),
case Bin of
<<Head:Sz/binary ,Tail/binary>> ->
{Head, Tail};
_ ->
- case file:read(Fd, 4000) of
- {ok, Bin2} ->
+ case (catch file:read(Fd, 4000)) of
+ {ok, Bin2} when binary(Bin2) ->
Bin3 = <<Bin/binary, Bin2/binary>>,
skip_data(Bin3, Fd, Sz);
_Err ->
- ?Debug("EXIT in skip_data: ~p ~p~n", [Bin, Sz]),
+ ?Debug("EXIT in skip_data: ~p ~p ~p~n", [Bin, Sz, _Err]),
exit(normal)
end
end;
skip_data({bin, Bin}, _, Sz) ->
+ ?Debug("Skip bin data ~p bytes ", [Sz]),
<<Head:Sz/binary ,Tail/binary>> = Bin,
- {Head, {bin, Tail}}.
+ {Head, {bin, Tail}};
+skip_data({ok, X}, Fd, Sz) ->
+ skip_data(X, Fd, Sz).
@@ -1162,7 +1165,7 @@ do_tcp_close(Sock, SC) ->
ut_open(UT) ->
case UT#urltype.data of
undefined ->
- {ok, Fd} = file:open(UT#urltype.fullpath, [read, raw]),
+ {ok, Fd} = file:open(UT#urltype.fullpath, [read, raw, binary]),
Fd;
B when binary(B) ->
{bin, B}
View
@@ -1 +1 @@
-YAWS_VSN=0.34
+YAWS_VSN=0.40
View
@@ -33,7 +33,7 @@ The above commands will
checkout the bleeding edge source, build it and install it at
127.0.0.1:80 with the docroot set to the local documentation.
-<p>Just <tt>make</tt> (withou install)
+<p>Just <tt>make</tt> (without install)
will build the yaws system and do a local
install at http://127.0.0.1:8000. This is the typical mode of operation
while either just trying out yaws, or hacking yaws. This will install
@@ -59,23 +59,46 @@ include.mk file in the the toplevel directory.
erlang system and instructs it to start yaws.
<p>The following command line flags are availiable:
<ul>
+
<li> <tt>-d </tt> <br>
Debug mode.
+
<li> <tt>-i </tt> <br>
Interactive mode, this starts the yaws webserver with an erlang
shell. If this flag is not given, yaws will run as a daemon.
+
<li> <tt>-c File </tt><br>
Use an explicit yaws.conf file
+
<li> <tt>-t </tt><br>
Trace mode, write a trace of all traffic to a file called 'trace'
in the log directory.
-</ul>
-<h3>HUP the server </h3>
- <p> NYI
+<li> <tt>-T </tt><br>
+Trace mode, write a trace of all http traffic to a file called 'trace'
+in the log directory.
+
+
+<li> <tt>-D </tt><br>
+Daemon mode.
+
+
+<li> <tt>-h </tt><br>
+HUP the daemon, make it read a new config file and clear its
+internal content caches. When updating the content on the site
+it's always a good idea to HUP the yaws daemon.
+
+
+
+<li> <tt>-s </tt><br>
+Stop the daaemon.
+
+</ul>
+
+
<H2>Configuring Yaws</h2>
Web server configuration can be supplied to yaws
@@ -107,6 +130,8 @@ embedded application inside another Erlang program.
parts for each virtual host that is defined. A very simple
example config could look like:
+
+
<erl>
out(A) -> yaws_api:pre_ssi_string("
@@ -195,8 +220,6 @@ Let the server listen to port number PortNum
Let the server listen to the address IpAddr.
<li> <tt> docroot = Directory </tt> <br>
Let the server serv its content from the directory Dir.
-<li> <tt>ssl = true | false </tt><br>
-NYI
<li> <tt> default_server_on_this_ip = true|false </tt>
When virthosting more than one server on the same IP address, we must
indicate to the yaws server which one of the virtual servers is the default
@@ -231,10 +254,81 @@ out(A) -> yaws_api:pre_ssi_string("
</erl>
+<h3> SSL </h3>
+
+Yaws has full SSL support. When we are running SSL it is not
+possible to combine that with virtual hosting on the same IP address.
+The reason for that is ofcource that the webserver needs to choose
+a certificate before it reads the Host: header.
+
+<p>The following config options are possible for an SSL server.
+<p>
+<ul>
+<li> <tt> ssl = true | false </tt>
+Turns on SSL processing for a server
+
+
+<li> <tt> ssl_keyfile = File </tt>
+Specifies which file contains the private key for the certificate.
+
+<li> <tt> ssl_certfile = CertFile </tt>
+Specifies which file contains the certificate for the server.
+
+<li> <tt> ssl_caceretfile = CaCertFile </tt>
+If the server is setup to require client certificates. This file needs to
+contain all the certificates of the acceptable signers for the client certs.
+
+
+<li> <tt> ssl_verify = [1 | 2 | 3]</tt>
+Specifies the level of verification the server does on clinet certs.
+1 means nothing, 2 means the the server will ask the client for
+a cert but not fail if the client doesn't supply a client cert, 3 means that
+the server requires the client to supply a client cert.
+
+
+<li> <tt> ssl_depth = Int </tt>
+Specifies the depth of certificate chains the server is prepared to
+follow when verifying client certs.
+
+
+<li> <tt> ssl_password = String </tt>
+If the private key is encrypted on disc, this password is the 3des key
+to decrypt it.
+
+<li> <tt> ssl_ciphers = String </tt>
+This string specifies the ssl cipher string. The syntax of the ssl cipher
+string is a littele horrible sublanguage of its own.
+It is documented in the ssl man page for "ciphers".
+
+
+</ul>
+
+<p> In the yaws distribution, an example (self generated) certificate
+and key is included in the $YAWSSRC/ssl directory.
+
+<p>Extending one of the example from above for SSL usage, it could look
+like:
+
+
+<erl>
+out(A) -> yaws_api:pre_ssi_string("
+<server www.mydomain.org>
+ port = 443
+ listen = 201.6.7.8
+ docroot = /var/yaws/www
+ ssl = true
+ ssl_keyfile = /etc/yaws.key
+ ssl_certfile = /etc/yaws.cert
+</server>
+
+").
+
+</erl>
+
<h3>Embedded mode</h3>
-NYI
+Not documented.
<erl>
View
@@ -11,6 +11,9 @@ out(A) ->
<table border="2">
+
+<tr><td> May 26, added SSL support 0.40 </td> </tr>
+
<tr><td> Mar 29, fixed a bug in the log wrapping which restarted the server</td></tr>
<tr><td> Mar 26, released 0.32 </tr>
<tr> <td> Mar 26, 2002. Fixed a bug where chunked encodings were
View
@@ -48,6 +48,18 @@ of cource, <a href="http://yaws.hyber.org">yaws.hyber.org</a> is itself
powered by Yaws.
+<p> <h2> News </h2>
+
+<div class="box">
+
+<ul>
+<li> Version 0.40 released. Contains bugfixes and full SSL support
+as well as an embryo to WWW-Authenticate support.
+</ul>
+
+</div>
+
+
<erl>
out(A) -> yaws_api:ssi(A#arg.docroot, ["/END"]).
View
@@ -11,7 +11,6 @@ out(A) ->
<ul>
-<li> ssl
<li> handle the If-..... headers
<li> generate Etag for static content
<li> handle Range header

0 comments on commit e16ea1b

Please sign in to comment.