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.

How Can I Modify The "Httpd.conf"?

Discussion in 'General Discussion' started by heamon, Dec 11, 2006.

  1. heamon

    heamon Registered

    Joined:
    Dec 11, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I have bought the whm, but now, I want to modify "httpd.conf" add application/http .html
    but when I login with ssh, the file httpd.conf can't be modified, it says permition defined

    Can you help me ,tell me how can i change the httpd.conf , and can i use cpanel to change it ,and how to do?

    thank you!
     
  2. markfrompf

    markfrompf Well-Known Member

    Joined:
    Mar 27, 2006
    Messages:
    176
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Los Angeles, CA
    You should be able to mod the file in SSH. Make sure you're logging in as "root."

    If you are logged in as "root" and are still having problems, there is a serious issue.

    If you don't have root access, make sure you have full ssh access with no restrictions.

    You should be able to use pico and edit it.
     
  3. heamon

    heamon Registered

    Joined:
    Dec 11, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    the problem is also

    I have the root , but the problem is still, how should I do?

    Is ssh's problem?
     
  4. tweakservers

    tweakservers Well-Known Member

    Joined:
    Mar 30, 2006
    Messages:
    379
    Likes Received:
    0
    Trophy Points:
    16
    the httpd.conf might only have the read only read attribute, try running the following command as root to see if it helps:

    chattr -i httpd.conf

    after that edit and save the file
     
  5. heamon

    heamon Registered

    Joined:
    Dec 11, 2006
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I Have Do That ,But Wrong!

    I Have Do That , But The Wrong Is "chattr: Permission denied while reading flags on httpd.conf
    "

    Why?
     
  6. Shinichi Kato

    Shinichi Kato Well-Known Member

    Joined:
    Mar 7, 2005
    Messages:
    73
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Saitama-ken,japan
    Uid 0

    Are your "root" UID 0?

    grep root /etc/passwd

    The result

    root:x:0:0:root:/root:/bin/bash
     
  7. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    What do you see when you type "whoami"?

    If you are not connected as "root" then that is your problem.

    The fact that you can't edit httpd.conf and you don't have permission
    to use the chattr command on httpd.conf makes me suspect that you
    are not actually logged in as root but rather some other user.

    Now, you said something else that puzzles me ....
    Why in the world would you be trying to add a line that is already in the httpd.conf file?
     
  8. k1k

    k1k Active Member

    Joined:
    Mar 24, 2006
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    The htpd.conf

    You should use ssh connection and login as root user to your server. Then you can use any text editor in order to modify your httpd.config file (vi,vim,pico,nano,mcedit...).
    And the chattr command... It will work only if your filesystem is ext3. If you are using reiserfs - then you wont be able to set chattr flags.
    So here is one simple example if you want to be sure that everything is ok with your file permissions.


    cp -ar /usr/local/apache/conf/httpd.conf /usr/local/apache/conf/httpd.conf.1
    rm -rf /usr/local/apache/conf/httpd.conf
    cp -ar /usr/local/apache/conf/httpd.conf.1 /usr/local/apache/conf/httpd.conf

    If you have no errors then you will be able to edit your config also ...
     
Loading...

Share This Page