r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

onetom
2-May-2011
[10135x3]
im writing a json webservice and actually it's very annoying when 
i get a RSP error html page, instead of the usual rebol error.
what do u mean by production condition, btw? there is nothing in 
production yet
i have a global debug option just as a per-vhost one and im starting 
cheyenne w -vvv beside -w 1
Dockimbel
2-May-2011
[10138x2]
Production mode: using the binary version as a daemon, instead of 
using the source version from a REBOL console.
im writing a json webservice and actually it's very annoying when 
i get a RSP error html page, instead of the usual rebol error.
 


debug/off should fix that: http://cheyenne-server.org/docs/rsp-api.html#def-65
onetom
2-May-2011
[10140x2]
because - normally - i shouldn't care about the webserver. that would 
be one of the great things about cheyenne. it's just a 1-file-webserver
(meanwhile i see there should be 1 vhost definition at least, so 
that's why the conf-parser fails; the error at: ! still doesn't make 
sense though :)
anyway, i keep on debugging)
Dockimbel
2-May-2011
[10142]
I don't care about Cheyenne while coding RSP scripts or webapps, 
*but*, I always launch it in source mode (and never as a binary) 
on my local development box. That way, when something odd happens, 
I just have a look at the REBOL console and scroll up until I see 
what happened (so I never need to look at any %chey-pid* or %crash.log 
during development).
onetom
2-May-2011
[10143]
aha. and we can't start the binary in a similar mode, where the errors 
are not caught and logged, but showed in the console instead? (im 
trying to do a do %cheyenne.r now)
Dockimbel
2-May-2011
[10144]
The Cheyenne binary version is meant for production, so all things 
are logged in files. If you want to have them in a REBOL console 
from the binary, you need to build a custom binary and change the 
encap options in the %cheyenne.r header. Removing the 'no-window 
option will redirect all logs (except %trace.log) to a REBOL console.
onetom
2-May-2011
[10145]
hm.. is this no-window thing documented?
Dockimbel
2-May-2011
[10146x2]
BTW, if you launch Cheyenne from REBOL console, you can still pass 
it command line options, my local Cheyenne is launched using:

rebol -s cheyenne.r -vvv -w 0
No-window: yes, it's part of REBOL/SDK documentation.
onetom
2-May-2011
[10148x2]
i was trying:

onetom ~/p/ob $ rebol -qs --do 'do/args %~/rebol/cheyenne/Cheyenne/cheyenne.r 
"-w 1 -vvv"'
is this no-window option equivalent to the -w option?
Dockimbel
2-May-2011
[10150x2]
IIRC, yes it is.
-w as REBOL option (to not confuse with Cheyenne's -w option).
onetom
2-May-2011
[10152]
sure
Dockimbel
2-May-2011
[10153]
Here is the SDK documentation about encap headers: http://www.rebol.com/docs/sdk/encap.html#section-8
onetom
2-May-2011
[10154x2]
which means im not supposed to hack cheyenne (easily) unless i buy 
the SDK and learn encap?

because in turn that's what it means not to include this specific 
"trick" into cheyenne's documentation
and since im running it with the plain rebol/core, i wouldn't have 
thought that encap header might be relevant
Dockimbel
2-May-2011
[10156x2]
You can hack Cheyenne as much as you want. The SDK is only required 
if you want to build a binary version of Cheyenne, which is not mandatory 
for using Cheyenne, even in production.
The encap header is only revelant if you build a binary, it is ignored 
if run from sources.
onetom
2-May-2011
[10158]
aahha... i was using the -w as usual, that's why i didn't see any 
output when i was starting cheyenne from source.

normally i use -w, otherwise pipeing the output doesn't work properly.
okay, everything makes more sense now.
Dockimbel
2-May-2011
[10159]
Good. :-)
Kaj
2-May-2011
[10160]
The binary is mandatory for using Library
GrahamC
2-May-2011
[10161]
command/core has library
Kaj
2-May-2011
[10162]
Most people don't have Command/Core
Maxim
2-May-2011
[10163x2]
nowadays, I think command is only available via the sdk, no?
should the hosts be configured via IP addresses?   it seems php has 
issues using localhost as a domain name.
onetom
2-May-2011
[10165]
## Error in [conf-parser] : Error in conf file at: !

was caused by writing a debug word outside of a vhost definition...
Maxim
2-May-2011
[10166]
should = "should it be possible to configure host via IP addresses" 
?
onetom
2-May-2011
[10167]
u mean vhost? the docs says it is possible. but u can't listen on 
a specific address only -- it's a rebol limitation
Maxim
2-May-2011
[10168]
yeah, but it seems php prefers using 127.0.0.1 instead of localhost, 
but my client is reporting cheyenne errors (I haven't tested it yet)... 
just want to know if its possible first.
Dockimbel
2-May-2011
[10169x2]
Declaring a vhost using an IP address: yes and it is documented in 
the wiki.
onetom: thanks for reporting the cause, I will test that locally 
and see if I can improve the error message for such cases.
onetom
2-May-2011
[10171]
doc: it's not a big problem. red is a higher priority :)
Dockimbel
2-May-2011
[10172]
Sure, but I can multiplex with small Cheyenne fixes as long as it 
doesn't take me too much time.
Maxim
2-May-2011
[10173]
thx
onetom
2-May-2011
[10174x3]
hmm... cheyenne binary and the source works differently w the same 
configfile.
$ cheyenne --version
0.9.20.129
WORKS
latest source doesn't work with the following config:

modules [ internal extapp static action rsp alias ]
globals [ listen [8080]    bind RSP to [ .r ] ]
guan-huat [ debug root-dir %./ alias "/docs" %jsondb/to-json.r ]

im testing w $ curl http://guan-huat:8080/docs/test/1
bind-extern makes no difference
oh, the problem is im getting a 404 if i run the source version of 
cheyenne
Dockimbel
2-May-2011
[10177x3]
Are you using sources v0.9.20.129 too?
Hmm, shouldn't make much differences between revision 129 and latest 
135...
You should search in the Cheyenne console logs for "[HTTPd] Translated 
file:" to see what file Cheyenne is trying to read. That should give 
you a clue about what is causing the difference.
onetom
2-May-2011
[10180x5]
no, v0.9.20.129 is binary
Translated file: %./jsondb/to-json.r
in case of the source version; so there is no differnece there.
http://piratepad.net/KkvkZ9AtME
i put the correct and the incorrect logs here
i pasted the command lines too
it works if i copy over my stuff into cheyenne's dir and start cheyenne.r 
from there