Print using a web server's print queues

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Print using a web server's print queues

Alfredo Cole-2
Hi:

This may be off topic.

I have an application that uses an iPAQ to take physical inventory. The
application works through the browser connecting via wi-fi to a Suse server
running Apache (Suse 9.3). I need to print a summary to one of the print
queues at the server, using a cgi written in C. I can write the printout to a
file, and I thought I might be able to use the system command like:

system ("lpr -Pprinter_name filename")

but Apache will not run the system command. My only solution I can think is
using a cron job that will print the files but maybe someone has a better
solution. Any ideas?

Thank you.

--
Alfredo Cole-Tuckler

--
Check the headers for your unsubscription address
For additional commands send e-mail to [hidden email]
Also check the archives at http://lists.suse.com
Please read the FAQs: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Print using a web server's print queues

stephan beal
On Monday 16 October 2006 16:15, Alfredo Cole wrote:
> system ("lpr -Pprinter_name filename")
>
> but Apache will not run the system command.

What error does apache give? Have you tried running the command with the
absolute path, e.g.:

/usr/bin/lpr -Pprinter_name /path/to/filename

?

--
----- [hidden email]   http://s11n.net
"...pleasure is a grace and is not obedient to the commands
of the will." -- Alan W. Watts

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Print using a web server's print queues

Alfredo Cole-2
El Lunes, 16 de Octubre de 2006 12:11, stephan beal escribió:

> On Monday 16 October 2006 16:15, Alfredo Cole wrote:
> > system ("lpr -Pprinter_name filename")
> >
> > but Apache will not run the system command.
>
> What error does apache give? Have you tried running the command with the
> absolute path, e.g.:
>
> /usr/bin/lpr -Pprinter_name /path/to/filename
>
> ?

I get an EACCES error. I looked into SuExec but I can't figure out how to use
it.

Regards.

--
Alfredo Cole-Tuckler

--
Check the headers for your unsubscription address
For additional commands send e-mail to [hidden email]
Also check the archives at http://lists.suse.com
Please read the FAQs: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Print using a web server's print queues

Aveek Bhattacharya-2
Alfredo Cole wrote:

> El Lunes, 16 de Octubre de 2006 12:11, stephan beal escribió:
>> On Monday 16 October 2006 16:15, Alfredo Cole wrote:
>>> system ("lpr -Pprinter_name filename")
>>>
>>> but Apache will not run the system command.
>> What error does apache give? Have you tried running the command with the
>> absolute path, e.g.:
>>
>> /usr/bin/lpr -Pprinter_name /path/to/filename
>>
>> ?
>
> I get an EACCES error. I looked into SuExec but I can't figure out how to use
> it.
>
> Regards.
>

Could it be that the apache user (usually apache, www or something
similar) is not permitted to use CUPS?

--
Regards,
Aveek Bhattacharya
IIT Bombay


--
Check the headers for your unsubscription address
For additional commands send e-mail to [hidden email]
Also check the archives at http://lists.suse.com
Please read the FAQs: [hidden email]