Apache, especially in pre-fork MPM used by many LAMP setup by default, is very inefficient in memory usage. There are many good all-purpose web servers that can run on very small amount of memory.