入门较系统文档: http://yaws.hyber.org/yaws.pdf
1 列目录!?? yaws-doc-man config file- dir_listings = true | true_nozip | false
部分完整配置 yaws.conf
<server localhost>
port = 8080
listen = 0.0.0.0
docroot = "d:\Program Files\Yaws-1.87/www"
appmods = <cgi-bin, yaws_appmod_cgi>
dir_listings = true
</server>
ebin_dir = "d:\Program Files\Yaws-1.87/examples/ebin"
ebin_dir = "d:\Program Files\Yaws-1.87/www/"
2 系统自带一个购物页面 :8080/shoppingcart/
3 When a client browser wants a protected file, it must send a “Authenticate: username:password” header in the request. Note that this is plain text
.
WWW-Authentication is configured in the yaws.conf file, in as many <auth> directives as you desire:
<server foo>
docroot = /var/yaws/www/
..
..
<auth>
realm = secretpage
dir = /protected
dir = /anotherdir
user = klacke:gazonk
user = jonny:xyz
user = ronny:12r8uyp09jksfdge4
</auth>
</server>
4 页面显示中文: <meta http-equiv=\"Content-Type\" content=\"text/html; charset=GB18030\">
yaws beam文件更新需要重启yaws以清除缓存
3 yaws_api.hrl 几个结构 要好好记一记!
-record(arg, {
clisock, %% the socket leading to the peer client
client_ip_port, %% {ClientIp, ClientPort} tuple
headers
, %% headers
req
, %% request
clidata, %% The client data (as a binary in POST requests)
server_path, %% The normalized server path %% (pre-querystring part of URI)
querydata, %% For URIs of the form ...?querydata %% equiv of cgi QUERY_STRING
appmoddata, %% (deprecated - use pathinfo instead) the remainder %% of the path leading up to the query
docroot, %% Physical base location of data for this request
docroot_mount, %% virtual directory e.g /myapp/ that the docroot %% refers to.
fullpath, %% full deep path to yaws file
cont, %% Continuation for chunked multipart uploads
state, %% State for use by users of the out/1 callback
pid, %% pid of the yaws worker process
opaque, %% useful to pass static data
appmod_prepath, %% (deprecated - use prepath instead) path in front %%of: <appmod><appmoddata>
prepath, %% Path prior to 'dynamic' segment of URI. %% ie http://some.host/<prepath>/<script-point>/d/e %% where <script-point> is an appmod mount point, %% or .yaws,.php,.cgi,.fcgi etc script file.
pathinfo %% Set to '/d/e' when calling c.yaws for the request %% http://some.host/a/b/c.yaws/d/e %% equiv of cgi PATH_INFO
}).
-record(http_request
, {method,
path,
version}).
-record(http_response, {version,
status,
phrase}).
-record(headers
, {
connection,
accept,
host,
if_modified_since,
if_match,
if_none_match,
if_range,
if_unmodified_since,
range,
referer,
user_agent,
accept_ranges,
cookie = [],
keep_alive,
location,
content_length,
content_type,
content_encoding,
authorization,
transfer_encoding,
other = [] %% misc other headers
}).
-record(url,
{scheme, %% undefined means not set
host, %% undefined means not set
port, %% undefined means not set
path = [],
querypart = []}).
-record(setcookie,{
key,
value,
quoted,
comment,
comment_url,
discard,
domain,
max_age,
expires,
path,
port,
secure,
version}).
-record(redir_self, {
host, %% string() - our own host
scheme, %% http | https
scheme_str, %% "https://" | "http://"
port, %% integer() - our own port
port_str %% "" | ":<int>" - the optional port part
%% to append to the url
}).
分享到:
相关推荐
yaws是一款采用erlang开发的web server,具有高并发的特点,这是yaws的官方文档。
这是Yaws,是用Erlang编写的动态内容的Web服务器。 准备构建 获取并安装一个Erlang系统( )。 要编译Yaws,需要Erlang / OTP 18.0或更高版本。 如果您已经从github克隆了源代码,并且想使用自动工具进行构建,请...
使用Erlang和Yaws开发REST式的服务.详细分析如何使用Erlang和yaws开发REST的服务,有实例
yaws-json2 yaws-json2 是来自网络服务器的编码器/解码器。安装在 rebar.config 中: { yaws_json2 , " .* " , { git , " git://github.com/myua/yaws-json2 " , { tag , " master " }}}用法使用yaws_json2:decode_...
yaws(Yet Another Web Scraper)是一种易于使用但功能强大的Node.js Web抓取工具,它支持多种常用的抓取技术,通过使用带有正则表达式的模式,通过导航DOM(JQuery样式)来定义对象。 它是一个进行中的工作,包括...
Yaws 是一个小巧、快速且美观的 HTTP 1.1 网络服务器,对生成动态内容提供出色的支持。 Yaws 已移至 github。 http://github.com/klacke/yaws/
基于erlang开发web应用,涉及restful、websocket、yaws
使用Erlang开发web应用,书中范例所使用的webserver为Yaws
webserver:Yaws, 一个Erlang开发的web服务器. 开发语言:Erlang,Html(html,javascript,css) ###如何部署: 1.下载并安装Erlang. 2.安装完成后,把bin/erl.exe添加入环境变量 3.下载并安装yaws。 4.安装完成后,把/...
erlang调用java,在yaws应用里调用J2EE方法
该应用程序是用Erlang编写的,并且使用Yaws作为Web服务器。 在webui中,可以执行以下操作 注册新凭证 正确的错误凭证 生成可存档的报告 余额报告 结果报告 杂志 分类帐 结果与预算之间的差异 生成一个大的组合报告...
Erlang不但是一种编程语言,而且它具有比编程语言更加贴近操作系统的一些特性:并发线程、作业调度、内存管理、分布式、网络化等。据说使用Erlang编写的Yaws Web服务器,其并发性能是apache的15倍!
-embjson([{callback, embjson_yaws_json2}, {function, '@json'}]). 可选属性embjson配置解析转换: callback :回调模块的名称(默认为转换模块)。 模块必须实现embjson行为。 function :封装嵌入式 JSON 的...
try.lfe.io介绍该项目目前正在积极开发中。 有关更多信息,请参见 。... 然后照常做: $ rebar get-deps $ rebar compile用法在开发环境中,只需运行dev目标: $ make dev 这将启动YAWS,您将能够在上查看该网站。
擦洗-最适合SOAP 一个Erlang SOAP 1.2客户端描述这是Yaws的yaws_soap12_lib到单独的Erlang模块的转换。 见 与洗涤剂类似,但适用于SOAP 1.2。 参见
[奥莱理] Building Web Applications with Erlang Working with REST and Web Sockets on Yaws (E-Book) ☆ 出版信息:☆ [作者信息] Zachary Kessin [出版机构] 奥莱理 [出版日期] 2012年06月14日 [图书页数] ...
它目前支持Cowboy,Inet,Mochiweb,Webmachine和Yaws。 SimpleBridge用作两个最受欢迎的Erlang Web框架到Web服务器的桥梁: 和 从某种意义上讲,它类似于 ,除了具有一些关键的改进/不同之处: 轻松扩展-需要...