PDA

View Full Version : webserver and CGI question



robsonde
03-03-2004, 12:51 PM
I what to have a form that lets users input dat/numbers in to then a CGI script in perl will put all the info in to a .CONF file and then run an external program that reads the .CONF file and does lots of stuff with it resulting in a .JPG file that will be returned by the web server to the user to see on the web page.


question is how?

I will be using perl due to the fact that i have it set up on the webserver box.

how can i make the perl script call on external program?

if the external program takes 3 minutes to make the .JPG wont the web browser "timeout" ?


BTW all this is to be done on unix with apache and perl.

robsonde
03-03-2004, 07:25 PM
bump

Noel Nosivad
03-03-2004, 10:19 PM
Hey robsonde,

That's a lot of information you're asking for and I can only say you may need to research on these specific commands

UNIX - touch, chmod (also on perl)
PERL - open, close, flock, print
APACHE - suEXEC

Also a lot of security measures and error handling required. You'll have to write the function of timing out for the script, if it takes to long end it, report the error back to the user and exit the external program. Make sure the user is aware of what is happening and that they can't resubmit the information again as this may cause problems.

I hope this helps a bit, but for something like this involves an indepth explanation on what you want. If you could show examples or give examples of what is going to happen in more depth you might get the answers you require.


Noel Nosivad.

robsonde
03-03-2004, 11:32 PM
i have most of the problem solved.....

the only problem is that the program i want to run wont run as "nobody" and "nobody" has cat write to a file in the html directory......

how can I make it all run as a user other than nobody?

I am using system to run my program from perl....

robsonde
03-03-2004, 11:34 PM
what i tried to say was.....


the only problem is that the program i want to run wont run as "nobody" and "nobody" cant write to a file in the html directory......

robsonde
03-03-2004, 11:41 PM
looks like i am out of my depth....

I will call in my unix geek on the weekend.

Noel Nosivad
04-03-2004, 03:48 AM
Hey robsonde,

This user 'nobody' should never own files, it's a generic user installed for running non-privileged jobs that don't belong to any one user. Mainly for scripts used in cron jobs.

The owner of the HTML directory is either 'apache' or yourself and they would be allowed to write to this directory with correct chmod settings.

You should look at suEXEC if you haven't, this allows you to run the program, hopefully with the right owner of the directory.


Noel Nosivad