hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : VPS Hosting : VPS Tutorials : How To: Access and Edit Your httpd.conf
Reply

VPS Tutorials Tutorials related to VPS.
Forum Jump

How To: Access and Edit Your httpd.conf

Reply Post New Thread In VPS Tutorials Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 05-18-2006, 12:27 AM
diggleblop diggleblop is offline
WHT Addict
 
Join Date: May 2006
Posts: 166

How To: Access and Edit Your httpd.conf


For Apache VPServers running Linux. These are instructions to make your site allow more users to connect before it crashes. It has personally helped me a lot.

1. Login into your Putty. Putty SSH can be googled. Enter your username, then password and then type
Code:
su -
.

2. Copy this code
Code:
vi /etc/httpd/conf/httpd.conf
then right click on your putty window and it will enter it automatically. Press Enter.

3. You will be using Vi to edit your files.

4. Use your arrow keys to maneuver down to your MaxClients It will more than likely look like this: MaxClients 50

5. Position the blue or green cursor over the five, press i on your keyboard (this puts you in insert mode).

6. While on the number 5 you want to press the letter x on your keyboard.

7. Use your arrow key to the right over the number 0 and press x once more.

8. It may look like this MaxClients xx. Now backspace or delete the xx and enter nothing higher than 256. I have mine set at 250, a safe bet.

9. Pres Esc (this takes you out of insert or edit mode) and go down to the next column and repeat these instructions on the other MaxClients 50 because there are two.

10. Do not mess with any other setting unless you know what you are doing. It may look tempting to adjust some other numbers, but trust me, don't do it.


Here is a good VIM tutorial for editing.

Vi is an awesome text editor and a real necessity for a *nix SysAdmin. Here's a brief tutorial:

1.) To edit an existing file or create a new file just type vi filename.txt

2.) There are a few ways to exit Vi. If you simply viewed the file but didn't make any changes, you can just type :q to quit. If you made changes but don't want to save them, just type :q! (the q is obviously for 'quit' and think of the '!' as 'yes, I'm sure'. If you made changes to the file and want to write (save) them and quit, type :wq (for write and quit).

3.) When you open a file the first thing you'll want to do is be able to move around in the file. To move the cursor down, you can just hit enter, which will take you down one line, always keeping you at the beginning of the line. Another way to move down is to hit the j key. You can move up by hitting the k key. These keys are right next to each other, and when your hands are in the home position on the keyboard, your right index and middle fingers will already be positioned naturally on the j and k keys, so this is very convenient. You could also use the arrow keys to move around, but it is much easier to use j and k since your hand is already there!

4.) To move forward on a line, word by word, just hit w. To move backwards on a line, word by word, just hit b. Oh, and to jump to the end of the file, hit shift G.

5.) Searching for a certain word is another useful function. Simply type / and the word you want to search for. For example, if you wanted to find the word 'foo' you would type /foo and you'll go to the first occurence of that word. Hit n to go to the next occurence of the word, or N to go back to the previous occurence of that word.

6.) To delete a single character, move the cursor over it and then hit x. You can replace a letter with a different letter by hitting r (for replace) followed by the new letter you want. You can delete a word by hitting dw (for delete word) while the cursor is anywhere on it. Or you can delete a whole line by hitting dd. By the way, you can add numbers before the d to delete multiple words or numbers. For example, 5dd deletes 5 lines. 5dw deletes 5 words.

7.) If you make a mistake, just hit u (for undo).

8.) If you want to add text, you will need to enter insert mode (so far you've been in command mode, which is the defaul mode). To enter insert mode, hit i. You can then type in text. To exit insert mode and go back to command mode, just hit the Esc key. Since you've made changes to the file, don't forget to hit :wq when you're ready to quit (that way your changes are saved).


Once you get accustomed to vi, you might like to use a few more shortcuts. I use these a lot, personally.

These commands are used in the default mode (NOT edit mode)...

If you want to copy and paste 1 line of text, type yy then p to paste after the line on which your cursor is sitting, or P to paste before the current line.

To copy 7 lines of text, use 7yy ... and so on....

What if you have a big file, and you want to go to line# 4359? Type :4359 [enter]
What if you want to go to the last line in the file? :$ [enter] ... then you want to go back to the first line? :0 [enter]

Want to know what line# number you are on? :nu[enter] Want a word/line count? g CTRL-g

If you want to save and exit the file, simply type: ZZ
If you want to discard any changes to the file and exit, type: ZQ


Here's a formatting tip. If you use [tab] a lot to keep code and config files readable, maybe you don't like the default tab width (I know I don't, it's way too big). You can set the tab size with this command et tabstop=N --where you want to set tab equal to N spaces. If you'd like to have this always, type :mkvimrc ( or maybe add set tabstop=N to ~/.exrc if you're using a silly vi clone).

Like wordwrap? (or not?) et wrap or et nowrap


Last edited by diggleblop; 05-18-2006 at 12:31 AM.
Reply With Quote


Sponsored Links
  #2  
Old 03-18-2007, 10:24 PM
diggleblop diggleblop is offline
WHT Addict
 
Join Date: May 2006
Posts: 166
Was this taken down?

Reply With Quote
  #3  
Old 04-02-2007, 12:43 AM
That Guy That Guy is offline
Over there
 
Join Date: Oct 2004
Location: LA, CA
Posts: 1,058
Very nice tutorial, helped me out a bunch. Thanks!

Reply With Quote
Sponsored Links
  #4  
Old 04-09-2007, 01:05 AM
s3bhost s3bhost is offline
New Member
 
Join Date: Apr 2007
Posts: 1
Hi,

pico /etc/httpd/conf/httpd.conf

Take the change ...

Timeout 200
KeepAlive On
MaxKeepAliveRequests 200
KeepAliveTimeout 3
MinSpareServers 5
MaxSpareServers 15
StartServers 5
MaxClients 20
MaxRequestsPerChild 2000
HostnameLookups Off

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Windows Azure Processes 4.7 Billion Authentication Requests Weekly Web Hosting News 2012-11-27 17:21:03
Cloud Software Provider GreenButton Launches Cloud Fabric Server Platform Web Hosting News 2012-11-06 17:11:09
Microsoft Planning Online Windows Azure Conf, Targeting Cloud Developers Web Hosting News 2012-11-05 16:29:26
Apache Web Server Adds Cloud Capabilities with First Major Update in 5 Years Web Hosting News 2012-02-21 16:05:02
Oracle is the Latest Vendor to Apply Patch for Apache Killer Flaw Web Hosting News 2011-09-19 14:43:58


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?