You are not logged in.

#1 2021-03-09 11:46:41

sweetthdevil
Member
Registered: 2009-10-20
Posts: 417

Home server setup

Hello all,

I will shortly set up an home server running archlinux on a hp prodesk 400 g2.5 (Intel Core i5 4th Gen & 4GB Ram) with a PCIe M2 SSD for the OS mainly and a WD Red 2TB hard drive that will contain the files.

The plan is to have the following services to run on it (at least to begin with)

- Plex Media Server - Files will be on the 2TB drive but metatags will be on the M2 SSD for speed.
- Ampache Music Server - Files will be on the 2TB drive but metatags will be on the M2 SSD for speed.
- NextCloud - Files will be on the 2TB drive.
- PyLoad (download manager with a web interface) - will download onto the WD Red.

The Server will be connected to a Netgear R7000 that will be the router for the whole network (connected to BT fibre with 300mb / 120 mb)

Obviously the server will not be requested all the time and I intend to disable non-needed hardware within the bios to same on power consumption (i.e. sound card) and will setup the drive to power down with hdparm when not in use.

However, is there a way to suspend the power all together but have the server booting back up to life (should be quick enough with the M2 SSD drive) through network activity?

Offline

#2 2021-03-09 12:06:39

progandy
Member
Registered: 2012-05-17
Posts: 5,279

Re: Home server setup

If you configure your server for wake on lan, and have dd-wrt or openwrt on your router, then you might be able to run a script on your router that sends the WOL packet when a new connection is being established.
https://wiki.dd-wrt.com/wiki/index.php/ … er_Wake-up

A cleaner option than parsing the iptables log might be a dedicated netfilter-based application:

https://home.regit.org/netfilter-en/usi … ter_queue/
https://github.com/mister-benjamin/etherwake-nfqueue
https://github.com/mister-benjamin/ethe … ue-openwrt

Last edited by progandy (2021-03-09 12:12:30)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2021-03-09 12:21:51

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Home server setup

I have a similar setup.

1. Those HP rigs usually support Wake On Lan (BIOS setting). I use the community/wol package. It's simple, you wake the server up with "WOL 12:34:56:78:9A:BC" or whatever your MAC address is.

2. Depending on what you want to do with Plex, the server won't WOL when you connect through a client. There are ways to do this, but they might require a manually configurable router.

3. I use Termux on my Android phone. When you put bash scripts in the ~/.shortcuts/tasks folder, you can then create widgets/shortcuts for your launcher/home screen. My script is a Termux approprite shebang and just "WOL [my mac]". To do this from the outside, you might want to think about some VPN solution or port knocking (router needs to support this). I have a Raspberry Pi with the SSH port exposed for such things. Now, when a machine with WOL support needs to boot, I simply whip out my phone and press a button.

4. WARNING: Nextcloud has gone through a weird update lately. Many of our Nextcloud boxes broke and some of us have even been unable to install it fresh following the Wiki. I don't know if the wiki has been updated, but do your homework. I've personally switched my Nextcloud to docker on the same machine, because I don't want to run into another series of problems next time Arch updates PHP.

Last edited by Awebb (2021-03-09 12:22:37)

Offline

#4 2021-03-09 17:09:49

sweetthdevil
Member
Registered: 2009-10-20
Posts: 417

Re: Home server setup

Thank you all for you replies.

I had a further look at DD-WRT and found this script that seems to do the trick - will further my research. https://wiki.dd-wrt.com/wiki/index.php/ … er_Wake-up

Also, interesting comments about docker. Is there not an added security point to use docker for those type of services? i.e. Nextcloud? or Ampache? not to mentioned that dependency are then never broken due to an update? What are the pros or cons ?

Last edited by sweetthdevil (2021-03-09 17:19:43)

Offline

#5 2021-03-09 18:28:21

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Home server setup

Cons:
- You're at the mercy of whoever packages the docker containers. In case of Nextcloud this is (I think) actually the Nexctloud team.
- If there is a security vulnerability in one library that is being used in multiple containers, you basically have to check every container and probably wait for an update or rebuild your own container.
- Overhead, as you can imagine, as libraries are not shared but loaded independently.
- There might be some initial learning curve to get it right. Fortunately, there is some sort of a beginners guide. Once you've installed docker and have it set up according to the wiki, try "docker run -d -p 80:80 docker/getting-started" and then point your browser at http://localhost:80 or the server's hostname/IP. -p 80:80 is port_host:port_container, so if you've got something on 80, change the first 80 and reflect that in your URL. After that tutorial, I felt confident I could manage simple setups.

Pros:
- Host agnostic. Should you ever feel tired of Arch, you can "simply" migrate your infrastructure.
- Containers don't see each other or the host unless you tell them to.
- You're pretty much immune against Arch's dependency updates. This comes in handy if you have a behemoth like Nextcloud. In the past four years, Nextcloud has been a show stopper several times, either because something broke or because I read somewhere that something might break and I had to do the research to make sure it won't.
- It's easy to setup a testing environment. There is a tool called docker-compose, that allows you to write a YAML file instead of executing all the commands from the scratch. You can also make copies of running containers with "docker commit".

Offline

#6 2021-03-11 00:57:05

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Home server setup

Awebb wrote:

4. WARNING: Nextcloud has gone through a weird update lately. Many of our Nextcloud boxes broke and some of us have even been unable to install it fresh following the Wiki. I don't know if the wiki has been updated, but do your homework. I've personally switched my Nextcloud to docker on the same machine, because I don't want to run into another series of problems next time Arch updates PHP.

https://wiki.archlinux.org/index.php/Ne … 3E=_21.0.0

And also, this was very much a problem with the way the nextcloud package got updated in an uncoordinated manner: https://bugs.archlinux.org/task/69718#comment196957
And more generally all the bugs from https://bugs.archlinux.org/index/proj5? … -10&status[0]=

I hardly expect this to be the typical user experience.

Last edited by eschwartz (2021-03-11 01:00:53)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2021-03-11 06:06:07

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Home server setup

eschwartz wrote:

I hardly expect this to be the typical user experience.

It also looks like the wiki has been updated. The update was indeed bumpy by design and the official news om the Nextcloud page wasn't exactly helpful, either.

Offline

Board footer

Powered by FluxBB