proper use of mod_perl2

Amir Tabatabaei amirovic at googlemail.com
Tue Feb 5 00:00:03 UTC 2008


[please keep me on cc, I'm not subscribed to this list]

Hi,

I'd like to switch from PHP to perl for further web developments. After
installing libapache2-mod_perl2 and asking $search_engine for its usage
- as I could not find any information on this in any document provided
by this package (Did I miss something?) - I added the following lines to
my apache config file:

-----8<-----
Alias / "/var/www/"
<Location />
	SetHandler perl-script
	PerlResponseHandler ModPerl::Registry
	PerlOptions +ParseHeaders
	Options +ExecCGI
	Order allow,deny
	Allow from all
</Location>
-----8<-----

I set the handler to the root apache directory as I'm planning to use
perl files only without any pure html-file.
Question: Is this the right way and syntax to do so? Any concerns?

Now I've created an "index"-file with the following content which works
fine:

-----8<-----
$> cat /var/www/index

#!/usr/bin/perl
print "Content-type: text/plain\n\n";
print "mod_perl 2.0 rocks!\n";
-----8<-----

I'd like to have all files without any extension.
Question: Any concerns or comments here?

To find out more about mod_perl2 I installed libapache2-mod-perl2-doc.
Stupid question: How do I use this package? Sorry, I'm quite new to perl
and have no clue how the "config.cfg" or any other file
in /usr/share/doc/libapache2-mod-perl2-doc/ can be used to get some
useful information. I hoped to use a web-browser to see the
documentation, but each file is either display as plain text or is
offered for download.

My last question is about how to write websites? Do I have to "print"
every html line like I did in the example above? Is there a proper way
of writing html code with perl? Links to howtos are very appreciated!

Thanks a lot for any kind of help!
Regards,
Amir




More information about the pkg-perl-maintainers mailing list