I'm trying to get Apache 2.4 configured such that I can test mod_perl 2 code locally (I should note that I have little recent experience with Apache). I've installed both of them on a machine running Ubuntu 14.04 and everything seems to be working (e.g., when I direct a browser to http://localhost
I'm shown the default Apache page).
I followed the steps in this short tutorial to configure Apache such that any file in the folder var/www/perl
(which I created) will be executed by mod_perl. I placed the specified <Location>
directive within the <VirtualHost>
block in the /etc/apache2/sites-available/000-default
configuration file (perhaps I should be creating a new VirtualHost
instead?).
Unfortunately, when I attempt to visit http://localhost/perl/hello.pl
, I get a 404 error, so evidently some aspect of my Apache configuration isn't correct.
Given my limited knowledge of Apache, I'm probably making a simple mistake. I've found a number of contradictory pieces of advice online (some of which I suspect are simply out of date), so any suggestions would be appreciated!
EDIT
I was able to create a status page at localhost/perl-status
by roughly following the first part of this tutorial, although I had to place the new <Location>
directives at the end of 000-default.conf
in the sites-available
directory instead of in a new file in /etc/apache2/conf.d
(as the conf.d
directory no longer exists in Apache 2.4). The resulting status page indicates that mod_perl is loaded, but I've yet to get Apache to execute perl scripts. Since my initial post, I've tried a few different configurations and folder structures within /var/www/
(including nesting the perl
folder within /var/www/html
) but none have worked. I'm certain this can't be particularly complicated, but finding up-to-date references is proving rather difficult.