virtual hosts map domains, sub-domains, and IP addresses to a section of configuration. that's not going to help you here. I feel like you are confusing the word domain and subdomain, which refers to any one of the following forms
.com Google.com www.google.com a1.www.google.com
what you are looking for is hosting your application as a path under the domain mainapp.de .
your application should work out of the box as long as your didn't hardwire any domain in the source code and the paths are all relative.
e.g. you click a link in the app that directs you to page1 . if the application is in the root folder of mainapp.de, then mainapp.de/page1 will work. if the app is in the folder myapp under the root folder, then mainapp.de/myapp/page1 will work.