Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

pdf files from the cgi-bin directory

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Apache QoS  
Author Message
pdconetwofour_

External


Since: Jul 02, 2003
Posts: 22



(Msg. 1) Posted: Sun Mar 14, 2004 1:34 am
Post subject: pdf files from the cgi-bin directory
Archived from groups: alt>apache>configuration (more info?)

Im using the perl modules PDF::Create and PDF::Reuse to add some form input
fields to a pdf.
I then want to be able to download into the browser the created pdf file.
I seem to be able only to create the file in the cgi-bin directory
( prDocDir('/tmp/') seems not to work;
I can open the file (using xpdf) directly

eg
#!/usr/bin/perl -w
# perl stuff to create a pdf file
I then use a bit of perl to write the new page page.

print "content-type:text/html\n\n";
print '<HTML><HEAD><TITLE></TITLE>';
print '<body>';
print '<a href="http://webserver.com/cgi-bin/form.pdf">Download your
file</a>';
print '</body></HTML>';

This gives me a 500 Internal Server Error

bash-2.05b# tail /etc/apache2/logs/error_log
[Sat Mar 13 22:15:54 2004] [error] [client 127.0.0.1] Premature end of
script headers: form.pdf
[Sat Mar 13 22:15:54 2004] [error] [client 127.0.0.1] (2)No such file or
directory: cannot access type map
file: /home/httpd/errorHTTP_INTERNAL_SERVER_ERROR.html.var

ie it thinks the file is a script!!

the cgi-bin directory is configured with
Options +ExecCGI directive

bash-2.05b# cd /etc/apache2/conf/vhosts/
bash-2.05b# cat vhosts.conf |grep pdf
bash-2.05b# pwd
/etc/apache2/conf
bash-2.05b# cat commonapache2.conf |grep pdf
AddIcon /icons/layout.gif .html .shtml .htm .pdf

ie there are no stray config things

Can i allow apache to serve pdf ( or txt) files from a cgi-bin directory ?

 >> Stay informed about: pdf files from the cgi-bin directory 
Back to top
Login to vote
davideyeahsure

External


Since: Nov 03, 2003
Posts: 2907



(Msg. 2) Posted: Sun Mar 14, 2004 10:37 am
Post subject: Re: pdf files from the cgi-bin directory [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

p cooper <pdconetwofour_numbers_.RemoveThis@yahoo.co.uk> wrote:
 > I seem to be able only to create the file in the cgi-bin directory
 > ( prDocDir('/tmp/') seems not to work;

You should create a temporary directory inside Apache's document
tree and then refer to it as a 'relative' path, not absolute
(prDocDir('../temp/')).

 > Can i allow apache to serve pdf ( or txt) files from a cgi-bin
 > directory ?

No, he will try to execute them as CGI.

Davide

--
| Windows - From the people who brought you EDLIN!
|
|
|<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: pdf files from the cgi-bin directory 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
See files in my directory - I have apache as web server but I would like to see the files in a directory. by exemple if I have http://192.168.1.105/~philippe/files/ I would like to see all directory in files in this folder but I can not how to configure apache to do it. please..

How can I serve a directory of shared files? - I've never done any html coding on a linux platform, but a little with Windows -- no experience wiht Apache at all. I'm trying to put together a homepage for my intranet that my kids can use. Server is Mandrake 9.2 with Apache 2.0.47. The other machines...

Viewing files in order of "last modified" in a directory - Hello, I am currently running Server version: Apache/2.0.44 and was wondering if there was some way in which the files in a directory appeared in the order of "last modified" without having to click the "last modified" column. than...

<Directory cgi-bin> - Question - Hello, are there some special restrictions with the cgi-bin Directory? A friend of mine reported that he could only refer to .php files in subdirectories, but cannot access .jpg files when they are in subdirectories... his apache is version 2 running..

Sub Directory access - Hello, on my corporate LAN, i have - a server (Debian Woody) with Apache 1.3/MySql/PHP (192.168.150.1) - some Windows stations - and a Linux box under mandrake 9.2 (192.168.150.10 or cerquetti.cmpp.org) w/ Apache 2 + Mysql + PHP The DNS (BIND) is locate...
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]