Professional Web Applications Themes

gettting an apache perl module to take over serving pages - PERL Modules

I have this huge directory of html and images, lets callit '/pages'. I want a Perl module to take over serving the HTML from this directory, so I can do smart redirects if the pages have expired. So, I wrote a module, 'PageServer' to do this, and tested it by specifying the following: <Location /ps> SetHandler perl-script PerlHandler Apache::PageServer </Location> So, whenever a page such as 'http://myserver/ps/foo.html' is requested, the module looks for 'foo.html' in the '/pages' directory and serves it, redirecting if the page is not found - works great! However, when I try to take over the actual ...

  1. #1

    Default gettting an apache perl module to take over serving pages

    I have this huge directory of html and images, lets callit '/pages'.

    I want a Perl module to take over serving the HTML from this directory, so I
    can do smart redirects if the pages have expired.

    So, I wrote a module, 'PageServer' to do this, and tested it by specifying
    the following:

    <Location /ps>
    SetHandler perl-script
    PerlHandler Apache::PageServer
    </Location>

    So, whenever a page such as 'http://myserver/ps/foo.html' is requested, the
    module looks for 'foo.html' in the '/pages' directory and serves it,
    redirecting if the page is not found - works great!

    However, when I try to take over the actual '/pages' URL, the module serves
    the pages, but IE thinks they are some sort of download and presents a popup
    asking if I want to download 'foo.html' to disk. What is up with that???

    I dont understand why it would work one way if the directory is present, and
    another if it is not.


    Seth Brundle Guest

  2. #2

    Default Re: gettting an apache perl module to take over serving pages

    print "mime type = content/html\n\n";

    Bet you dont have your redirection script spitting out a mime type before it
    starts spitting out HTML...




    "Seth Brundle" <brundlefly76hotmail.com> wrote in message
    news:3f71ea6e$0$279$45beb828newscene.com...
    > I have this huge directory of html and images, lets callit '/pages'.
    >
    > I want a Perl module to take over serving the HTML from this directory, so
    I
    > can do smart redirects if the pages have expired.
    >
    > So, I wrote a module, 'PageServer' to do this, and tested it by specifying
    > the following:
    >
    > <Location /ps>
    > SetHandler perl-script
    > PerlHandler Apache::PageServer
    > </Location>
    >
    > So, whenever a page such as 'http://myserver/ps/foo.html' is requested,
    the
    > module looks for 'foo.html' in the '/pages' directory and serves it,
    > redirecting if the page is not found - works great!
    >
    > However, when I try to take over the actual '/pages' URL, the module
    serves
    > the pages, but IE thinks they are some sort of download and presents a
    popup
    > asking if I want to download 'foo.html' to disk. What is up with that???
    >
    > I dont understand why it would work one way if the directory is present,
    and
    > another if it is not.
    >
    >

    Greg Patnude Guest

  3. #3

    Default Re: gettting an apache perl module to take over serving pages

    "Seth Brundle" <brundlefly76hotmail.com> writes:
    > I have this huge directory of html and images, lets callit '/pages'.
    >
    > I want a Perl module to take over serving the HTML from this directory, so I
    > can do smart redirects if the pages have expired.
    >
    > So, I wrote a module, 'PageServer' to do this, and tested it by specifying
    > the following:
    >
    > <Location /ps>
    > SetHandler perl-script
    > PerlHandler Apache::PageServer
    > </Location>
    >
    > So, whenever a page such as 'http://myserver/ps/foo.html' is requested, the
    > module looks for 'foo.html' in the '/pages' directory and serves it,
    > redirecting if the page is not found - works great!
    >
    > However, when I try to take over the actual '/pages' URL, the module serves
    > the pages, but IE thinks they are some sort of download and presents a popup
    > asking if I want to download 'foo.html' to disk. What is up with that???
    I suggest that you use lynx or telnet to see the raw response from
    your server - in particular see what's in the content-type and look to
    see if the body looks like HTML.
    > I dont understand why it would work one way if the directory is present, and
    > another if it is not.
    Of course IE is well known to be broken with respect to it's handing
    of content-type.

    [url]http://ppewww.ph.gla.ac.uk/~flavell/www/content-type.html[/url]

    --
    \\ ( )
    . _\\__[oo
    .__/ \\ /\
    . l___\\
    # ll l\\
    ###LL LL\\
    Brian McCauley Guest

  4. #4

    Default Re: gettting an apache perl module to take over serving pages

    The problem was actually that, when a directory exists of the same
    name as the mod_perl script location, some HTTP environment variables
    are not available - PATH_INFO being one of them! This caused logic
    problems in my script, now it works fine.

    Weird.


    "Greg Pat" <gpatadelphia.net> wrote in message news:<HCrdb.193$Vb3.118910news1.news.adelphia.net >...
    > print "mime type = content/html\n\n";
    >
    > Bet you dont have your redirection script spitting out a mime type before it
    > starts spitting out HTML...
    >
    >
    >
    >
    > "Seth Brundle" <brundlefly76hotmail.com> wrote in message
    > news:3f71ea6e$0$279$45beb828newscene.com...
    > > I have this huge directory of html and images, lets callit '/pages'.
    > >
    > > I want a Perl module to take over serving the HTML from this directory, so
    > I
    > > can do smart redirects if the pages have expired.
    > >
    > > So, I wrote a module, 'PageServer' to do this, and tested it by specifying
    > > the following:
    > >
    > > <Location /ps>
    > > SetHandler perl-script
    > > PerlHandler Apache::PageServer
    > > </Location>
    > >
    > > So, whenever a page such as 'http://myserver/ps/foo.html' is requested,
    > the
    > > module looks for 'foo.html' in the '/pages' directory and serves it,
    > > redirecting if the page is not found - works great!
    > >
    > > However, when I try to take over the actual '/pages' URL, the module
    > serves
    > > the pages, but IE thinks they are some sort of download and presents a
    > popup
    > > asking if I want to download 'foo.html' to disk. What is up with that???
    > >
    > > I dont understand why it would work one way if the directory is present,
    > and
    > > another if it is not.
    > >
    > >
    Seth Brundle Guest

Similar Threads

  1. Apache Flex Module
    By istis in forum Macromedia Flex General Discussion
    Replies: 0
    Last Post: May 4th, 08:43 AM
  2. Any module for reading Apache log files?
    By Ron Savage in forum PERL Modules
    Replies: 3
    Last Post: October 7th, 07:57 AM
  3. Problem gettting module from CPAN
    By Bern in forum PERL Modules
    Replies: 4
    Last Post: September 21st, 12:55 PM
  4. serving pages in ASP ala PHP
    By -[ CaMeL ]- a55m0nk in forum ASP
    Replies: 3
    Last Post: October 27th, 09:36 PM
  5. [PHP-DEV] Scope of zend_alter_ini_entry in Apache module?
    By Mark Morley in forum PHP Development
    Replies: 2
    Last Post: August 15th, 11:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139