the server keeps crashing due to apache, is there any way i can stop this, the server has 2GB swap space and 3GB ram
May 25 03:33:41 server kernel: [ 3513.200719] [<c015959c>] out_of_memory+0x14e/0x17f
May 25 03:33:41 server kernel: [ 3513.211491] Out of memory: kill process 2936 (apache2) score 87364 or a child
May 25 04:35:30 server kernel: [ 7239.936995] [<c015959c>] out_of_memory+0x14e/0x17f
May 25 04:35:30 server kernel: [ 7239.948878] Out of memory: kill process 2936 (apache2) score 88236 or a child
May 25 05:42:57 server kernel: [11210.572510] [<c015959c>] out_of_memory+0x14e/0x17f
May 25 08:13:23 server kernel: [ 0.000000] PM: Registered nosave memory: 00000000000a0000 - 0000000000100000
Firstly, note that the OOM killer is simply killing Apache processes because it needs extra memory - it's not necessarily that Apache is the guilty party in consuming all the memory on the system.
That said, you should limit the number of Apache processes you allow to spawn. Your /etc/apache2/apache2.conf will have sections for Server-Pool Size Regulation (assuming you use the default MPM configuration); this will specify the maximum number of worker threads and processes Apache may grow to.
If the (MaxClients * memory per client) is larger than will fit in (physical memory - all other applications), it's too large. Most likely you've got it set for defaults that let Apache consume all the available memory, and the OOM killer comes to town.