MySQL (and MariaDB) and Apache have posted hardware recommendations.
If you're going to run both on the same server the I would suggest that you might want to size the server using both of those added together as your starting point.
If your running a VM scaling up/down should be no issue.
If your running dedicated physical hardware, well to be honest any server grade hardware you buy will likely be overkill.