Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Feb 2002 13:59:06 +0000
From:      Matt H <matt@proweb.co.uk>
To:        "mpd" <mpd6334@cs.rit.edu>
Cc:        questions@FreeBSD.ORG
Subject:   Re: apache/mod perl not friendly
Message-ID:  <20020211135906.36d241dd.matt@proweb.co.uk>
In-Reply-To: <20020210193323.A38732@rochester.rr.com>
References:  <20020210193323.A38732@rochester.rr.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 10 Feb 2002 19:33:23 -0500
"mpd" <mpd6334@cs.rit.edu> wrote:

> Hi,
> 
> I felt like doing something new, so I installed mod_perl.

I can fully recommend O'Reilly's "Writing Apache Modules with perl and c"
as seen at http://www.modperl.com

Another good place to look of course is :
http://perl.apache.org/

Anyway here's an example :

----- file : /usr/local/lib/perl/Apache/Hello.pm  -------

package Apache::Hello;

use Apache::Constants qw(:common);

sub handler {
        my $r = shift;
        $r->content_type('text/html');
        $r->send_http_header;
        $r->print("<HTML><BODY>HI</BODY></HTML>");
        return OK;
}
1;

------- httpd.conf entry --------------

<VirtualHost *>

.. snip other stuff ...

    <Location /hello>
	SetHandler perl-script
	PerlHandler Apache::Hello
    </Location>

</VirtualHost>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020211135906.36d241dd.matt>