Michael Potter | 2 Oct 2008 09:58
Picon

trouble starting yaws

Hi

I am trying to run Yaws under Solaris 10, but getting the following error:
$ yaws -i
Erlang (BEAM) emulator version 5.6.4 [source] [smp:24] [async-threads:0] [kernel-poll:false]

Eshell V5.6.4  (abort with ^G)
1>
=ERROR REPORT==== 2-Oct-2008::17:55:24 ===
FATAL {'EXIT',{{case_clause,1},
               [{yaws,load_setuid_drv,0},
                {yaws,getuid,0},
                {yaws_config,paths,0},
                {yaws_config,load,1},
                {yaws_server,init,1},
                {gen_server,init_it,6},
                {proc_lib,init_p,5}]}}

=INFO REPORT==== 2-Oct-2008::17:55:24 ===
    application: yaws
    exited: {shutdown,{yaws_app,start,[normal,[]]}}
    type: permanent
{"Kernel pid terminated",application_controller,"{application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}}"}

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) ({application_start_failure,yaws,{shutdown,{yaws_app,start,[normal,[]]}}})

Can anyone explain what is going wrong?

Cheers

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@...
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Claes Wikström | 2 Oct 2008 12:36
Favicon

Re: trouble starting yaws

Michael Potter wrote:
> Hi
> 
> I am trying to run Yaws under Solaris 10, but getting the following error:
> $ yaws -i

It mean that there is something wrong with the build of yaws.
The linkedin driver setuid_drv.so wasn't properly
built.

Do, an ls -lR in the yaws priv_dir, can you see the setuid_drv.so
file.

If it is there, next step is to modify yaws:load_setuid_drv()
and check what fails with an io;format.
It it's not there, next step is to check the build of yaws.

/klacke

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Michael Potter | 17 Oct 2008 13:25
Picon

yaws persistent ODBC

G'day

I am investigating alternatives for a application-server to handle lightweight requests with a very high degree of concurrency. Thing like redundancy and automatic fail-over would also be nice - this server will be interacting with a mission critical operation system.

The requests themselves are simple HTTP requests (XML would introduce unacceptable overhead), which will initiate an SQL query and return the result. The expected data source will be Teradata, accessible across the network through an ODBC bridge. I will consider a local database if the additional latency of the network between the server and RDBMS is too great. However, reliability and high concurrency are more pressing concerns that latency.

Due to my requirements, I have identified Yaws as a strong candidate for such a server. I have even managed to get it working under Solaris 10 (thanks klacke!), and talking over ODBC. One concern I do have however, is the ability of Yaws to maintain a persistant database connection across requests - establishing a new connection is probably not desireable given the high number of concurrent requests that could be made. It would be nice for new requests to be able to reuse the database connection - even if this means pooling or queuing queries.

Has anyone faced a similar problem that would care to share there experiances about? Any advice/feedback/comments on whether Yaws is an appropriate tool for the task, and if so the best approach to utilizing would be most appreciated =)

Cheers
Mick


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@...
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Claes Wikström | 20 Oct 2008 12:31
Favicon

Re: yaws persistent ODBC

Michael Potter wrote:

> One concern I do have however, 
> is the ability of Yaws to maintain a persistant database connection 
> across requests - establishing a new connection is probably not 
> desireable given the high number of concurrent requests that could be 
> made. It would be nice for new requests to be able to reuse the database 
> connection - even if this means pooling or queuing queries.
> 

pooling/queueing are both good techniques, especially in
combination.

You need additional application specific processes outside
of the yaws created processes to maintain these pools.
Straightforward. Start these (registered) processes before
yaws is started (or through the --runmod flag)

Possibly use cookies to map clients sockets to DB
sessions - depending on the client situation.

/klacke

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Dominique Boucher | 20 Oct 2008 17:12
Gravatar

Content-Disposition header support

Hi,

 

When downloading a large (static) document from a Yaws-powered web site with IE, the download progress bar is not displayed when the file is opened instead of just  saved. This is quite annoying. The problem seems to be that the “Content-Disposition” header is missing from the HTTP response (I made a quick and dirty hack to yaws_server.erl to confirm this).

 

What would be the preferred way to add this header automatically (other than patch Yaws itself)?  

 

Thanks in advance,

 

Dominique Boucher

Lead Software Developer

http://www.nuecho.com | http://blog.nuecho.com

 

Linked-In : http://www.linkedin.com/in/dominiqueboucher

Twitter: http://twitter.com/dboucher

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@...
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Steve Vinoski | 20 Oct 2008 18:04
Picon
Gravatar

Re: Content-Disposition header support

On 10/20/08, Dominique Boucher <dominique.boucher@...> wrote:
>
> When downloading a large (static) document from a Yaws-powered web site with
> IE, the download progress bar is not displayed when the file is opened
> instead of just  saved. This is quite annoying. The problem seems to be that
> the "Content-Disposition" header is missing from the HTTP response (I made a
> quick and dirty hack to yaws_server.erl to confirm this).
>
>
>
> What would be the preferred way to add this header automatically (other than
> patch Yaws itself)?

That depends on what's serving the file. If you're delivering the
response out of any out/1 function, you can set any header you want by
including this in your response:

{header, {"Header_name", "Header_value"}}

of course replacing Header_name and Header_value with appropriate
actual string values.

I've been making some header-related changes in Yaws svn lately, so
I'll take a look at this header and talk it over with Klacke to see if
and how we might add support for it.

--steve

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Dominique Boucher | 20 Oct 2008 18:26
Gravatar

Re: Content-Disposition header support

> > What would be the preferred way to add this header automatically
> (other than
> > patch Yaws itself)?
> 
> That depends on what's serving the file. If you're delivering the
> response out of any out/1 function, you can set any header you want by
> including this in your response:
> 
> {header, {"Header_name", "Header_value"}}
> 
> of course replacing Header_name and Header_value with appropriate
> actual string values.

I'm not serving the file myself, I let Yaws do that for me. That's why I
thought this should be done automatically by Yaws.

> I've been making some header-related changes in Yaws svn lately, so
> I'll take a look at this header and talk it over with Klacke to see if
> and how we might add support for it.

Great, thanks.

Dominique

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Claes Wikstrom | 20 Oct 2008 21:42
Favicon

Re: Content-Disposition header support

Dominique Boucher wrote:
>>> What would be the preferred way to add this header automatically
>> (other than
>>> patch Yaws itself)?

Patching yaws does seem to be the right answer, so for all file
types that are not rendered by the browser it seems to make sense
to just set this header.

I didn't even know it existed prior to this. Do all browsers play
well with this ? Do you know ?

It's easy to add. Again, instead of just checking for myself, I'm asking
if you know. What do other http servers e.g. apache do here ?

/klacke

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Dominique Boucher | 20 Oct 2008 22:22
Gravatar

Re: Content-Disposition header support


> Dominique Boucher wrote:
> >>> What would be the preferred way to add this header automatically
> >> (other than
> >>> patch Yaws itself)?
> 
> Patching yaws does seem to be the right answer, so for all file
> types that are not rendered by the browser it seems to make sense
> to just set this header.
> 
> I didn't even know it existed prior to this. Do all browsers play
> well with this ? Do you know ?

The browsers I usually use do not complain (Firefox, Google Chrome). But the
header is only a hint to the browser. It may ignore it. (That's my
understanding.)

> It's easy to add. Again, instead of just checking for myself, I'm
> asking
> if you know. What do other http servers e.g. apache do here ?

I think you have to manually tell the http server to add the header. This is
not done by default. With Apache, you use the <Files> or <FilesMatch>
directives to do that (that's what I read while googling around).

Dominique

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Picon
Favicon

JSON formatted data

Hi all,

I'm trying to return JSON data from Yaws.

But I got an error when I parse the result with Javascript on the client browser side.

For example :

The string to return is : <<"t\"est">>

The json encoding process : json:encode({struct,[{variable,<<"t\"est">>}]})

After json encoding we have : 

<<"{\"variable\":\"t\\\"est\"}">>

Note the "triple" \ to respect the json format

The yaws page :

<erl> 
	out(Arg) -> 
		{html, json:encode({struct,[{variable,<<"t\"est">>}]})}.
</erl>

Finally I received on the client side this string :

{"variable":"t\"est"}

This format do not respect the JSON standard.

How could I handle this case ? 

Thank you for your help.

wde

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane