You can't run Apache2:: classes outside of the mod_perl environment. They interact directly with a C API to data structures that don't exist when apache is not running. However, there is a high-quality testing framework developed specifically for this purpose called Apache::Test. It handles all the details of starting a test server for you. It's what the mod_perl project uses for testing and you can use it too.