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

World: r3wp

[CGI] web server issues

james_nak
11-Aug-2006
[517]
Janeks,. I think httpd.conf in in the 'confs' dir. I don't think 
that a normal host allows you access to that though.
Pekr
11-Aug-2006
[518]
surely not ...
james_nak
11-Aug-2006
[519x2]
Janeks,  here are some things to try:

1. Make sure you uploaded the rebol exe as binary and the rebol script 
as ascii.

2. make sure you chmod your rebol files, rebol and even the cgi-bin 
(755).

Hope that helps. I have seen the same thing as you many times when 
I first set up rebol.
BTW, if i makes you feel any better, I tested your script in my host 
and it works. I'm wondering if the "#!/var/www/cgi-bin/rebol -cs" 
is not actually pointing to the where it should be. Did the hosting 
company give you the exact path?
Janeks
11-Aug-2006
[521x2]
Thanks all - as always most obvious things are those on which we 
make mistakes.

All was o' k except I changed rebol to rebcore, because I wanted 
also work with Rebol view and ...
... forgot it.
Too much copy & paste.


Well the next question is - if and what else is needed to install 
rebol view for cgi operations?
It even works with .r extension.
Pekr
11-Aug-2006
[523x4]
nothing, but it might eventually not work ...
it all depends, if such machine has X-Windows installed, or not. 
Mine has not IIRC ....
not sure what dependencies are there ..... there might be some library 
missing, as happened with my Command due to AGG
you can check by issuing: ldd your-rebol-view.exe
james_nak
11-Aug-2006
[527]
Janeks,  I suppose it depends on what you want View to do. You can 
go ahead and put it in your cgi bin but It won't create interactive 
interfaces as you can when you run it locally. You can try the plugin 
for that kind of thing.
Janeks
12-Aug-2006
[528x2]
What I want is just do some image conversation and to make some human 
control (small image with string on some patern background ...)
I uploaded view but it it does not work - I just see error 500, but 
i think rview is the reason , because I changed in working script 
just first line that points to rebol executable.

Its a pitty - I wanted to add some funcionality above to my home 
page.

Q: Is it possible to add required libs? F.ex. just in the same dir.
Pekr
13-Aug-2006
[530]
not sure where/how view looks for such library ...
Sunanda
13-Aug-2006
[531]
Running View as a CGI can be a problem.
I don;t know any solutions to that.
Graham
13-Aug-2006
[532]
switch to a windows host.  solves that.
Pekr
13-Aug-2006
[533]
ldd rebol-view-executable

 under Linux could tell you what libraries are needed. If that is 
 not much (e.g. one library being dependant upon other etc.), you 
 could try to upload those libraries to where your view executable 
 resides. The question is, what is Linux OS strategy to look for libraries 
 - current dir, some central libraries storage path, elsewhere ...?
Gabriele
14-Aug-2006
[534x2]
configured library path (usually /lib/, /usr/lib/, etc), or the value 
of the env variable LD_LIBRARY_PATH.
(iirc)
Ryan
15-Aug-2006
[536x2]
When I tried it, View seemed to want to try to install itself, and 
errored out when it tried to show an installation window. Various 
combinations of command line options were no help. I didnt try using 
old versions of view, or tricking view into thinking its already 
installed.
Let me know if anyone figures this out.
Sunanda
16-Aug-2006
[538]
I susoect View may be trying to pop-up an installation window......And 
so that appears on the server's console (if any). meanwhile, you 
wait at the end of an Internet connection unable to see anything.

Possible work-around: manually install whatever files View is trying 
to configure?
Janeks
16-Aug-2006
[539]
I found that in my case on Linux RebViev needs linux-gate.so.1!

I tried to google for "download linux-gate.so.1", but there was a 
lot of links for different things and it seems form me that it is 
included in some installation packgage.

Could some body help with this library  an is it worthwile (will 
RebView takes it from current dit)?
Pekr
16-Aug-2006
[540x2]
according to Gabriele, Linux might have some default library locations 
... but e.g. I run sqlite as dll, and I point rebol to load the library 
and it loads it from anywhere. The question is, if the same is right 
for executable dependant libraries
what about asking server admin to add the library for you? He just 
could unpack it for you from his distro CD/DVD to the location where 
it belongs ....
Anton
16-Aug-2006
[542x2]
Ryan, are you sure that the -i or --noinstall command-line argument 
option does not help ?
or all these ? -csiw
Gabriele
17-Aug-2006
[544]
petr, load/library is probably a bit different from what ldd does 
on startup. i suppose ldd wants current dir in the lib path to load 
libs from current dir (same issue as executing programs from current 
dir...)
Janeks
20-Aug-2006
[545]
I asked for mu web service provider to add linux-gate.so.1 to the 
server he did not aprove that he did (actualy I did not get any answer 
yet), but today I found that my test script:

 #!/var/www/cgi-bin/rebview -cs

REBOL [Title: "CGI Basics"]

print ["Content-type: text/html" newline]

print "Heloooooo!!!"

works differently - I am getting following response:

** Near: size-text self

You can check: http://www.jk.serveris.lv/cgi-bin/test

What could it mean?
Tomc
20-Aug-2006
[546x2]
first guess view may not work without X installed (does not on solaris) 
and there is no good reason to run X on a web server ... and then 
there are all those fiddley fonts
and if you do have X installed the cgi script is likely not run  
from a graphicly aware shell so there may be virtual frame buffers 
involved
Janeks
21-Aug-2006
[548x3]
It is on Linux!
Another story on Win:

Anybody noticed any differences in instalation of Rebol on MS IIS 
6.0 and IIS 5.0?

It looks like all things is the same but I am getting on my test.r 
 "The page cannot be found", while index shows that test.r is there.
Well - I found it: http://support.microsoft.com/?id=315122

And Rebol script works well when in Web Service Extensions you set 
as Allowed All Unknown CGI extensions.

But then you will get warning message, that it could be potential 
security threat - then the next question is from dummie:
Is it safe to install rebol in such way?
Anton
21-Aug-2006
[551]
I haven't set up Rebol with IIS myself, but my immediate reaction 
is to ask another question: "How much do you believe Microsoft?" 
Of course Microsoft will lead those who are a little unsure to believe 
that alternate software is less secure.
Janeks
21-Aug-2006
[552x2]
Personaly I do not like M$ as it is monster. ;-)

But in my last and current work I am not responsible on which web 
server to chose and therefore neither for security of web server.

And I am trying to separate my  resposibility and SP responsibility, 
but of course there is cases when they overlaps.

I am just trying to find  as much as possible info about security 
of web servers and it does no matter if it is M$ or not .

My first installations was on IIS 5.0 in intranet - so I relied on 
firewall. The last case is in public internet. 

So I think if there are no possibility to upload danger cgi scripts 
or pass danger code to existing scripts, than from my side I did 
all.
Anton, do you have any idea about ** Near: size-text self  with Linux 
and rebview for cgi?
Pekr
21-Aug-2006
[554]
hmm, size-text - it does sound like a native. IMO it is wrapper for 
OS level function, returning pixel size of particular text .... could 
that be a problem of some missing os library?
Anton
21-Aug-2006
[555x2]
I haven't used rebol much on linux, yet, but the error sounds suspiciously 
like the common mistake of running rebol without X running, as Tom 
said. The linux server you are uploading rebview to may very well 
*not* be running X.  If that is the case, you will have to settle 
with Rebol/Core only.  Do you really need View features ?  I know 
some people found that they missed some image manipulation functions 
from Rebol/View that are not available in Rebol/Core.
Do you have a linux box at home to play with ? You could try install 
Rebol/View on it without X running and see what error you get...
Volker
21-Aug-2006
[557]
size-text: xwindows is client/server. the x-server , that is your 
local computer, which offers to aplications to display things to 
you. And it has some important informations locally, especially the 
fonts (and can cache images and such).

/view needs access to the fonts and so access to a running x-server. 
the x-libs are only an interface to connect to the server. (The xserver-libs 
could be used directly, but well, /view does not do that. Seems to 
be tricky.)
A incomplete sketch how to do it, with no attention to security:

So with /view you need a running x-server, one way to do that  headless 
is vnc.  Can also run on another machine. 

Then you need to tell  rebol where it is, there is an env-var $DISPLAY. 
Which must be set before rebol runs. Did not figure out how to configure 
that. Running a bash-script as cgi, set  $DISPLAY, call the real 
rebol-script should work. And there may be issues with authentification, 
x-windows does not like everyone to connect by default, or the other 
way around, its too easy to make it too open ("xhost + ip"). There 
are more secure ways, but looked more complicated and i never tried. 
All in all i would run such things on windows.
Janeks
22-Aug-2006
[558]
Sounds like I should to think about other solutions of human control 
and image resizing & texts on them.
It is a pitty.

Human control could be organized by just set of image files with 
some "kidnaping" fonts letters and some simple script in Core.

Image resizing (f.ex. when uploading) theoreticaly could be done 
with Core - but it seems too much work for me now, because I dont 
know yet how image files is built and those resizing algorithms.
And about text placing on uploaded images I can forget.
All things above could be done in View just fine.
:(

It was good idea, that I made first my private blog site on Linux. 
Despite Rebol runs on so many systems - running the same things on 
other systems should be checked before. Especialy if there are no 
expierence of work on that system.


BTW I found in the google the similar response was caused from uncomplete 
View instalation: http://demo.rebol.net/list/list-msgs/34071.html
But it looks that this is not the case.
Graham
22-Aug-2006
[559]
why don't you use imagemagick with rebol ?
Janeks
22-Aug-2006
[560x2]
Because I don't know it.

And I whanted to use my blog site as demo for all those good things 
that could be done with Rebol.

But whell - as I undertood I can use it on Linux web server. Anyway 
thanks, Graham, I will check how can I use them.
It's looks like I first try to negotiate with SP - probably he could 
help.
Edgar
22-Aug-2006
[562]
So Graham, is ImageMagick working okay with you in Rebol? Which version 
did you finally use?
Henrik
22-Aug-2006
[563]
graham, and how fast is it?
Graham
22-Aug-2006
[564x2]
I'm using the com+ server at present stil as I wasn't able to get 
your script to work.  When I have time, I'll try again.
Henrik, at present I am converting PDFs to JPG, and since it uses 
ghostscript as well, it is not that fast ... but I don't have too 
long a wait.
Henrik
22-Aug-2006
[566]
ah, so it's not useful for realtime stuff?