MaxClients exceeded error in apache

Ever see an error in your log files that says you have exceeded your Max Clients? This is a simple problem; the most common configuration of apache is 10. If you have enough traffic on your website this simple setting can put your out of business. To fix this just change the number. You can find your configuration file at /etc/httpd/conf/httpd.conf. I would recommend that you use a simple editor to touch this file, like VI. Be sure to understand the commands of VI before editing any files. You will have to be logged in as Root or Super User to access this file.

Here is a few tips for editing a file with vi, to make the change we where just talking about. Do this.

vi /etc/httpd/conf/httpd.conf

Now you can see the contents of the file, make sure that you do not get a read only message. If you do, nothing you change can be saved.

To search for the line you are trying to edit, type this.

/MaxClients

The / command will search for anything after the slash.

With the arrow keys on your keyboard go to the number in this case ten, move your cursor below the first number. In this case 1.

The “x” lower case, command will erase a character at a time. Once you have removed both characters you want to put in a new number.

To do this hit “i” lower case, this is the insert command. After you hit “i” type in your number, say 25. You must hit escape to stop inserting.

Now if all is clean you need to exit the program, to do this type in “:wq”, the w stands for write, the q stands for quit. Now you will have to restart apache for this to take affect. Depending on how Apache is configured there are many ways to do this. If you have PLESK installed I would restart apache with PLESK. Restarting anything at the command prompt should not be taken lightly.

Obviously remove the “ quotes surrounding each command

Leave a Comment