The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem Editing Apache

Discussion in 'Data Protection' started by bleeve, Mar 10, 2007.

  1. bleeve

    bleeve Registered

    Joined:
    Mar 10, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hey I know this is a stupid question but I forgot how to edit apache in shell. Im running centos with cpanel installed and need to undo some changes I did a while back in apache. What command am i supposed to type when im logged in as root and what do I do after I make the changes? Thanks for the help.
     
  2. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    By changes do you mean that changes were done in httpd.conf or while Apache compilation? If second one is the case then you can recompile apache by using /scripts/easyapache.
     
  3. bleeve

    bleeve Registered

    Joined:
    Mar 10, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    hey web thanks for the help. I edited the httpd.conf file and made some changes to max clients etc. so i just need to know what i need to type in shell to get to edit the httpd file and what to do afterwards to save it. Thanks
     
  4. kdarray

    kdarray Well-Known Member

    Joined:
    Apr 13, 2006
    Messages:
    81
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Washington
    Edit httpd.conf

    You need to edit your httpd.conf again and change the values that you put in earlier. The file should be located here:

    /usr/local/apache/conf/httpd.conf

    And you would use whatever text editor you prefer or have installed from the root such as vi, pico, nano.

    pico /usr/local/apache/conf/httpd.conf

    Be sure to make a backup copy of this file first incase you make an error you can't find or fix. To do this:

    cp /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf
    .bak
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    The location of your httpd.conf file is at:

    /usr/local/apache/conf/httpd.conf

    An alias location for the httpd.conf is:

    /etc/httpd/conf/httpd.conf

    (doesn't matter which location you edit -- same thing)

    For editing, I personally would use "vi" because it is by far the most
    powerful editing tool but as it requires a bit of formal training to use,
    you might want to use "pico" which is a regular text editor.

    IE: pico /etc/httpd/conf/httpd.conf

    Once you make changes to your httpd.conf file, you should check to make
    sure your changes don't break apache:

    /usr/local/apache/bin/apachectl configtest

    If all looks good (IE: syntax ok) then you should restart apache for your
    new changes to take effect:

    /usr/local/apache/bin/apachectl restart
     
Loading...

Share This Page