bajsicki.com/public/posts/vps-setup/index.html

186 lines
6.9 KiB
HTML
Raw Normal View History

2024-09-26 14:32:13 +02:00
<!DOCTYPE html>
<html lang="en-us"><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
<title>VPS set-up - phil@bajsicki:~$</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="description"
content="A few months ago I took up a project to centralize and collect all of my websites and email boxes. ">
<link rel="canonical" href="http://localhost:1313/posts/vps-setup/" />
<link rel="icon" href="http://localhost:1313/images/logo_w.png" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/modern-normalize/1.1.0/modern-normalize.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="preload" as="style"
href="https://fonts.googleapis.com/css?family=Noto+Serif+SC|Noto+Emoji&display=swap" />
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Noto+Serif+SC|Noto+Emoji&display=swap"
media="print" onload="this.media='all'" />
<noscript>
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Noto+Serif+SC&display=swap" />
</noscript>
<link rel="stylesheet" href="/css/hugo-tufte.min.css">
<link rel="stylesheet" href="/css/hugo-tufte-options.min.css">
<link rel="stylesheet" href="/css/hugo-tufte-override.css">
</head>
<body>
<article id="main">
<header class="brand">
<h1>phil@bajsicki:~$</h1>
<p class="subtitle"></p>
<nav class="menu">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about/">About</a></li>
<li><a href="/posts/">Posts</a></li>
</ul>
</nav>
<hr />
</header>
<section>
<h1 class="content-title">VPS set-up</h1><span class="content-meta"><p class="author">[Phil Bajsicki]</p><p class="date">2022-08-18</p><span>4 min read&nbsp;</span><a href="http://localhost:1313/tags/vps">vps</a>&nbsp;<a href="http://localhost:1313/tags/sysadmin">sysadmin</a>&nbsp;<a href="http://localhost:1313/tags/servers">servers</a>&nbsp;</span></section>
<section><p>A few months ago I took up a project to centralize and collect all of my websites and email boxes.</p>
<p>I took some time researching what I needed, and settled on netcup.de for my host. The major reason is that they&rsquo;re based in Germany, which means they comply with GDPR - this way I don&rsquo;t have to worry about my data being processed in ways I don&rsquo;t explicitly agree to.</p>
<p>Being European, I do tend to take my privacy for granted, and am reasonably careful not to contribute information about myself to businesses if I can avoid it. (Did you know that Facebook goes into overdrive with targeted advertising when you enter the US?)</p>
<p>I had no experience setting up servers before, aside from basic MySQL on Windows Server around the year 2007. Maybe 2008.</p>
<p>However&hellip; it turns out to be a really simple process if - like me - you&rsquo;re using Linux as your daily driver. I normally run Arch, but after some quick research I found that it&rsquo;s a bad choice for servers. Ubuntu it is.</p>
<p>So I installed Ubuntu. That&rsquo;s one thing sorted.</p>
<p>Then I had to choose a web server. I had prior experience configuring Apache and nginx, and I found them unnecessarily complicated. I don&rsquo;t plan to do anything more complex. Just a bunch of simple HTML files and a mail server.</p>
<p>I then found Caddy, and seeing its elegant and simple configuration, I was quickly sold. The setup was simple enough, and the configuration was easy. I pointed my domains to the server, and migrated most of my websites shortly.</p>
<p>I had previously used Wordpress, however I wanted to avoid the heavy and resource intensive nature of Wordpress. It&rsquo;s not bad software by any means, but I am personally biased toward lighter solutions. Having been an Emacs user for years, it only made sense to use org-mode and export to HTML.</p>
<p>This way I only ever need a web server that serves files, and I don&rsquo;t have to deal with databases.</p>
<p>Then the email server. I wanted this as simple as possible. I tried a number of solutions, and having issues with them, I settled on iRedMail. The installation was simple enough, but required that I handle its own webserver - it comes bundled with nginx for webmail access.</p>
<p>This turned Nita an entire project as I had to learn about handling SSL. Caddy procures its own certificates from Let&rsquo;s Encrypt, and the nginx webmail didn&rsquo;t like that because iRedMail generates local certs for itself.</p>
<p>I reconfigured Caddy to place its SSL files in a sheared directory and made nginx would read. Didn&rsquo;t work, nginx complained. Eventually I gave up. Since the servers are on the same physical machine, and Caddy is the server facing the web, I let it do that, and removed the SSL option from nginx.</p>
<p>That solved my mail issues.</p>
<p>Thankfully&amp; adding DKIM and DMARC to the domains was very straightforward.</p>
<p>Then&hellip; something interesting happened. My wife wanted to set up a Wordpress install for her new shirt store.</p>
<p>I chose MariaDB for the database. The set-up process for SQL DB&rsquo;s hasn&rsquo;t become any easier in the last 20 years, for inexplicable reasons. But with a small bit of research, I was able to follow the documentation, and set it up in a day from scratch.</p>
<p>The Wordpress install is entirely served by Caddy, and the setup was truly painless in comparison to setting up email. Still, I got it done.</p>
<p>The final set-up is like so:</p>
<ul>
<li>Ubuntu</li>
<li>Caddy</li>
<li>iRedMail</li>
<li>nginx (behind Caddy)</li>
<li>MariaDB</li>
<li>Wordpress</li>
<li>Emacs</li>
</ul>
<p>For the most part, the set-up was straightforward. The sticky points were SSL between Caddy and nginx, setting up the mail server (even though I used iRedMail, it required a bit of research to set up correctly. And MariaDB for Wordpress.</p>
<p>Sum total: about 10-12 hours of work. In retrospect, I&rsquo;m confident I could set this up again in much less time, and it was a healthy learning experience.</p></section>
<section><footer class="page-footer">
<hr />
<div class="previous-post" style="display:inline-block;">
</div>
<div class="next-post", style="display:inline-block;float:right;">
<a class="link-reverse" href="http://localhost:1313/posts/new-keyboard-layout-colemak-dh/?ref=footer">Learning a new keyboard layout »</a>
</div>
<ul class="page-footer-menu">
</ul>
<div class="copyright">
<p>
©2024 Phil Bajsicki
</p>
</div>
</footer>
</section>
<section><nav class="menu">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about/">About</a></li>
<li><a href="/posts/">Posts</a></li>
</ul>
</nav>
</section>
</article>
</body>
</html>