The following are step-by-step instructions for creating your own WWW home pages on the Baruch linux lab server.
- 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. - Create a new directory called
public_html
using the following command:
mkdir public_html
- 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
- Change to the
public_html
directory using thecd
command as follows:
cd public_html
- 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. - Change the permissions of this file so others can read it:
chmod 644 mypage.html - To access this page while on Baruch's campus, the URL takes the form:
http://10.2.86.39/~username/mypage.html
- For example, if your username is
billg
and you made a page calledmypage.html
then your URL is:http://10.2.86.39/~billg/mypage.html
- 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) - Note that you can also create subdirectories under your public_html directory for different projects and collections of pages.
No comments:
Post a Comment