There is an index.html file which has two links in it.
 link1
 link2

Now Link1 navigates user to Helloworld.php and Link2 navigates to Helloworld.java. 

Is it possible to host such an application on same server(it doesn't matter if two different ports are used). Also Apache and Tomcat don't need to talk to each other 
 Here we have Tomcat for Java and Apache for PHP