Most unusual hosting servers: home computer, Raspberry Pi and another's servers

Started by seocyrusjpr, Aug 04, 2022, 10:33 AM

Previous topic - Next topic

seocyrusjprTopic starter

To post information on the public domain, it is not necessary to buy an account from a hosting provider. There are many another options, including free ones. There are free hosting providers for text, images, and files, starting with Github Pages.

And if we want to keep the site completely under our control, we can host a web server on a home computer, Raspberry Pi single-board, or even on a mobile phone. The main thing is that the device is online all the time.

Web server on home PC

An old computer can always be used: it can work as a torrent client and media server (distributing video via Plex to all TVs, laptops and smartphones), as a file storage, backup archive, and as well as a NET server. There is nothing easier.

Surely, for a standard software stack, it's better to install Linux, but there's nothing wrong with Windows either. At least 29.2% of the servers on the Internet run Windows, so it's not necessary to change the operating system if the PC originally had it, especially if you are used to working with tools such as ASP.NET and C.

For simplicity, you can instantly install the entire set of programs. Choose one of the AMP stacks (Apache, MySQL/MariaDB, Perl/PHP/Python) for any platform: Windows, macOS, Linux, BSD. For example, the WampServer package for Windows.

WampServer is a Windows web development platform for dynamic web applications using Apache2 server, PHP script interpreter and MySQL database. It as well includes the PHPMyAdmin web application for simple database handling.

We install the software, get an external IP address from our provider, register a domain name in the configuration, open ports 80, 3306 (MySQL), 21 (FTP), 22 (SSH) in the router or change them to non-standard ones to reduce garbage traffic from crawler bots - and everything should work.

Hosting on Raspberry Pi

The algorithm is clear: you need to raise a web server on the Raspberry Pi and connect it to internet. This is not some kind of exotic, but quite a regular use of "raspberry". The official site even has instructions for installing Apache and Nginx.

Alternatively, a web server can be set up directly on the router (with OpenWRT firmware).

After installing Nginx, we check the availability of the site at http://localhost/ on the Pi itself or by the IP address of the device within the network, for example, You can find out your internal IP address with the hostname -I command.

Web pages are stored in the /var/www/html directory by default. We go there and place anything, replacing the standard pages. The default page address is written in /etc/nginx/sites-available.

In addition to Nginx, for a more functional site, you can install PHP:

sudo apt install php-fpm

Further in /etc/nginx/sites-available we find the line index index.html index.htm; and add index.php to the middle, and uncomment the following lines in the middle of the configuration file:

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php5-fpm.sock;

After this procedure, we reload the configuration file.

In general, the Raspberry Pi can be used for various useful DIY projects. For example, make a wall calendar, turn a USB printer into a wireless printer, install your own VPN server, and much more.

For the purposes of the test, even the official Raspberry Pi website (and this is a large and visited site) was once hosted on Raspberry Pi 3 mini-computers, I had to build a cluster of eight pieces.

During the day of the experiment, the cluster served tens of millions of visitors.

A home web server on a single-board PC consumes very little electricity, a single solar panel on the balcony is enough to run it. In September 2018, an enthusiast from Low-tech Magazine launched a test with such a web server on the single-board Olimex Olinuxino A20 Lime 2, which has been running almost uninterruptedly for about two years now (uptime is about 95%).

According to the developer's calculations, the energy consumption per unique visitor is 0.021 Wh.

Simplified power supply scheme for a web server. It does not have a voltage converter from 12 to 5 volts and an ampere-hour counter

Blockchain and distributed hosting server

A number of experimental projects have been created on the basis of the blockchain, including cryptocurrencies, smart contracts, document authentication, electronic voting, and much more, including decentralized hosting. One of the first projects of this kind was Swarm by Ethereum developer Victor Tron.

Decentralized hosting assumes that the site is simultaneously stored by several network members at once. Theoretically, this increases the resilience of the site against DDoS attacks or government censorship.

Swarm software has been released for all major platforms: Linux, macOS, Windows, Raspberry Pi, Android and iOS. To host a Swarm node, you had to download the appropriate binary from the official page or host Swarm in a Docker container.

Nevertheless, new versions for Swarm nodes have not been released since February 2020, so the internet is now in question. The developers write that they have moved on to developing a new Bee client, which is based on a more advanced network layer (libp2p). They as well believe that it is easier to rewrite the system from scratch than to fix bugs. One way or another, but Swarm and Bee are interesting tests that demonstrate the conceptual possibility of distributed hosting.

One more P2P project can be mentioned: image hosting, based on the distributed file system InterPlanetary File System. It has been running flawlessly for several years now. The files here are stored in the users' P2P network. When a picture is uploaded to the internet, a 46-byte hash is calculated for it, which serves as a unique file identifier. The hash matches the file name. To download a file, it is enough to know its hash.

Files on a distributed IPFS network are almost impossible to delete or block. The server source code is published on Github.

To protect against garbage, the internet distributes to new peers only those files that someone requests.

Other P2P image hosting can be organized on the Tornado framework if you specify the GridFS file system.

"Hosting" on other people's servers

If somebody dares to open ports on their PC and looks at the logs, they will instantly understand what a hostile environment they are in. Many attempts to scan on all standard ports with requests for installed software. If you do not take protective measures, then in the software on almost any server you can find vulnerabilities - and get access to it with administrator rights.

Further, the attacker himself chooses what to do with the resources that fell into his hands: deface them for the sake of lulz, install a cryptocurrency miner, add them to a DDoS botnet, or place files for distribution. This is called "hosting on other people's servers" - an illegal option used by attackers.

For example, the largest modern Emotet botnet spreads its malicious load through a network of hаcked sites, which the botmaster with the code name Tom controls through his web shells installed there.

Some other botnets work the same way. They include home computers, Linux web servers, smartphones, routers, and other IoT devices such as Android smart TVs.

An attacker can place his files on devices from a botnet as though on a kind of distributed hosting. This is a fairly reliable storage, because many users do not update software for years, do not use a firewall and do not monitor traffic.

In general, self hosting server has a number of advantages. The server in the basement or on the balcony is completely under your control. You install any hardware and software of your choice.
No one needs to pay a monthly hosting fee (in fact, you can provide such services yourself). And the main advantage is that it is always interesting to learn something new, in this case, to master some of the skills of an engineer and a developers.


As an alternative, if your home router is not default, you can run your web server (if it is for a business card website or similar static content) directly on it.
My rather old Asus AC-RT68U runs on DD-WRT and can hold a special file system on a connected flash drive for, including site hosting.

By the way, the "green" version of the website on the "raspberry" is slyly silent about what will happen if the electricity at home disappears (the router will turn off and there will be no access).


If you are satisfied with the cost and functionality, why not. But then, as far as I remember, I used the following tag on the pages: meta name="robots" content="noarchive,notranslate,noimageindex", as I could, I tried to prohibit the saving of the page content by search engines for ordinary users, although I can't remember everything now.
Then I followed the rule: "if website is not currently available, then there should be no way to get its contents." But I agree that these are somewhat specific conditions. I don't know if it was possible to do something similar in the cloudflare settings then.