Webhosting - digital garden

From Modding Fridays
Jump to navigation Jump to search

What is a digital garden?

A digital garden is an online space that is somewhat inbetween a notebook and a blog, where digital gardeners (you) share seeds of thoughts to be cultivated in public.

A website is typically a somewhat hierarchical space, one where the creator curates content. Now it is our challenge to think of the webpage as a space for collectiveness. You'll be working together on cultivating a digital garden. What this entails is up to you.

Examples

Serving content

1: To connect with the phone with SSH you need to connect both the phone and the computer to the same network. On the phone use volume up or the gestures to navigate through the menu. Go to Networks->add WPA network and select the network you want to connect to. In our case well use bridgenet, enter the password (interaction). Then connect the computer to the same network.

2: Find IP on the phone; navigate the menu to networks>Ifconfig> then look for wlan0 and find the inet address in my case the inet address is 192.168.1.203.

3: In order to ssh into the phone you will open the terminal on the computer and type the following command (change IP accordingly):

 $ ssh user@192.168.1.203 

You will be asked to enter a password. The default password on the user account on PMOS is 147147.

4: Install ngnix in order to install ngnix we will use the following guide:
https://wiki.alpinelinux.org/wiki/Nginx

5: After this we will need to disable the firewall on PMOS, this is done with the following command:

 $ sudo rc-service nftables stop 

6: After this you can visit your website hosted on the phone using the IP address. To do so open a browser and enter the following: http://192.168.1.203 (change IP accordingly) If all is right you should see a webpage displaying the following text: Server is online

7: We still need to make sure that nginx will run on every boot. (So if the device restarts, the server will do so as well) To do so enter the following command:

 $ rc-update add nginx default 

We need to make sure that the firewall is disabled on every boot as well, enter the following command:

 $ sudo rc-update del nftables 

In order to test that this is running well enter the following command:

 $ reboot 

The phone will now reboot and the ssh connection will be broken, once the phone has restarted, refresh the webpage mentioned in step 6 to see if the webpage is still displaying the following text: Server is online.

Yay! You're serving content!

Now we must change the html and css of the page, so we can build our own website!

Quick start guides

HTML quick start
CSS quick start

Stealing a website

You can check the html/css of any website. So if you ever see something you would like to 'steal' you can use this guide.
https://ps.wdka.nl/wiki/Stealing_A_Website

Misc Notes

Firewall

If you want to keep the firewall running you need to make a rule for accepting HTTP and HTTPS traffic.

  • create the following config file /etc/nftables.d/60_http.nft with the following:
#!/usr/sbin/nft -f

table inet filter {
        chain input {
                # allow ssh
                tcp dport { 80, 443 } accept comment "accept HTTP and HTTPS"
        }
}
  • restart nftables
sudo service nft restart