idiot's(me) UNIX question

Discussion in 'OT Technology' started by bruiser, Aug 23, 2004.

  1. bruiser

    bruiser I am he as you are he as you are me and we are all

    Joined:
    Aug 23, 2003
    Messages:
    7,095
    Likes Received:
    0
    Location:
    Wooston
    so I just started using UNIX to make a webpage and host some files. The instructions the university gave is to call the first page everyone sees index.html. Only problem is they never put how to make a index.html page. So my question is how do you make an index.html page in UNIX?

    thanks.
     
  2. MP

    MP New Member

    Joined:
    Sep 10, 2002
    Messages:
    34,377
    Likes Received:
    0
    Location:
    Silicon Valley
    open up a vi session (just type vi in console)

    <html>

    <font color=#000000>penis penis penis</font>

    </html>

    quit and save as index.html :wq


    upload to home directory

    done
     
  3. bleak

    bleak Guest

     
  4. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    ibEmacsnazis :mamoru:
     
  5. WERUreo

    WERUreo Imua!

    Joined:
    Oct 15, 2003
    Messages:
    566
    Likes Received:
    0
    Location:
    Daytona Beach, Florida
    IBheactuallyputspenispenispenisonhishomepage
     
  6. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,278
    Likes Received:
    555
    Pico really is better for this kind of basic stuff. The only problem is that it's not always installed. vi is ALWAYS there.

    You could do it with echo, of course:
    Code:
    echo "<html>" > index.html
    
    echo "<font color=#000000>penis penis penis</font>" >> index.html
    
    echo "</html>" >> index.html
    
    :mamoru:
     
  7. WERUreo

    WERUreo Imua!

    Joined:
    Oct 15, 2003
    Messages:
    566
    Likes Received:
    0
    Location:
    Daytona Beach, Florida
    Yeah, I remember vi being a bitch to learn when I first ventured into Unix... I used to always use pico.

    EDIT: Oh, and I forgot to mention it before... Should we really be teaching him improper HTML?? :)

    Code:
    <html>
    <head><title>penis penis penis</title></head>
    <body>
    <font color="#000000">penis penis penis</font>
    </body>
    </html>
    
    :cool:
     
  8. Aimless

    Aimless Resident drunkey

    Joined:
    Nov 5, 2001
    Messages:
    2,534
    Likes Received:
    0
    Location:
    Wisconsin
    Should we really be teaching him HTML at all?
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head><title>penis penis penis</title></head>
    <body>
    <p style="color:#000000">
    penis penis penis
    </p>
    </body>
    </html>
    
    :wiggle:
     
  9. WERUreo

    WERUreo Imua!

    Joined:
    Oct 15, 2003
    Messages:
    566
    Likes Received:
    0
    Location:
    Daytona Beach, Florida
    Touche
     
  10. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    That's because vi > * :mamoru:

    Still no Emacs nazis :eek3:
     
  11. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,278
    Likes Received:
    555
    vi is only the best when you're doing lots of edits that can be described as regexes. For simple stuff like writing a short webpage, pico is way better.
     
  12. zeroace

    zeroace ..........

    Joined:
    Jun 1, 2003
    Messages:
    1,450
    Likes Received:
    0
    Location:
    Ontario
    :rofl: :rofl: :rofl: at the penis penis penis examples.
     
  13. bleak

    bleak Guest

    Pico > * (unless you have a GUI installed (KDE), then Kate and Quanta are really nice)
     
  14. crontab

    crontab (uid = 0)

    Joined:
    Nov 14, 2000
    Messages:
    23,443
    Likes Received:
    12
    ed > *
     
  15. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    :dunno: I've never used Pico. I use vi on the command-line and nedit if I want a GUI editor. Which is almost never.
     
  16. bruiser

    bruiser I am he as you are he as you are me and we are all

    Joined:
    Aug 23, 2003
    Messages:
    7,095
    Likes Received:
    0
    Location:
    Wooston
    I think there was a nerd fight in here, but thanks dawgs!
     
  17. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    55,922
    Likes Received:
    10
    Location:
    Los Angeles
    Index.html is automatically generated once Apache is installed.
     
  18. Aimless

    Aimless Resident drunkey

    Joined:
    Nov 5, 2001
    Messages:
    2,534
    Likes Received:
    0
    Location:
    Wisconsin
    :ugh:

    Who says he's using Apache?

    Even if he is (which I doubt), it only puts the that default "Welcome to Apache" index.html in the document root, not the home directories of each of the users.
     
  19. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,278
    Likes Received:
    555
    No it isn't. The apache test page is an error page that's displayed automatically when there is NO index.html.
     
  20. Aimless

    Aimless Resident drunkey

    Joined:
    Nov 5, 2001
    Messages:
    2,534
    Likes Received:
    0
    Location:
    Wisconsin
    :hs: I don't believe that's true either

    If mod_autoindex is enabled, a listing of files is generated. If it isn't, a Not Found message is displayed.
     
  21. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,278
    Likes Received:
    555
    Sorry, but it's true. From httpd.conf:

    <LocationMatch "^/$>
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
    </LocationMatch>

    <apachedir>/error/noindex.html is the apache test page.
     
  22. Aimless

    Aimless Resident drunkey

    Joined:
    Nov 5, 2001
    Messages:
    2,534
    Likes Received:
    0
    Location:
    Wisconsin
    Wierd, I've never seen that before. What distro & Apache version are you running?

    Debian w/ Apache 1.3.x :

    [email protected]:/etc/apache$ cat httpd.conf | grep noindex
    [email protected]:/etc/apache$
     
  23. Penguin Man

    Penguin Man Protect Your Digital Liberties

    Joined:
    Apr 27, 2002
    Messages:
    21,696
    Likes Received:
    0
    Location:
    Edmonton, AB
    Same here, running Apache 2 on SuSE.
     
  24. Joe_Cool

    Joe_Cool Never trust a woman or a government. Moderator

    Joined:
    Jun 30, 2003
    Messages:
    299,278
    Likes Received:
    555
    fedora core 1, apache 2.0.49
     

Share This Page