Firstly, I wouldn't recommend duplicating the library directory, just place it in common location and share it amongst your applications. As for setting your application path, we still need more details about how this application is being created.
If it where up to me I would be using some sort of install script that would write the required variables in there required locations. Either that, or set these vairables within an Apache environment variable when the application is built. Your still not providing us with enough details to help you however.