Monday, January 9, 2017

Raspberry Pi3 self hosting

I had been following the Pi hype for a while, since the first models hit the market, but I did not have a use case for buying one, until I wanted to stop using an ecommerce that was charging large sums every month to host a very modest sales site of mine-- bam, Pi use case found.

Searching around the interwebz I found this amazing tutorial/write-up to setup a Pi to be an internet facing server- seriously, just an amazing a-z guide to not only getting a Pi spun up to be a webserver and email server, but with good security best practices and additions thrown into it-- but I ran into some issues-

- do not get rid of root as a login option, there are installs that need root despite using 'sudo' with the account you create and having added all known groups to said account.

- ran into this for the iptables section
libkmod: ERROR ../libkmod/libkmod.c:554 kmod_search_moddep: could not open moddep file '/lib/modules/3.6.11+/modules.dep.bin'
iptables v1.4.14: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
fix that issue with updating rpi with 'rpi-update' (did not have to type sudo, I su into root)

I was able to SSH login via username and password in Putty despite the mentioned instruction to install keys and supposedly disable password login- so I followed the linked guide to take a few more steps to make it so only a key method can be used to login.

  -- Towards the "make your own website" portion, I started to deviate from the guide as I wanted to make a wordpress site, so I started to follow THIS guide with some differences to the directories mentioned.

After all of this, I just could not get nginx to work, I could not get a 'hello world' html to show up with my pi's IP address, try as I did.  I gave up, sudo apt-get purge nginx to go with the more established (meaning= lots of tutorials) apache.  Installed Apache using the Raspberry official documentation and finally had a website to view in my NAT.

To setup my router to forward the necessary ports- WAN > Virtual Server / Port Forwarding

Last but not least, once you have your wordpress instance up and running, you will quickly find your pi part of a xml-rpc bot net-- when in your wordpress admin page, go to plugins, install "disable xml-rpc".


No comments:

Post a Comment