Deploying application in domain path/subdirectory

Is it possible to deploy two applications running on the same machine to the same domain, but each of them on different path (or subdirectory)? Eg. example.com/app1 and example.com/app2?