10.07.2015 Views

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

Beginning Web Development With Perl : From Novice to ... - Nabo

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 10 ■ APACHE AND MOD_PERL 195■Note Best practice system administration says, and I agree, that enabling all options is a bad idea on productionsystems. More applications and options mean a greater footprint in terms of both resources andsecurity. The difference in resources between everything and a minimum set of functions isn’t incrediblylarge with Apache and mod_perl, especially with modern hardware. However, more code almost alwaysmeans more chances for bugs that could crop up at the most inopportune time. <strong>From</strong> a security standpoint,if something doesn’t exist, it can’t be exploited. When everything is compiled in, a security exploitfor a piece of the code would make the program vulnerable. For these reasons, I recommend spendingtime learning exactly which Apache modules you need and disabling those you don’t need.<strong>With</strong> both the Apache and mod_perl sources unzipped, change in<strong>to</strong> the mod_perl sourcedirec<strong>to</strong>ry:cd mod_perl-1.NNFor example, <strong>to</strong> change in<strong>to</strong> the mod_perl direc<strong>to</strong>ry for version 1.29, this command wouldget you there:cd mod_perl-1.29mod_perl uses <strong>Perl</strong> <strong>to</strong> create the Makefile and uses some command-line arguments andswitches <strong>to</strong> configure the compile process. Chief among those command-line arguments isthe location of the Apache source code. Since you unpacked the Apache source <strong>to</strong> the direc<strong>to</strong>ryone level up from the mod_perl source direc<strong>to</strong>ry, however, mod_perl will be able <strong>to</strong> find it.<strong>From</strong> within the mod_perl source direc<strong>to</strong>ry, type the following:perl Makefile.PL EVERYTHING=1 USE_APACI=1The Makefile.pl script will now run. Pay particular attention <strong>to</strong> any warnings and followtheir instructions. Here is an example:************* WARNING *************Your <strong>Perl</strong> is configured <strong>to</strong> link against libgdbm,but libgdbm.so was not found.You could just symlink it <strong>to</strong> /usr/lib/libgdbm.so.1.7.3************* WARNING *************The script will ask a couple questions about how <strong>to</strong> build the software:Will configure via APACIConfigure mod_perl with ../apache_1.3.33/src ? [y]Shall I build httpd in ../apache_1.3.33/src for you? [y]The script will create a Makefile checking for other prerequisites such as the <strong>Perl</strong> developmentfiles. If you installed <strong>Perl</strong> as a package with your distribution (this is usually the case),you might need <strong>to</strong> install the <strong>Perl</strong> development package as well. I recommend installing thispackage from your distribution, rather than downloading a new version of <strong>Perl</strong> and compilingit from source.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!