---
# System prepended metadata

title: Internal Assesment
tags: [Computer science]

---

# Criterion C
For this Internal Assesment, like I have previously mentioned, I will be using a Raspberry Pi. In order to install a webserver in this Pi I will need to use Apache, which is a free HTTP Server Project. For this first step, I will merely be hosting the webserver to make sure it works.

The first step is to get the Raspberry's IP adress, which we do by entering "ifconfig" in the command promt

Next we log in to the Raspberry via the command ```ssh [NAME]@[IP ADRESS]``` where the default [NAME] = "pi" and [IP ADRESS] in my case is 192.168.0.22. After this there is a password request in which the default password is "raspberry"

After this log in, we check that we have the latest software by typing ```sudo apt update```, and if there are pending updates we type ```sudo apt upgrade``` which was not necessary in my case.
![image](https://hackmd.io/_uploads/rywc3bXUC.png)

We now install apache via the command ```sudo apt install apache2```, and verify its functionality with the command ```systemctl status apache2```

We then run ```vim /etc/apache2/sites-available/000-default.conf``` to locate the default configuration file. In this read-only-file, copy the DocumentRoot and acces its directory by ```cd [DocumentRoot]``` followed by ```ls``` to see that we actually have an HTML file.

We can now type the IP adress into the search bar and we can see the default landing page of our Apache website

Now that we have confirmed that a webserver is running at our RaspberryPi's IP adress, we can mess around with the GUI just for as proof of concept. FIrst type ```sudo chown pi:pi .html``` to change the ownership of the html ownership to the PI user simply because it makes coding easier. 

Next step is to create a new index file. We do this by first typing ```ls``` to show the empty original index file, deleting it with ```rm index.html```, which will pop a question stating "![image](https://hackmd.io/_uploads/Sk54uGQUR.png)". We type "y" at the end to represent yes and then retype the ```ls``` command to check that the file has been deleted. Now we create our own ```vim index.html```

Now that we have created a new index file, we can put our own code for our website page. I will be using some very short simple code as proof of concept.
```html
<!DOCTYPE html>
<html>
<head>
<title>Welcome to my Raspberry Pi!!</title>
<style>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
    }
</style>
</head>
<body>
<h1>Welcome to my Raspberry Pi!!</h1>
<p>Hello world. This website is being served from Apache on my Raspberry Pi.</a>
</body>
</html>
```
![image](https://hackmd.io/_uploads/SynXqfXUA.png)

NOTE: We type vi or vim depending on what text editor we are using
NOTE 2: Like I spoke to you in class, I was able to get some simulations running and checking my work in other places but I am unable to officially run anything on the actual PI for now due to the fact that I am missing a connector necessary to acces Raspberry OS. I only know some of the information and screenshots from a small test I did months ago.