You certainly could turn it into a server, although it wouldn't come without its complications and it is not something I would recommend to someone who has never even tried it locally before. The services you will likely want are
Apache,
MySQL and
PHP. These services can either be built from source, downloaded as binaries or installed as a pre-built package such as
XAMPP.
Setting up a personal webserver as a new user is no simple task, so here's a few things you will have to consider:
1.
Security - You have to be able to secure your installations and know how to setup Apache and other services correctly to ensure that you wont be a victim of hacking.
2.
ISP - Most consumer ISPs do not allow access on port 80, which prevents you from running a web server. You will need to check with your ISP as to what their policies are in regards to running your own public webserver.
3.
Network Speed - The upload speed of your network needs to be able to handle the needs of your users. I suggest you go to a website such as
SpeedTest.net and run the test to find your upload speed, which will correspond to the maximum speed at which all your users combined could access your website. If it is less than 1, then it will really be very slow for your end users. The speed for numbers above this will depend on how many concurrent user you expect to have.
4.
Bandwidth - Like network speed, your bandwidth needs to be able to accommodate all your users. The amount you need depends on the site you are running: e.g. A small forum could make do with a few gigabytes per month whilst a video hosting site will use many times more.
5.
Computer Speed - Again, depending on your website type this may or may not be an issue. Your computer will be able to host a small site with a few users just fine, but as it starts to scale up you may find issues with your server processes locking up under the load.
6.
Network Setup - You need to be confident that you know how to setup your network to allow outside access whilst still remaining secure. This includes port forwarding and firewall setup.
7.
Utilities - This includes things like electricity bills that are needed to keep the computer running 24/7, you should look into this first as if it comes to more than $5 or so a month you would be better off going with paid hosting here. You should also consider fire safety when positioning your server: it needs plenty of fresh airflow, so a tight enclosed space like a cupboard wont do, it may be rare for a server to catch fire, but you can never be too careful with your own safety.
8.
IP/DNS - If you want to have a domain name you will have to setup DNS record that point to your IP address. If you have a static IP address this shouldn't be a problem at all. However, if you have a dynamic IP (i.e. One that changes every so often) you will have to use a service like
DynDNS to host the domain name
My suggestion would be to try installing Apache, MySQL and PHP either manually or as part of a package and run it only locally (i.e. Only access within your local network) and get to know how it all runs and works together. This is the best way to learn what the best ways of managing the server are and perhaps in the process you'll also learn what a difficult job the admins here have running the same thing for many thousands of users.
If you want to custom compile the server from source in Mac OS X,
DIYMacServer is a good site that'l walk you through custom building of the separate servers.
As for cPanel, I don't think that will be available without paying for it and setting it up yourself. The alternative will be to manually edit the preference files that control the servers or use a free one like
WebMin.
I hope this has helped.