In general you are not likely to find the latest versions on any pre-built stack, since there will always be a time lag between a new version release and package releases in official repositories due to the need to "iron out" system specific dependencies and quirks.
You have three options :
- Download Ubuntu specific binaries of the latest version (if they exist) from the corresponding sites.
- Download the source code from said sites and compile locally.
- Wait for the version you are interested in to be included in the official repositories.
Now, unless there is a very specific option/need that is not offered/met in the available packages or you cannot wait for the vesrion to be included to the repositories, I suggest you go with the pre-build binaries.
Then again, compiling from source code is a great character building experience that will help you appreciate the hard work package maintainers do :-) You will have to resolve any package dependencies manually.
That being said, large and active projects like Apache, PHP and MySQL offer quite exhaustive documentation and how-to's for installing from source.