You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Chuck Carson <Ch...@syrrx.com> on 2001/11/29 23:37:46 UTC

problem, pulling my dam hair out

 
I have the following config:
 
apache 1.3.22 with perl 1.26 built statically
 
I want to use perl to dynamically generate html pages, so I have .pl
files under DOCUMENT_ROOT.
 
I have this config:

Alias /perl /usr/local/apache/cgi-bin
<Directory /usr/local/apache/cgi-bin >
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options +ExecCGI
</Directory>
<Files *.pl>
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options ExecCGI
</Files>
 
Whenever I try and get a perl script from a web browser, it pops up a
dialog asking to save the damn file. I have tried Netscape 4.79 on NT
and Unix as well as IE 5.5. I have configured a server in this manner
probably 100 times, I cannot find what I a missing this particuliar
time.
 
 
Anyone have any ideas?
 
Thanks,
Chuck
 
 
Chuck Carson
Systems Administrator
chuck.carson@syrrx.com <ma...@syrrx.com> 
858.202.4188 Office
858.442.0827 Mobile
858.623.0460 Fax
 
 

Re: problem, pulling my dam hair out

Posted by Stas Bekman <st...@stason.org>.
Chuck Carson wrote:

>  
> I have the following config:
>  
> apache 1.3.22 with perl 1.26 built statically
>  
> I want to use perl to dynamically generate html pages, so I have .pl
> files under DOCUMENT_ROOT.
>  
> I have this config:
> 
> Alias /perl /usr/local/apache/cgi-bin
> <Directory /usr/local/apache/cgi-bin >
>         SetHandler perl-script
>         PerlHandler Apache::Registry
>         Options +ExecCGI
> </Directory>
> <Files *.pl>
>         SetHandler perl-script
>         PerlHandler Apache::Registry
>         Options ExecCGI
> </Files>
>  
> Whenever I try and get a perl script from a web browser, it pops up a
> dialog asking to save the damn file. I have tried Netscape 4.79 on NT
> and Unix as well as IE 5.5. I have configured a server in this manner
> probably 100 times, I cannot find what I a missing this particuliar
> time.
>  
>  
> Anyone have any ideas?

let the guide be with you:
http://perl.apache.org/guide/config.html#My_Script_Works_under_mod_cgi_b

PerlSendHeader On
is missing if you use CORE::print() to send headers

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: problem, pulling my dam hair out

Posted by Hans Poo <ha...@integranet.cl>.
El Jue 29 Nov 2001 19:37, Chuck Carson escribió:
> I have the following config:
>
> apache 1.3.22 with perl 1.26 built statically
>
> I want to use perl to dynamically generate html pages, so I have .pl
> files under DOCUMENT_ROOT.
>
> I have this config:
>
> Alias /perl /usr/local/apache/cgi-bin
> <Directory /usr/local/apache/cgi-bin >
>         SetHandler perl-script
>         PerlHandler Apache::Registry
>         Options +ExecCGI
> </Directory>
> <Files *.pl>
>         SetHandler perl-script
>         PerlHandler Apache::Registry
>         Options ExecCGI
> </Files>
>
> Whenever I try and get a perl script from a web browser, it pops up a
> dialog asking to save the damn file. I have tried Netscape 4.79 on NT
> and Unix as well as IE 5.5. I have configured a server in this manner
> probably 100 times, I cannot find what I a missing this particuliar
> time.
>
>
> Anyone have any ideas?
>
> Thanks,
> Chuck
>
>
> Chuck Carson
> Systems Administrator
> chuck.carson@syrrx.com <ma...@syrrx.com>
> 858.202.4188 Office
> 858.442.0827 Mobile
> 858.623.0460 Fax

The content type is not getting rigth to the browser !

If you are using a funny extension for your files you need the apache  
AddType directive.

AddType text/html .myextension

Maybe you are just forgeting to send the http Content-Type: text/html as your 
first instruction. There are many ways to do it:

print "Content-Type:text/html\n\n";

or 

use CGI qw/:standard/;
print header;

or the mod_perl way....

In any case, you miss to Put a mod_perl directive "PerlSendHeader on" (to fix 
malformer headers) in your directory configuration.

Hans Poo

Re: problem, pulling my dam hair out

Posted by tom poe <to...@renonevada.net>.
On Thursday 29 November 2001 14:37, Chuck Carson wrote:
> I have the following config:
>
> apache 1.3.22 with perl 1.26 built statically
>
> I want to use perl to dynamically generate html pages, so I have .pl
> files under DOCUMENT_ROOT.
>
> I have this config:
>
> Alias /perl /usr/local/apache/cgi-bin
> <Directory /usr/local/apache/cgi-bin >
>         SetHandler perl-script
>         PerlHandler Apache::Registry
>         Options +ExecCGI
> </Directory>
> <Files *.pl>
>         SetHandler perl-script
>         PerlHandler Apache::Registry
>         Options ExecCGI
> </Files>
>
> Whenever I try and get a perl script from a web browser, it pops up a
> dialog asking to save the damn file. I have tried Netscape 4.79 on NT
> and Unix as well as IE 5.5. I have configured a server in this manner
> probably 100 times, I cannot find what I a missing this particuliar
> time.
>
>
> Anyone have any ideas?
>
> Thanks,
> Chuck

Hi, Chuck:  For starters, is the line above correct:
> Alias /perl /usr/local/apache/cgi-bin

or should you use:  Alias /perl/   /usr/local/apache/cgi-bin/

The other thing you might check in that area, is a line that says something 
like:
 AddHandler cgi-script .pl .cgi  

I'm running SuSE7.1, and Apache1.3.14 with a documentRoot of 
/usr/local/httpd/htdocs/

hth   tom

RE: problem, pulling my dam hair out

Posted by Kyle Oppenheim <ky...@tellme.com>.
Are you setting the content-type header correctly?  You can add the correct
content type a number of ways:

- Adding "DefaultType text/html" to your httpd.conf
- Using the AddType directive in httpd.conf to single out .pl files
- Add .pl files to your mime types config file (pointed to by TypesConfig)
- Set it dynamically from your scripts using $r->content_type('text/html')

- Kyle

> -----Original Message-----
> From: modperl-return-20940-kyleo=tellme.com@apache.org
> [mailto:modperl-return-20940-kyleo=tellme.com@apache.org]On Behalf Of
> Chuck Carson
> Sent: Thursday, November 29, 2001 2:38 PM
> To: modperl@apache.org
> Subject: <Files> problem, pulling my dam hair out
>
>
>
> I have the following config:
>
> apache 1.3.22 with perl 1.26 built statically
>
> I want to use perl to dynamically generate html pages, so I have .pl
> files under DOCUMENT_ROOT.
>
> I have this config:
>
> Alias /perl /usr/local/apache/cgi-bin
> <Directory /usr/local/apache/cgi-bin >
>         SetHandler perl-script
>         PerlHandler Apache::Registry
>         Options +ExecCGI
> </Directory>
> <Files *.pl>
>         SetHandler perl-script
>         PerlHandler Apache::Registry
>         Options ExecCGI
> </Files>
>
> Whenever I try and get a perl script from a web browser, it pops up a
> dialog asking to save the damn file. I have tried Netscape 4.79 on NT
> and Unix as well as IE 5.5. I have configured a server in this manner
> probably 100 times, I cannot find what I a missing this particuliar
> time.
>
>
> Anyone have any ideas?
>
> Thanks,
> Chuck
>
>
> Chuck Carson
> Systems Administrator
> chuck.carson@syrrx.com <ma...@syrrx.com>
> 858.202.4188 Office
> 858.442.0827 Mobile
> 858.623.0460 Fax
>
>
>