ubuntu is just fine. you grab the mini.iso, install only the stuff you need and done.
stay away from eye-fancy, eats up ram + cpu. if you want to have no gui at all, do not install anything that sounds like 'x'. if you want a little bit of gui, install something like fluxbox, openbox or something similar.
any other distro is fine as well, as long as you start minimal and grow as you need. every sane distro has a package manager. the name of it is different, the syntax of how to use it is slightly different but at the bottom they are all the same:
% sudo apt-get install libapache2-mod-perl2
% sudo apt-get install libapache2-mod-php5
(ubuntu's apt-get at work, will fetch needed runtime dependencies as well, apache2in this case)
what's important to keep in mind: the number of packages available in your distro is essentially the limit of how far you can go. the officially labeled 'lightweight' distros are a bit crippled in that aspect. if you start minimal with a bigger distro you can grow without much hustle, with the smaller ones you will end up either switching or compiling all your stuff yourself (which is ok if you want to learn, burn time or anything in between)