Hopp til innhold

Setin' up that webserver,

Skip to content

This here’s a machine-translated text that might contain some errors!

Installin’ a Web Server

Forutsetninger

What You Need

Før du begynner, må du ha følgende på plass:

  • En server med et operativsystem som støtter webserverprogramvare (f.eks. Linux, Windows Server).
  • Tilgang til serveren med administratorrettigheter.
  • En tekstredigerer for å redigere konfigurasjonsfiler.
  • Grunnleggende kunnskap om kommandolinjen.

  • A server with an operatin’ system that supports web server software (like Linux, Windows Server).

  • Access to the server with administrator privileges.
  • A text editor for editin’ configuration files.
  • Basic knowledge of the command line.

Valg av Webserver

Pickin’ Yer Web Server

Det finnes flere webservere å velge mellom, men de mest populære er:

  • Apache: En av de mest brukte webserverne, kjent for sin fleksibilitet og mange funksjoner.
  • Nginx: En lettvekts webserver som er kjent for sin ytelse og evne til å håndtere mange samtidige tilkoblinger.
  • Microsoft IIS: En webserver som er utviklet av Microsoft og er integrert med Windows Server.

  • Apache: One o’ the most used web servers, known for its flexibility and many features.

  • Nginx: A lightweight web server that’s known for its performance and ability to handle a whole mess o’ simultaneous connections.
  • Microsoft IIS: A web server developed by Microsoft and integrated with Windows Server.

Installasjonsprosess

The Installin’ Process

Installasjonsprosessen varierer avhengig av operativsystemet og webserveren du velger. Nedenfor følger en generell oversikt over installasjonen for Apache på Ubuntu Linux:

  1. Oppdater pakkelisten: sudo apt update
  2. Installer Apache: sudo apt install apache2
  3. Start Apache: sudo systemctl start apache2
  4. Sjekk status: sudo systemctl status apache2

The installin’ process varies dependin’ on yer operatin’ system and the web server you choose. Below’s a general overview o’ the install for Apache on Ubuntu Linux:

  1. Update the package list: sudo apt update
  2. Install Apache: sudo apt install apache2
  3. Start Apache: sudo systemctl start apache2
  4. Check the status: sudo systemctl status apache2

🚧🚧 Work in progress! 🚧🚧

Dubstep Meme

  • Commands: sudo, apt, cd, nano
  • Software: nginx, apache2

Process for Installin’

Before we can install the software, we gotta update the APT(itude) package list (“the app store” for Linux):

sudo apt update
# Oppdaterer pakkelisten.
# Updates the package list.

Now, we can go ahead and install the software we need. Here, we’re gonna install nginx, which is a mighty popular web server, but apache2 is a good alternative too.

sudo apt install nginx
# Installerer Nginx webserveren.
# Installs the Nginx web server.

Settin’ Up Yer Web Server & Files

We generally find them configuration files in /etc/<programwarename>/. For nginx, that’s /etc/nginx/. We ain’t gotta look at that right now, but if ya need to change somethin’ in the configuration, like the port, extra web servers, SSL certificates, and such, that’s where ya do it.

Web files, meanin’ HTML, CSS, JavaScript, and the like, usually sit in /var/www/html/. Ya can add yer own files there. For instance, ya can make an index.html file there with some simple HTML code.

cd /var/www/html/
sudo nano index.html
# Dette åpner index.html for redigering med nano.
# This here opens up index.html for editin' with nano.
nano - A little somethin’ ‘bout the text editor

Nano is a real basic text editor ya can use in the terminal. It’s easy to get the hang of and don’t require a whole lotta know-how.

Some basic commands:

  • CTRL + S - Save the file
  • CTRL + X - Exit nano

If ya hit CTRL + X without savin’, it’ll ask if ya wanna save the file. Hit Y for yes, N for no. Then ya hit ENTER to confirm the filename.

Startin’ and Stoppin’ the Web Server

Once the installin’s done, we can start the web server with:

sudo systemctl start nginx
systemctl - what in tarnation is it?

systemctl means “system control” and is a tool for controllin’ system services in Linux. It’s used to start, stop, restart, and check the status of services that are runnin’ in the background on the system.

systemctl start | stop | restart | status <servicename>

Now, mosey on over to http://<serverens-ip-adresse>/ in yer web browser to see if that there web server’s a-runnin’.

Findin’ the server’s IP address

To find yer server’s IP address, ya can use this here command:

hostname -I # Big I

Otherwise, ya can use ip a or ifconfig, but them folks gonna give ya more info than just the IP address.