You need to set the $APXS or $APACHE environment variable before installing Apache::Test:
% export APXS=/usr/local/apache/bin/apxs
% perl -MCPAN -e 'install Apache::Test'
© 2016, O’Reilly Media, Inc.
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.