lighttpd forum lighty > Lighttpd and a compiled c++ cgi script (AT3)

Posted by chickahoona (Guest)
on 04.09.2008 16:07
I already asked a few people and already wrote now the following lines
into several boards without getting a response. I hope someone can hel
me here:

I just built built a site
www.sexyhdgirls.com and I
need some help with setting up ArrowTrader lite 3

This is an counting script based on cgi includes. the "in.cgi" I have to
load is a compiled c++ file (no pearl script)

I already enabled cgi and ssi support on lighty and had now to recognize
that lighty doesnt support the php function virtual(). So I have to go
through an shtml document with:

[code]<!--#include virtual="/cgi-bin/at3/in.cgi" -->[/code]

But then lighty simple copy paste the the binary code of in.cgi into the
output of the webserver.

Then I tried

[code]<!--#exec cmd="/cgi-bin/at3/in.cgi"-->[/code]

nothing happened.

Then I tried

[code]<!--#exec
cmd="/var/www/sexyhdgirls.com/html/cgi-bin/at3/in.cgi"-->[/code]

And I got these lines within my output

[code]Content-type: text/html [/code]

But I would need

[code]document.cookie='atref=noref$#; path=/[/code]

The normal cgi stuff seems to work because I can access

http://www.sexyhdgirls.com/cgi-bin/at3/admin.cgi

without problems.

and the normal ssi stuff also works if I add for example these lines
into my shtlm document:

[code]<!--#echo var="DOCUMENT_ROOT"-->
<!--#exec cmd="date"-->[/code]

I get this output:

[code]/var/www/www.sexyhdgirls.com/html/
Tue Aug 19 19:58:01 CDT 2008[/code]

The "in.cgi" is chmod 777 and user is the same as the webserver.

I also asked the coder of arrowscripts who offers an integration but it
seems that he never worked with lighttpd.

Thx for all who read this and try to help me

Yours sincerely
chickahoona
Posted by chickahoona (Guest)
on 04.09.2008 16:10
here is a link to my lighttpd config and acces and errorlog

http://rapidshare.com/files/142605320/Desktop.rar.html
Posted by Jay Sprenkle
on 04.09.2008 22:41
chickahoona wrote:
> This is an counting script based on cgi includes. the "in.cgi" I have to
> load is a compiled c++ file (no pearl script)
> 
> I already enabled cgi and ssi support on lighty and had now to recognize
> that lighty doesnt support the php function virtual(). So I have to go
> through an shtml document with:
> 
> [code]<!--#include virtual="/cgi-bin/at3/in.cgi" -->[/code]

c++ isn't a script. It's compiled. Do you have a compiled executable?

I assume you copied it to the directory where you're cgi's are stored?

Did you visit this url and see if it called your program?
http://www.sexyhdgirls.com/cgi-bin/at3/in.cgi


> 
> But then lighty simple copy paste the the binary code of in.cgi into the
> output of the webserver.
> 
> Then I tried
> 
> [code]<!--#exec cmd="/cgi-bin/at3/in.cgi"-->[/code]

Have you tried putting the url of the cgi straight into the HTML
and not exec'ing it from shtml?
Posted by chickahoona (Guest)
on 06.09.2008 11:15
Jay Sprenkle wrote:
> chickahoona wrote:
>> This is an counting script based on cgi includes. the "in.cgi" I have to
>> load is a compiled c++ file (no pearl script)
>> 
>> I already enabled cgi and ssi support on lighty and had now to recognize
>> that lighty doesnt support the php function virtual(). So I have to go
>> through an shtml document with:
>> 
>> [code]<!--#include virtual="/cgi-bin/at3/in.cgi" -->[/code]
> 
> c++ isn't a script. It's compiled. Do you have a compiled executable?

That is what I wrote. A compiled c++ file is an executable.

> 
> I assume you copied it to the directory where you're cgi's are stored?
> 

Yes its located in /var/www/sexyhdgirls.com/html/cgi-bin/at3/

> Did you visit this url and see if it called your program?
> http://www.sexyhdgirls.com/cgi-bin/at3/in.cgi
> 

my shtml file is the index.shtml document in the main dir and it calls 
the in.cgi. Otherwise I would not see the binary code of the file in the 
serveroutput

> 
>> 
>> But then lighty simple copy paste the the binary code of in.cgi into the
>> output of the webserver.
>> 
>> Then I tried
>> 
>> [code]<!--#exec cmd="/cgi-bin/at3/in.cgi"-->[/code]
> 
> Have you tried putting the url of the cgi straight into the HTML
> and not exec'ing it from shtml?

Putting it into the maindir and doing nothing is nonsense. Lighttpd 
would not know what to do with it.
Posted by Jay Sprenkle
on 06.09.2008 22:56
chickahoona wrote:
> my shtml file is the index.shtml document in the main dir and it calls 
> the in.cgi. Otherwise I would not see the binary code of the file in the 
> serveroutput

cgi programs are executed by the web server not other code.
When you say you 'call' the in.cgi it makes me think you're trying to
execute it from some interpreted program such as php/ruby/etc. This
will almost certainly not work.

If you were more careful with your language you'd get a lot more help.
If people can't tell what you're talking about they probably won't 
bother to
help you. c++ programs are 'source' they're not 'scripts' etc.