Can I guess mod_perl is the upgraded version of apreq? Thanks Andre.
> On 22.12.2020 06:49, Matthias Peng wrote: > > Hello > > > > I am developing a simple mp2 application. > > I looked for the installation for mp2 utils, and found this two: > > > > libapache2-mod-perl2 > > > > libapache2-mod-apreq2 > > > > > > what're their relations? Should I install both, or only the first one? > > > > Hi. > > They are different and independent packages and module libraries, and you > can use the one > or the other, or both, depending on your needs. > (We always install both, and we use both) > > For mod_perl per se, you need only the /libapache2-mod-perl2/ package. > This gives you access to all the stuff documented here : > http://perl.apache.org/docs/2.0/api/index.html > > *except* what is at the very end of that page : > > "Part VI: Related Modules" -> libapreq modules > (this is what is contained in the separate /libapache2-mod-apreq2/ package) > The documentation for libapreq is at : > http://httpd.apache.org/apreq/docs/libapreq2/modules.html > > It may be a bit confusing at first, because both (independent) packages > use some common > namespaces ("Apache2::" and "APR::"), and because each of mod_perl and > libapreq2 have > their own form of "Apache Request object", named very similarly : > - for mod_perl it is Apache2::RequestRec > - for libapreq it is Apache2::Request > (I guess that libapreq was first, that's why they got the better name ;-) > > I am a bit reluctant to try explaining the difference further (for fear > of confusing you > further), but here is a very rough summary : > > - to deal with 99% of what has to do with controlling what happens within > Apache httpd in > terms of processing HTTP requests (or just to run your perl scripts > faster), use the > mod_perl package. > So install /libapache2-mod-perl2/ first, and start coding. > > - if you finds out later that you have to do a lot of processing of CGI > parameters (the > request "query string") or cookies, you can then install and use use the > libapreq API > which (among other things) provide an alternative to what the CGI module > provides. > > In any case, there is a bit of a learning curve, but it is great fun and > very powerful. > > > > >