super draft of webserver tutorial
This commit is contained in:
parent
c02df0443a
commit
de13e490d2
@ -11,13 +11,13 @@ Status: published
|
||||
|
||||
##Introduction
|
||||
|
||||
The whole premise of the homebrewserver.club is the simple, yet often overlooked, fact that your home internet subscription theoretically also allows you to host services. The internet is in its essence a bi-directional medium. Anyone with an internet connection can not only look up on-line content but also host it!
|
||||
The whole premise of the homebrewserver.club is the simple, yet often overlooked, fact that your home internet subscription theoretically also allows you to host services. The internet is in its essence a bi-directional medium. Anyone with an internet connection can not only look up on-line content but also host it!
|
||||
|
||||
In times of 'cloud providers' and 'virtual private servers' it is an easy thing to forget, and internet service providers don't make it easy on you either, but a homebrew server can be as simple as an old laptop connected directly to your home router.
|
||||
|
||||
##Requirements
|
||||
|
||||
To begin serving from home you need the following:
|
||||
To begin serving from home you need the following:
|
||||
|
||||
- Make sure you have physical access to your home router.
|
||||
- Get to know the password of the admin user (this is usually provided in the box or written on the label on the underside of the router).
|
||||
@ -29,18 +29,18 @@ To begin serving from home you need the following:
|
||||
|
||||
![A schematic representation depicting network address translation between a local area network and a wide area network, where ports are being forwarded from the WAN to home server on the LAN]({attach}images/port_forwarding.svg)
|
||||
|
||||
Most home routers are configured by default to make the devices behind your router inaccessible to the internet, using their inbuilt firewall. This is to prevent your private network from being public.
|
||||
Most home routers are configured by default to make the devices behind your router inaccessible to the internet, using their inbuilt firewall. This is to prevent your private network from being public.
|
||||
|
||||
Machines behind your router (called your local area network or `LAN`) can make connections to the wider internet (known as `WAN`) but not the other way around.
|
||||
|
||||
In the case of hosting a server at home though, we DO want that server to be reachable from the internet. In order to do that we need to open so-called *ports*.
|
||||
In the case of hosting a server at home though, we DO want that server to be reachable from the internet. In order to do that we need to open so-called *ports*.
|
||||
|
||||
Ports are logical 'gates' that are open or closed to connections. These ports have numbers and are [standardized](https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers#Well-known_ports) for specific protocols or applications.
|
||||
For example, HTTP traffic from a website would default to port `80`. HTTPS defaults to `443` and SSH defaults to port `22`.
|
||||
For example, HTTP traffic from a website would default to port `80`. HTTPS defaults to `443` and SSH defaults to port `22`.
|
||||
|
||||
To make our server accessible we need to open and forward those ports on the router/firewall to our server in a process called port-forwarding.
|
||||
|
||||
The exact method of port-forwarding differs from router to router but if follows always a similar scheme where you designate inbound traffic on a certain port to be forwarded to the IP address your server has on the local area network.
|
||||
The exact method of port-forwarding differs from router to router but if follows always a similar scheme where you designate inbound traffic on a certain port to be forwarded to the IP address your server has on the local area network.
|
||||
|
||||
For this you need to have access to the administrative panel of your router.
|
||||
|
||||
@ -56,13 +56,13 @@ If you get a command not found warning try this:
|
||||
|
||||
`$ ip address`
|
||||
|
||||
This will return information on your network connection. Look for the line saying `inet`
|
||||
This will return information on your network connection. Look for the line saying `inet`
|
||||
|
||||
3: wlp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
|
||||
link/ether ac:ab:00:00:ac:ab brd ff:ff:ff:ff:ff:ff
|
||||
inet 192.168.1.11/24 brd 192.168.1.255 scope global wlp3s0
|
||||
valid_lft forever preferred_lft forever
|
||||
inet6 fe80::eab1:fcff:acab:374e/64 scope link
|
||||
inet6 fe80::eab1:fcff:acab:374e/64 scope link
|
||||
valid_lft forever preferred_lft forever
|
||||
|
||||
In this case the IP-address is `192.168.1.11` as a rule of thumb you can then change the last digit to either `1` or `254` to find the router.
|
||||
@ -84,9 +84,9 @@ Next try to find an option called "Static (DHCP) Lease" or "DHCP Binding" or som
|
||||
|
||||
## Forward the ports
|
||||
|
||||
Once you've set up a static lease to your homeserver you can start port forwarding.
|
||||
Once you've set up a static lease to your homeserver you can start port forwarding.
|
||||
|
||||
|
||||
## Additional Resources
|
||||
|
||||
* [https://portforward.com/](https://portforward.com/router.htm) has a large list of routers and visual instructions on how to set up port forwarding on them.
|
||||
* [https://portforward.com/](https://portforward.com/router.htm) has a large list of routers and visual instructions on how to set up port forwarding on them.
|
||||
|
@ -30,7 +30,7 @@ A basic understanding of [the command-line] is required.
|
||||
|
||||
[the command-line]: http://write.flossmanuals.net/command-line/introduction/
|
||||
|
||||
The SSH ecosystem is very established. It is available on all modern GNU/Linux
|
||||
The SSH ecosystem is very well established. It is available on all modern GNU/Linux
|
||||
distributions, MacOS and Windows. You can use your home server or if you don't have one yet you can use your own personal laptop to experiment (in this case, your laptop will
|
||||
play the role of both the server and client as explained later).
|
||||
|
||||
@ -157,7 +157,7 @@ When an SSH server is installed, key pairs are generated on the server. The
|
||||
design of SSH is such that when you make a secure connection you should be sure
|
||||
that where you are connecting to is the server you expect.
|
||||
|
||||
On the server, you can validate that this is fingerprint you expect:
|
||||
On the server, you can validate that this is the fingerprint you expect:
|
||||
|
||||
```bash
|
||||
$ sudo ssh-keygen -lf /etc/ssh/ssh_host_ecdsa_key
|
||||
|
81
content/fundamentals/webserver.md
Normal file
81
content/fundamentals/webserver.md
Normal file
@ -0,0 +1,81 @@
|
||||
Title: Getting Started: Installing webserver software and publishing your website
|
||||
Date: 2019-01-14
|
||||
Category: fundamentals
|
||||
Tags: server, router, introduction, lan, wan
|
||||
Slug: fundamentals-webserver-website
|
||||
Description: How to set up a spare computer as a web server and publish your website.
|
||||
Author: hbsc & friends
|
||||
Status: draft
|
||||
|
||||
# SUPER UNDER CONSTRUCTION
|
||||
|
||||
##Introduction
|
||||
|
||||
Ever wanted to host your own website from the comfort of your own house? Ever wondered how to achieve this? Search no further! This guide will help you with the installation of web server software, which is what allows a computer to start handling HTTP requests and serve web content in response.
|
||||
|
||||
Besides helping you with the installation, this guide will help you getting the right certificates, configuring your server and publishing your homebrewserved website.
|
||||
|
||||
The instructions on this guide were run on a Debian Stretch distribution.
|
||||
|
||||
|
||||
##Requirements
|
||||
|
||||
- A spare computer.
|
||||
- A basic understanding of the command line.
|
||||
- An [ssh server and client](ssh.html) installed
|
||||
- Have an available power socket next to your router.
|
||||
- An ethernet cable to connect your server to the router.
|
||||
|
||||
## Installing Apache
|
||||
|
||||
The Apache HTTP server is a free and open-source web server software and it has been around since 1995, being the most widely used server software in the world. Because of this, documentation is plentiful and the support community is very large, meaning that help is quite easy to get for any of your server issues.
|
||||
For this reason, Apache has been selected for this guide.
|
||||
|
||||
There are, of course, other web server software available, the most popular of which being Nginx. Nginx, which is also free and open-source software, arrived on the scene circa 2004, and it has also become a favourite for its resource efficiency.
|
||||
|
||||
If you want to geek out further about the differences between Apache and Nginx, [this article](https://www.digitalocean.com/community/tutorials/apache-vs-nginx-practical-considerations) gives you an overview.
|
||||
|
||||
So, without further ado, open a terminal window and let's get started:
|
||||
|
||||
First, make sure you have the newest package versions by updating your package lists and then upgrading these packages:
|
||||
|
||||
```bash
|
||||
$ sudo apt update && upgrade
|
||||
```
|
||||
Then, install the Apache HTTP server software:
|
||||
|
||||
```bash
|
||||
$ sudo apt install apache2
|
||||
```
|
||||
|
||||
If all went well, Apache should have been started immediately after installation. To double check this, run:
|
||||
|
||||
```bash
|
||||
$ sudo systemctl status apache2
|
||||
```
|
||||
|
||||
Example output:
|
||||
```bash
|
||||
● apache2.service - The Apache HTTP Server
|
||||
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset:
|
||||
Active: active (running) since Sat 2019-06-22 21:29:51 UTC; 6s ago
|
||||
Main PID: 18398 (apache2)
|
||||
CPU: 573ms
|
||||
CGroup: /system.slice/apache2.service
|
||||
├─18398 /usr/sbin/apache2 -k start
|
||||
├─18402 /usr/sbin/apache2 -k start
|
||||
├─18403 /usr/sbin/apache2 -k start
|
||||
├─18404 /usr/sbin/apache2 -k start
|
||||
├─18405 /usr/sbin/apache2 -k start
|
||||
└─18406 /usr/sbin/apache2 -k start
|
||||
|
||||
Jun 22 21:29:50 supermuch systemd[1]: Starting The Apache HTTP Server...
|
||||
Jun 22 21:29:51 supermuch systemd[1]: Started The Apache HTTP Server.
|
||||
```
|
||||
|
||||
|
||||
## HTTPS
|
||||
|
||||
## Configuration Time
|
||||
|
||||
## index.html
|
@ -5,6 +5,7 @@ Slug: beginners-guide-to-xmpp-speak
|
||||
Description: XMPP terminology, translated to plain english. Did you know you can use OMEMO E2E with MAM in a MUC?
|
||||
Category: instant messaging
|
||||
|
||||
|
||||
<a name='xmpp'></a>
|
||||
##XMPP
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user