[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Desire to Run Scripts With No Extension



Greetings,
I don't want to run the scripts with .pl or .cgi extensions. I prefer no
extension. This would be a problem if I were to run the scripts on
certain Web servers, but I plan to only run it on a good Web server
which I can configure appropriately.
I think it would be good to simply offer the option to use either an
extension of .pl, an extension of .cgi, or the option of using no
extension.
I'm using Apache. I setup my .htaccess file for the script folder
appropriately, with the following lines: 
ForceType text/html 
SetHandler cgi-script 
So, Apache is fully ready to handle the scripts without any extension. 
Now, I find that the RingLink scripts provide the appropriate HTTP
header only if I use the exact file names allowable by Gunnar. (I think
this is why I'm getting an "Internal Server Error" when I try to run the
script from my Web browser.)
For example, if I run a script named "ringadmin" (from my shell), output
starts with: 
<!-- Page generated by Ringlink 2.0 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML//EN"> 
If, on the other hand, I run the exact same script (from my shell), now
named "ringadmin.pl", the output starts with: 
Content-type: text/html 
<!-- Page generated by Ringlink 2.0 --> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML//EN"> 
What can I do to assure the appropriate HTTP header for cgi files
without the extensions required by Gunnar?
I've been trying to change the Perl code to incorporate this
enhancement. So far, I've done the following:
1) Edit the ring.pm, rlmain.pm, and site.pm files
2) Search for each appearance of:
"my @execfiles = grep { !/^\./ && (/\.pl$/i || /\.cgi$/i) }
readdir(DIR);"
3) Replace each occurance with:
"my @execfiles = grep { !/^\./ } readdir(DIR);"
So far, this hasn't seemed to change anything. Is it a step in the right
direction?
The only other thing I can think of right now is to look at sub
execstart in the rlmain.pm file. It contains the following:
  # HTTP header
  for ('next', 'prev', 'rand', 'home', 'goto', 'skipnext', 'skipprev') 
{
    if ($rlmain::action =~ /^$_\./i)    {
      $rlmain::htmlprint = "Content-type: text/html\n\n";
      last;
    }
  }
  for ('list', 'next5', 'prev5', 'admin', 'ringadmin', 'siteadmin',
'newring', 'new
site')       {
    if ($rlmain::action =~ /^$_\./i)    {
      print "Content-type: text/html\n\n" unless
$rlmain::data{'details'};
      last;
    }
  }
Is this the source of the problem? If so, how do I fix it?
I've also mentioned this in a support request at <URL:
http://sourceforge.net/tracker/?func=detail&atid=215568&aid=465927&group_id=15568
>, but that doesn't seem to be going anywhere, yet.
Sincerely,
Israel Steinmetz
-- 
Enlightenment Essentials: Free Books, Searches, Politics, HTML
http://www.mrdata.net/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]