User:Sevgi/Server Baby

From XPUB & Lens-Based wiki
Vaio.png

Baby's first server


1222.jpg
what if a baby fresh out of the womb wanted to build a server? ..

links

https://how-to.computer/dokuwiki/prep/software

https://files.chalinebang.com/files/home/chalinebang/manual%20/

SSH

Hosting and serving

HUB

https://nginx.org/en/linux_packages.html

https://rufus.ie/en/

glossary

architecture this term is used in. blogs to talk about how the server computer is built and connected.(wiki)My laptop thingies
Bootable USB to make a USB ready for rebooting and installing a different os to a computer.
target computer where the server is based.
partition "Partitions are logical spaces where an OS, applications, files and other information resources are located."

source

vernacular what the hell does it mean...

notes

Vaio1.jpg

what did I do

12.02.2025

I read through Hosting and serving and Kim's resource. I wanna use debian and nginx because I know this is the server software and os we used for cerealbox.

Kim also suggested I look into this log: Chalien's grad project. It is a log of all terminal codes she set up for her own server project.

What I don't understand so far is why does she use nextcloud... To organise things? Not sure.. Something to ask Manetta :))


WHAT DO WE CALL THE SERVER????????

So Vaio is not good enough and Claudio suggests we call it the Neapolitan hey: https://glosbe.com/nap/it/uaglione

I want to do USB reboot thing. Claudio says I need to use one of these to make the usb bootable.

I tried using VENTOY for this. Rufus for windows.

Initial steps:

Download Rufus and Balena Etcher on server computer. Balena Etcher by itself wouldn't work for me.

Plug your USB in. Start Rufus and write the Debian .iso file in the USB.

When restarting your computer press the rebooting button(is gonna be sth like ESC, F10,F11, etc.-> Search for the right key to press)

Installing:

This is the tutorial I'm gonna follow : https://forums.debian.net/viewtopic.php?t=153625

DOES NOT works great!

I did it once without the steps and it was a shot in the dark and I chose all the wrong things.

Claudio is on the server comp and I am taking notes for now...

On Rufus we left all settings on default. https://github.com/pbatard/rufus/wiki/FAQ didn't help....

This is helpful : https://www.mattbutton.com/how-to-fix-balena-etcher-errors/


next door: Kim found a css declaration they didn't know before: scrollmargintop

I follow net-tools install instructions on the tutorial page, ifconfig doesn't work instead :

ip a

After this everything went downhill... The internet connection to my hotspot was very shaky. We didn't understand really what we were doing. We kinda tried to google all our errors, managed to connect to Fred's hotspot. I will try at home with my own wifi connection maybe that works better. But the config settings for that might be also very strange and hard to figure out. I don't know anymore...

What we found confusing was that we tried to connect to the server from the server itself so it wouldn't connect and by the time we understood what we were doing the connection was lost...

Claudio claims we managed at some point but I remember differently. Well, I will have a server weekend to sort it out.

Gonna try:

https://www.digitalocean.com/community/tutorials/initial-server-setup-with-debian-11

https://www.youtube.com/watch?v=B18SX08bjqg

https://computingforgeeks.com/install-and-use-networkmanager-nmcli-on-ubuntu-debian/(this code was how we made the connection work at the end with Fred <nmcli>)

https://pzwiki.wdka.nl/mw-mediadesign/images/d/d9/Install-myself-in-the-sandbox.pdf (mantas sandbox guide)

https://homebrewserver.club/demystifying-ssh.html#troubleshooting-ssh

User:Riviera/Setting up a nextcloud instance

13.02.2025

*Dan told me that there used to be servers for every apartment block in Romania so people could share files with each other... Amazing but I can't find any documentation on that. Archival Gossip.

Notes I took :::::::

  • changed hotspot name to: sevgi instead of Sevgi’s iPhone
  • connected on my computer and the server computer to the same hotspot
  • Installed:

sudo

network-manager

openssh-server

wpa_supplicant

  • tried logging into ssh@172.20.10.3

password failed?

Net-tools

sudo adduser sevgi

sudo usermod -aG sudo sevgi

apt install ufw > firewall

ufw allow OpenSSH

ufw enable

ssh 172.20.10.3 -l user(login as user)

  • permission denied……

sudo systemctl enable ssh

sudo systemctl start ssh

sudo nano /etc/ssh/sshd_config

  • >change PermitRootLogin to yes, Port 223

a little # appears after the root@growlmit:~#

This is what we want...

Sudo allow 223/tcp: allow rhe custom port into the firewall

systemctl restart ssh(systemcontrol restarts ssh)

first success :

ssh sevgi(username)@172.20.10.3(systemipaddress) -p223(custom port)

ssh-keygen -t ed25519

$ ssh-copy-id username@ip-address

cd /home/USER/.ssh/

ls

$ scp myfile hostname:/path/to/copy/file/to

$ nano ~/.ssh/config

Host growlmit

User sevgi

Hostname 172.20.10.3

Identityfile ~/.ssh/id_rsa

Port 223

Idenitityfile ~/.ssh/id_ed25519.pub

Serveraliveinterval 20

  • This worked to log me in as:

ssh growlmit

sudo service ssh start > start the server

  • Do these steps again on the Away computer:

sudo nano /etc/ssh/sshd_config

>change PermitRootLogin to yes, Port 223

and then:

ssh sevgi@172.20.10.3 -p223(change t to p for macs terminal

  • NOW WE WIN SEVGI@GROMIT

now we install nginx?? im confused & scared

$ sudo apt install nginx -y (install nginx)

sudo ufw allow 80/tcp(add the https port to the firewall like the first time)

sudo ufw reload

GO TO : http://SERVER-IP > which would be 172.20.10.3 for me.

  • Here is what i see:

permission denied, cant change the html.

Also the nginx html is there too!! I did it… Took me just 3 hrs. Kinda crazy…

Ran into this error:

setting locale failed.

Ran:

sudo dpkg-reconfigure locales

Said > ok > ok

same prob

Said> all > 2nd option>ok

didn’t work.

Restarted terminal

ssh into growlmit

change .ssh/config file:

nano ~/.ssh/config

Add:

Hostname growlmit

User sevgi

Host 172.20.10.3

Identityfile (same as before)

ssh growlmit does not work…

<<<<<SERVER IS DOWN>>>>>

wow everythign was going so great…

On server computer:

I edited the .ssh/config file and deleted .pub from the end of the identity file.

I want to connect to a different wifi on the serverputer.

Hmmm but that’s basically changing the host.. kinda cant do that.

Okay logged back into the server

same locale error, tried:

sudo locale-gen en_US.UTF-8

I still have a permission issue when it comes to editing adding things etc.

  • SOLVED:

go into root

sudo adduser sevgi sudo

sudo usermod -aG sudo sevgi

doesn’t work…

hitting a wall……


Going to try this next time:

https://www.reddit.com/r/homelab/comments/pnto6g/how_to_selfhosting_and_securing_web_services_out/


Okay actually:

  • installing docker too:

https://docs.docker.com/engine/install/debian/#install-from-a-package

(https://how-to.computer/dokuwiki/how/setting_up_docker)

WORKS!


"Hello from Docker!

This message shows that your installation appears to be working correctly.”

  • install docker compose:

https://docs.docker.com/desktop/setup/install/linux/debian/

>sudo apt install gnome-terminal

.deb file is instlaled with this :

TEMP_DEB="$(mktemp)" &&

wget -O "$TEMP_DEB" 'http://path.to/my.deb' &&

sudo dpkg -i "$TEMP_DEB"

rm -f "$TEMP_DEB”

replace path with:

DEB package

this part took ages…

DOESNT WORK….

sudo apt-get update

sudo apt-get install docker-compose-plugin

this works…

somehtings broken we run

apt —fix-broken install

okay found out why

# docker-compose up -d

didn’t work.

I was not in the right directory… this is where I kill myself.

Anyway

we cd back into cd /app/reverse-proxy

and there:

sudo docker-compose up -d

if you installed the Option 2 before:

sudo docker compose up -d

Now we go to:

172.20.10.3:81

Error:

failed to bind port 0.0.0.0:80/tcp: Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

Oh my god…

Apparently apache is running on the same port?? what does this even fucking meaaannn

Anyway:

sudo service apache2 stop

fixed the issue! now we try again….

172.20.10.3:81

Login:

Email:    admin@example.com

Password: changeme

<from:

https://github.com/NginxProxyManager/nginx-proxy-manager>

from the descp:

"I created this project to fill a personal need to provide users with an easy way to accomplish reverse proxying hosts with SSL termination and it had to be so easy that a monkey could do it. This goal hasn't changed. While there might be advanced options they are optional and the project should be as simple as possible so that the barrier for entry here is low."

hahah omgggg i did it I am the aforementioned monkey!! BUT NOW WHATTTT

I am utterly miserably confused

————

14.02.2025

repeat same steps, took me 1 hr to get where i was yesterday, cool stuff.

trying to use nginx only this time. i don’t like nginx proxy manager

https://www.docker.com/blog/how-to-use-the-official-nginx-docker-image/

until the docker compose up I had no issues everything ran smoothly.

When you get to the Dockerfile part:

go to frontend > Dockerfile as instructed and sudo nano into it:

Change RUN yarn install to:

RUN yarn install --ignore-engines(src: https://github.com/docker/getting-started/issues/381)

error:

0:0:0:0:80: bind:address already in use

this port is already in use

chage the default port in the docker-compose.yml

  ports:

    - "8084:80”(I used 8011)

Then go to :

YOUR.IP.AD:8011(or whatever port)

success!!

set up docker account;

im under: igvestan

downloaded docker hub

what the hell is this

downloaded nginx here as well but can no longer docker compose it

  • trying this:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04

It was v cool, I think if i uploaded through git then I could run it locally on my browser

  • Now i am trying the cloudflared thing:

https://www.reddit.com/r/homelab/comments/pnto6g/how_to_selfhosting_and_securing_web_services_out/

install guide is:

https://pkg.cloudflare.com/index.html


HELP:

https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/

https://gist.github.com/amanjuman/970389a62368a8b58614b6b70bd2ea94

https://github.com/julcap/nginx-style-autoindex


working static DNS edit with netplan:

network:

    version: 2

    renderer: networkd

    ethernets:

        enp3s0:

            addresses:

                - 10.10.10.2/24

            nameservers:

                search: [mydomain, otherdomain]

                addresses: [10.10.10.1, 1.1.1.1]

            routes:

                - to: default

                  via: 10.10.10.1


After this I followed Chalien's manual and did port -forwarding on my ziggo settings for 81,8080 and 443???????????

I found no information about this online?


PROBLEMS:

I need a domain to host my server through for sure...

I need to understand how nginx proxy manager works. I think there is a reason why how-to would direct to there and I have also encountered many comments saying it helped to fix a lot of issues. But I want to see the nginx set up as it is like all the folders etc. I thought nginx-auto-index would be it but it isn't...


Next Steps:

I restart everything> stop portforwarding as well and read through Chaliens guide thoroughly as well. (It didn't make sense until I tried a full cycle twice)

https://www.reddit.com/r/selfhosted/wiki/index/


Oh my god,, it happened to me too... I found my own online server guide : https://titipi.org/wiki/index.php/TITiPI%27s_local_server#TITiPI_Local_Server_manual

This is to set up titipi's local server but if I can manage to do this AND then put this online somehow(probably via nginx proxy manager and ziggoconnectbox port forwarding) then im set???

from titipis wiki: https://networksofonesown.constantvzw.org/etherbox/manual.html

Making a local server public with pagekite.py

https://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/

https://superuser.com/questions/526899/how-to-make-my-ip-publicly-accessible-to-make-my-local-tomcat-server-public