Simplest way? Just start removing packages that you don't need. This sounds a lot like you're trying to make a recovery drive, so I'm making some assumptions based on that:
The X.Org server is the big kahuna. After removing that, you will not have any sort of graphical environment. It should also strip out any applications which are dependent upon it (i.e., all the graphical applications). apache2 and the mysql server might not be installed by default, but if they are you probably don't need them.
Make sure you're either well-versed in fixing ubuntu from the command line, or can easily restore a full ubuntu image to the drive and start over.