Creating a webpage

From Redbrick Wiki
Revision as of 02:36, 20 April 2007 by Receive (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is an introduction to HTML tutorial. It is a simple guide to getting a simple website up and running under your account on redbrick.

Where will the webserver look for your site?

To access your website type: www.redbrick.dcu.ie/~username

The webserver will automatically look for the public_html folder in that users home directory. It then looks for the index file in that folder. If it can't find either of them it will return an "Error 404" Requested URL Not Found.

Permissions for your website

It is important to make sure the webpages have the correct permissions. A lot of the time, the permissions are wrong meaning they can't be seen on the web. To solve this remember the following bit of information.

For your webpages to be seen you need to make sure your permissions are correct. Your public_html folder needs to be readable, writable and executable to yourself and executable to everyone else. The files in your public_html need to be readable and writable to yourself but only readable to everyone else.

  • chmod 711 ~/public_html
  • chmod 644 ~/public_html/index.html

Setup Code

Once that is okay, all you have to concentrate on is your index.html and/or the other pages you wish to put on the web. Here's some html code to get your feet off the ground.
Using your favourite text editor (nano and vim are both installed on redbrick). Create a file in your public_html folder called index.html and insert the following code.

 
<html>
<head> 
<title> Title of page </title> 
</head>
<body> The actual webpage goes in here </body>
</html>

The <head> and </head> tags tell the Web browser where the HTML in your document starts and finishes. After the <html> is where all the document's information should go. Between <title> and </title> is where the title of your page should go. This appears in the bar at the top of the browser. After these come the <body> and </body> tags. This is where you put the information you want displayed on the actual webpage itself. It is important to make sure to close all the tags in the right order i.e if you open a head tag and then a title tag, you have to close them in the order title then head.

Finale

This is just a basic introduction to get you on your feet. There are loads of sites with further detail. If you need a hand, feel free to get in contact with a member of helpdesk.