Saturday, April 23, 2011

Creating and Viewing a Personal Web page

The following are step-by-step instructions for creating your own WWW home pages on the Baruch linux lab server.
  1. Make sure you are in your home directory. If you have just logged in to and have issued no other commands, then you are in your home directory. To make doubly sure, just type:
    cd
    and press Enter. This command (cd by itself) returns you to your home directory.
  2. Create a new directory called public_html using the following command:
    mkdir public_html
  3. Change the permissions on this new directory to allow everyone (Owner, Group and World) to read and execute (allow directory search) using the following command:
    chmod 755 public_html
  4. Change to the public_html directory using the cd command as follows:
    cd public_html
  5. Now you can create any new WWW pages using HTML. For example, let's say you created a web page and named it:
    mypage.html
    Use the pico editor to create this simple page. Type: pico mypage.html and then when Pico starts up, type in the following HTML text: <HTML> <BODY> <H1>This is my first HTML Page</H1> <P> Here is some text in my page <P> <HR> <P> Bye for now </BODY> </HTML> Save this file and exit pico.
  6. Change the permissions of this file so others can read it:
    chmod 644 mypage.html
  7. To access this page while on Baruch's campus, the URL takes the form:
    http://10.2.86.39/~username/mypage.html 
  8. For example, if your username is billg and you made a page called mypage.html then your URL is: http://10.2.86.39/~billg/mypage.html 
  9. If you get an error in your web browser saying "Access is denied", then you will need to open up your home directory for public viewing. To do this, use the chmod command as follows:
    chmod 755 ~ 
    (the last character is a tilde    in UNIX it represents your home directory)
  10. Note that you can also create subdirectories under your public_html directory for different projects and collections of pages.

No comments:

Post a Comment