Best way to edit root files like my.cnf and httpd.conf

Discussion in 'Site & Server Administration' started by mdvaldosta, Dec 22, 2005.

  1. #1
    I downloaded putty and can find my way around the commands to navigate to the files, but I really don't like the interface and don't know how to properly edit them.

    I really just want to download the file, make the edits, and upload them back. I've got some optimization to do on my server and want to do this the right way.
     
    mdvaldosta, Dec 22, 2005 IP
  2. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #2
    1st rule: Make a backup: cp filename newfilename.whatever
    2nd rule: If you're not familiar with VI , don't use it. Use Pico:
    pico filename

    There are commands at the bottom of the text editor. Very simple to use.
     
    flawebworks, Dec 22, 2005 IP
  3. mdvaldosta

    mdvaldosta Peon

    Messages:
    4,079
    Likes Received:
    362
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Pretend your a beginner and try to give more detailed instructions. I've never used this before.
     
    mdvaldosta, Dec 22, 2005 IP
  4. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #4
    LOL... that's exactly how I was told.

    Login as root
    say you're going to edit httpd.conf
    (altho if you're a beginner at this you really shouldn't mess with the httpd.conf file - or any system file)
    You would make a backup of the file: say cp httpd.conf.backup (that's telling unix/linux to copy the httpd.conf file to httpd.conf.backup)
    pico httpd.conf
    Make your changes - carefully.
    ^X - ctrl X will exit you out of the file. You'll get a choice to save the file.

    If you do a man pico while logged in via ssh, you'll get a help file. A tad cryptic.
     
    flawebworks, Dec 22, 2005 IP
  5. mdvaldosta

    mdvaldosta Peon

    Messages:
    4,079
    Likes Received:
    362
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Your correct I don't know anything about those files, but I do have a recommended tweaked setting for my server that I'd like to run. Also for the my.cnf especially I want to turn the mysql caching on.

    Thanks, got it figured out and the files edited. It was a pretty simple thing, I was just alittle intimidated. Oh, by the way, mysql with query caching is the bomb.
     
    mdvaldosta, Dec 22, 2005 IP