SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Don't eat yellow snow spaceman's Avatar
    Join Date
    Mar 2001
    Location
    Melbourne, Australia
    Posts
    1,039
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Editing httpd.conf remotely on Linux + Apache machine

    I'm editing my httpd.conf file remotely in an SSH session (I've recently acquired my own dedicated server), but I find remote editing (vi, emacs, whatever) really tedious.

    If I want to edit it locally, I suppose I have to
    1. copy the httpd.conf file to the directory of one of my domains
    2. ftp the file down to me
    3. make the changes
    4. ftp it back from where I got it from
    5. copy it back to /usr/local/apache/conf

    Does anyone know a better way?
    Web Design Perth Melbourne .:. Itomic Business Website Solutions
    Drupal Experts .:. Drupalise

  2. #2
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ya I suppose that is the way to do it. Or you could just use the PICO editor which is a lot more easier to use than VI.

    If you dont know pico here are a few basic commands:
    pico httpd.conf will create/or edit if you are in the same directory as the httpd.conf file.

    Once the contents are displayed you can make changes there. Then if you want to save the file simply read the commands on the bottom of the file. Control-O writes out the file saving it for you. Control-X closes pico after you are done. Thats it! Two simple commands and the file is written.

    If you dont know editors now is a good time to start. Makes life much more tedious. Also here are a few good VI commands. ;-) PRACTICE PRACTICE!

    a - append after current cursor position
    A - append at and of logical line
    C - change to end of line (deletes from the current
    cursor position
    dG - delete from cursor to end of file.
    D - delete from cursor to end of line
    d0 - delete from cursor to beginning of line
    d$ - delete from cursor to end of line
    G - goto (if prepended by a number, go to that line
    number,else, goto the last line of the document)
    H - here (if prepended by a number, go to that line on
    the screen, else goto the first line on the screen)
    i - insert here
    I - insert at beginning of line
    J - append a cut or copy to the end of the line.
    o - add a line below
    O - add a line above
    p - paste (after current cursor position)
    P - paste (in front of current cursor position)
    r - change (allows you change a single character, hit
    ``r'' then the
    R - replace mode
    Y - yank the current line
    u - undo
    v - visual mode, you can highlight what you whant to
    copy
    w - move cursor to next word
    x - cut
    cw - change word
    dw - delete word

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2002
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ohh ooh ya and the one I really like in VI is the tab command.

    THIS IS ALL IN CAPS LOCK. ---- if you were to move your cursor to the start of this line in VI and hit tab it will remove the capitalization on the letter. Great for not having to retype the whole thing over! ;-)

  4. #4
    epsilon transition cupid's Avatar
    Join Date
    Aug 2001
    Location
    Kent, Ohio
    Posts
    367
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ..and remember, pico is a subset of the email reader Pine. If you don't use pine, pico will not be existent on your system.

    Pico gets the job done and it is more intuitive than vi, but it lacks a lot of capabilities that vi can manage.

  5. #5
    Don't eat yellow snow spaceman's Avatar
    Join Date
    Mar 2001
    Location
    Melbourne, Australia
    Posts
    1,039
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the advice.

    It still sucks though that, when you're used to using Notepad or Homesite like myself, remotely editing httpd.conf (or whatever) using vi or pico feels like going back to IT in the 60's :-)
    Web Design Perth Melbourne .:. Itomic Business Website Solutions
    Drupal Experts .:. Drupalise


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •