Trying to connect ethernet shield to local apache server

Are you certain the server is listening to this port? Apache normally listens to port 80.

 if (client.connect(server,8888)) {