Before learning how to write the “path” of a URL (an example of a url is http://www.sfc.keio.ac.jp/ , we need to learn how a computer manages files. A file system on a computer controls how to store and retrieve data from a disk.
“Treasure hunting game”, refer to page 32 of the slides below
Making the file Accessible from the Internet
The pages we have made in class were only visible by yourself. Depending on the privilege, some people might be able to access to the file but even that is restricted to people logged in on CNS.
Let’s try making the file accessible through the internet from all over the world. We will learn about its mechanism in Fundamentals of Information Technology 2.
On SFC-CNS, we can make a file accessible by placing it in a particular directory.
- The absolute path of the directory is
- On the iMac, it can be found under
When accessing the file from a browser, the address is
ex03-1.htmland fill in the following.
1234567891011121314<!DOCTYPE html><html><head><meta charset="utf-8"><title>Exercise 03-1</title></head><body><h1>Exposing to the Internet</h1><p>foo bar</p></body></html>
- Change “foo bar” to a word that you like.
- Move this file under
http://web.sfc.keio.ac.jp/~(login ID)/ex03-1.htmlvia a browser.
- Access your neighbour’s page.
When making a directory under
public_html, the URL path will be the same as the relative path from
public_html. For instance, if you were to make a directory
public_html, and place a file
hobby, the URL should be
- Make a directory
Did the URL of
ex03-1.htmlchange? Try accessing the file with a browser. Try accessing your neighbour’s as well.
HTML stands for HyperText Markup Language, but, what is Hypertext? Hypertext is a text that contains links(hyperlinks) and can jump to other linked texts.
Are there any problems to link pages without authorisation? According to the Copyright Law, it is interpreted that there are no problems, but if there are any specifications you should morally respect them.
Specifying an URL
URL stands for Uniform Resource Locator and it is like an address of a webpage. For example, the URL of SFC’s homepage is
A normal URL looks like the following.
- The “scheme”(protocol) specifies how a browser should fetch the source. Normal webpages use “
http:“, but in the case of fetching an encrypted page(like net banking) we use “
https:“. When opening a file, we use “
file:“, which means that the browser will fetch the file without connecting to the internet.
- The host is the name of each computer, and specifies in which computer should receive the source from. If the scheme is “file:”, then the host is always local so there is no need to write the host.
- The path specifies which file in the computer is supposed to be fetched.
We will learn about in details about scheme in Fundamentals of Information Technology 2.
Absolute URL and Relative URL
Because an URL is like an address, we can specify the one webpage from pages all over the world, but inevitably the address itself gets longer and longer. When specifying a house in the neighbourhood, we can say, “two houses next door from my house”, instead of “… Shonandai, Fujisawa-shi, Kanagawa”. The same goes for URL, and there are ways to access a webpage without typing in the full address.
http://itclass.sfc.keio.ac.jp/guide/index.html is an “absolute url” which can be accessed from anywhere, and
new.html is a “relative url” which can only be accessed when linked from
- Positive Points about an Absolute URL
- It can specify any webpage in the world.
The same URL can be used to be linked from any other pages.
- Positive Points about a Relative URL
- It is shorter than an absolute URL.
As long as the relationship between each file doesn’t change, even if the website itself is relocated, there is no need to relink each file.
Note that the format of the relative URL is consistent with the directory structure, which you have studied in “File System” part above.
http://itclass.sfc.keio.ac.jp/guide/too, but this happens because you are relocated from a different page, and the actual URL is
Relationship of File system and URL
- When the protocol is
file:, the absolute URL is
file://followed by the absolute path. For example, the absolute URL of
file:///xxx/yyy.html. Because there is no host name, remember to write three slashes after
- When the protocol is
http:, the absolute URL of a file depends on the setting of the web server. On a general web server, relative paths under a certain directory are used. The case of SFC-SFS will be explained later.
- With a relative URL, there is no need to type the protocol nor the host name. The relative path of the file system itself is the relative URL.
- Make a file
link.htmlin the same directory as introduction.html(Exercise 02-4).
12345678910111213<!DOCTYPE html><html><head><meta charset="utf-8"><title>Practicing Links</title></head><body><!-- Link your self introduction page here! --></body></html>
- Inside the body element, make a link to your self introduction page using a relative path.
- Open link.html via browser, click on the link, and confirm that you can jump to your self introduction page.
- Make a new directory
dirAunder the directory we have been working with.
link.htmlso that it to correctly jumps.
- Make a new directory
dirBin the same directory as
dirAand your self introduction page.
- Move your self introduction page under
link.htmlso that it correctly jumps.
- Let’s make a web version of the “treasure hunting game” introduced on the slides (‘File System” section above). The plan is to make a file
map.htmlunder each directory and connect them with hyperlinks.
- Let’s move the treasure hunting game to your own directory. Enter the following command on Terminal.
Shell1234mkdir /home/<CNS-ID>/public_html/info1cp -R /pub/sfc/ipl/ictf/exercise/islands /home/<CNS-ID>/public_html/info1(replace <CNS-ID> with your own CNS ID for example t15555xx )
mkdiris a command to create a new directory.
/home/is the special directory for publishing on the internet. .
cpis a command which copies files or directories. For the arguments, we write Copy From and Copy To.
-Ris an option which specifies to copy every file in the directory.
- Confirm that there is
- Make a file
map.html(with content below) inside the directory
12345678910111213<!DOCTYPE html><html><head><meta charset="utf-8"><title>Treasure Map</title></head><body></body></html>
- Make another
island-a(which is inside “islands”) , and fill in the following.
- A header “Map of Avalon”.
- A link that jumps back to starting point(
map.htmlinside the directory
- Make another file
port-a, and fill in the following
- A link to file
empty, which shows the text that depicts a “Treasure Box”.
- A link returning to “Map of Avalon”.
- A link to file
- Make pages for other islands and ports in the same way explained above. Try to make a shortcut from one port to another port in another island.
garbageare not HTML file, and they run in different ways depending on the browser. Firefox will show the containing text, and Safari will open the file with Finder.
You must always keep in mind of copyrights when exposing a webpage.
We are sorry that the video is only available in Japanese (licence related).
If you understand Japanese, “情報倫理デジタルビデオ小品集３” can be played on the iMac(Desktop→→ Watch the following parts and summarise the content.
If you understand Japanese, “情報倫理デジタルビデオ小品集３” can be played on the iMac(Desktop→
index.html). Watch the following parts and summarise the content.
- 12. アップしたビデオが著作権侵害！
- 27. Web貼りつけレポートはNG
- 29. ブログでメール紹介したらダメ？
- 30. Webカメラは肖像権を侵害？
(Due to license issues, the video can only be played on the iMacs in the Computer Room.)
Compulsory: (Watch in your own time) An English Video with similar contents is available here Information Ethics in the Digital Age
- What is the difference between a HyperText and a normal text?
- What is the difference between an absolute URL and relative URL?
- Why is the structure of files and directories called “Tree Structure”?
- What does “..” represent in a relative path?
- Which directory on SFC-CNS is published on the internet?
- What kind of rules are there in Copyright Law?
- Are there any exceptions in Copyright Law?