11---
2- title : ' Web server '
2+ title : ' Web Services in a Container '
33teaching : 10
44exercises : 2
55---
@@ -14,19 +14,131 @@ applications by passing the input the user gave via the URL. The software then p
1414the input and provides a suitable response.
1515
1616
17- ## Where I can get a server?
17+ ## Where I can get a server?
1818
1919Any PCs which is connected to the Internet could act as a server, but you will
20- usually require one with suitable specificaitons depending on the software
21- that it needs to run. There are also virutal servers which commercial
20+ usually require one with suitable specifications depending on the software
21+ that it needs to run. There are also virtual servers which commercial
2222companies provide access to. This are normally focused on web-hosting,
2323and provide GUIs to easily deploy websites and other common types of software.
2424
25- To learn how web severs work, we will deploy a basic solution
26- in this tutorial using a container platform. A ** software container** is a readily-made
27- software system which already includes all the software dependencies
28- and configurations required to run. The software docker is a popular
29- system to create and deploy containers. So, we will use thos
25+ ## Meanwhile, how can I learn to serve multi-dimensional content
26+
27+ To learn how web severs make available multi-dimensional data
28+ for storytelling, we will deploy a basic solution
29+ in this tutorial using a ** software container** platform.
30+
31+ A ** software container** is a readily-made
32+ software which delivers to the user a software,
33+ its environment, the dependencies and
34+ the configuration required to run in a package called container.
35+ The software [ Docker] ( https://www.docker.com/ ) is a popular
36+ system to create and deploy containers.
37+
38+
39+ [ ![ Containers video] ( https://i.ytimg.com/vi/HelrQnm3v4g/maxresdefault.jpg )] (https://www.youtube.com/watch?v=HelrQnm3v4g "How can software containers help your research? © ;
40+ Australian Research Data Commons - ARDC")
41+ How can software containers help your research? © ;
42+ Australian Research Data Commons - ARDC
43+
44+
45+
46+ To run a container, you will need to have installed Docker in your laptop or
47+ PC.
48+
49+ ## Starting a basic web server container in Docker
50+
51+ Open Docker Desktop, and look for the search bar.
52+ This allow you to search for already packaged contaners in [ Docker Hub] ( https://hub.docker.com/ ) . Type in the Search textbox the following
53+ container: ** karinardz/local-web-server**
54+
55+ ![ Search in Docker Hub for karinardz/local-web-server] ( fig/searchinbar.png ) {alt='Download local-web-server.'}
56+
57+
58+
59+ If you know how to use the command line,
60+ you can also call commands from Docker
61+ through the command line:
62+
63+ ``` console
64+ foo@bar:~ $ docker pull karinardz/local-web-server
65+ ```
66+
67+ Once you pull the image you should be able to see this in
68+ your Docker list of images.
69+
70+ ![ Docker Desktop application showing karinardz/local-web-server image has been downloaded] ( fig/imagesweb-server.png ) {alt='Local local-web-server.'}
71+
72+
73+ To run the container, click on the * Play* button, and specify the following
74+ Optional Settings before clickin on * Run* (see image below):
75+
76+ - Container name: my-local-webserver
77+ - Ports: 80
78+ - Volumes: select the folder where you created an HTML page
79+ - Container path: /var/www/html
80+
81+
82+ ![ Docker Desktop 'Run a new container' interface to input parameters] ( fig/dockervar.png ) {alt="variables web server docker"}
83+
84+ Finally, open on the browser the URL: [ http://localhost:80 ] ( http://localhost:80 )
85+
86+ ![ Browser showing the index.html page on the local web server] ( fig/webseverhtml.png ) {alt="local web server created by Docker"}
87+
88+
89+ ::::::::::::::::::::::::::::::::::::: challenge
90+
91+ ## Challenge: Add a new page
92+
93+ Create another HTML page in your folder, copy-pasting the same code.
94+ You can add some more text or other elements.
95+
96+ See: [ https://www.w3schools.com/html/html_elements.asp ] ( https://www.w3schools.com/html/html_elements.asp )
97+
98+ Name this new file: * page1.html*
99+
100+ Link the new page from the main * index.html* page.
101+
102+ :::::::::::::::::::::::: solution
103+
104+
105+ From the main file, you can link to the new page by adding:
106+
107+ ``` html
108+
109+ <a href =" page1.html" >Access more information</a >
110+
111+ ```
112+
113+
114+ :::::::::::::::::::::::::::::::::
115+
116+ ::::::::::::::::::::::::::::::::::::: challenge
117+
118+ ## Challenge: Add a new image
119+
120+ Copy an image into your same folder.
121+
122+ Link the image from the main * index.html* page.
123+
124+ :::::::::::::::::::::::: solution
125+
126+
127+ From the main file, you can link to the new page by adding:
128+
129+ ``` html
130+
131+ <a href =" myimage.png" >This is my new image</a >
132+
133+ ```
134+
135+
136+ :::::::::::::::::::::::::::::::::
137+
138+ ::::::::::::::::::::::::::::::::::::::::::::::::
139+
140+ ::::::::::::::::::::::::::::::::::::::::::::::::
141+
30142
31143
32144## More information
0 commit comments