This is kind of out of the scope of this forum, since Apache and PHP have abundant ressources all over the web to learn from.
I'd say you should have a "www" folder in your apache directory and this is where you should have a jax.php file containing your code.
This is how you'll be able to access "http://localhost/jax.php?whatever".
Check the How do I FAQ there are several examples treating about AJAX and PHP in the "AJAX" section, but for beginner documentation about having a local webserver and how to write correct PHP, you should make a search on google and learn from there.