new file docs/debian_nspawn_container_on_arch_for_testing_apache_configurations.md

This commit is contained in:
trent committed 2017-07-04 14:53:28 -07:00
1 parent 9919cb4d95
commit f9caa6f25c
14 files changed
+420 -14

No files matched your search

@@ -0,0 +1,94 @@
# Debian Nspawn Container On Arch For Testing Apache Configurations
Begin by exporting the environmental variable for your squid cacheing
proxy. If you're deboostrapping Debian file systems, the best way to
speed this up is with squid.
The ArchWiki page for nspawn containers has a
[Debian/Ubuntu subsection](https://wiki.archlinux.org/index.php/Systemd-nspawn#Create_a_Debian_or_Ubuntu_environment)
Obviously you're going to want to install debootstrap and debian-archive-keyring.
```bash
# to create a Stretch Container
cd /var/lib/machines
mkdir <container name>
deboostrap stretch <container name>
```
After some experimentation, perhaps this is the best time to write
the intended hostname into the container, and write any
apt-cacher or apt-cacher-ng proxies into /etc/apt/apt.conf
on the container.
```bash
cp apt.conf /etc/apt/apt.conf
echo "<hostname>" > /var/lib/machines/<container name>/etc/hostname
```
And then start the container, and set the root password.
```bash
# boot in interactive mode
systemd-nspawn -D <container name>
# set the passwd and logout
password
logout
```
Now we can boot the container in non-interactive mode, either
from the command line or using nspawn files. In either case
double check that the your bind mounts have the correct permissions
from inside the container.
```bash
# for instance attached to a bridge interface br0
systemd-nspawn -b -D <container name> --network-bridge=br0
# or if you've set up a package cache
systemd-nspawn -b -D <container name> --network-bridge=br0 --bind=/var/cache/apt/archives
```
Alternately, if you use an nspawn file, then you can use a command
similar to the following to start it, you'll first need to
boot the container from the command line and install dbus,
because `machinectl shell` and `machinectl login` won't work
without dbus. In this case use the following sequence of commands.
```bash
# start the container and login as root
systemd-nspawn -b -D <container name> --network-bridge=br0
# bring up networking so you can install dbus
# this is also a good time to install and configure locale
apt install dbus locales
# to configure locale
dpkg-reconfigure locales
poweroff
```
After this you can start the container with systemd, when
using an nspawn file.
```bash
systemctl start systemd-nspawn@<container name>
```
```text
# /etc/systemd/nspawn/<container name>.spawn
[Files]
# Bind=/var/cache/apt/archives
[Network]
bridge=br0
```
You can use tasksel to install a web-server.
```bash
# apache2 will immediately be listening on port 80
tasksel install web-server
# enable mod ssl
a2enmod ssl ; systemctl restart apache2
# enable the default ssl test page
a2ensite /etc/apache2/sites-available/default-ssl.conf
```
You'll be up and running with the default self-signed certs.
+1
View File
@@ -4,6 +4,7 @@ Obviously, the commit history will reflect the time when these documents are wri
* [Serve And Share Apps From Your Phone With Fdroid](serve_and_share_apps_from_your_phone_with_fdroid.md)
* [Nspawn Containers](nspawn.md)
* [Debian Nspawn Container On Arch For Testing Apache Configurations](debian_nspawn_container_on_arch_for_testing_apache_configurations.md)
* [Dynamic Cacheing Nginx Reverse Proxy For Pacman](dynamic_cacheing_nginx_reverse_proxy_for_pacman.md)
* [Quick Dirty Redis Nspawn Container on Arch Linux](arch_redis_nspawn.md)
* [Quick Dirty Postgresql Nspawn Container on Arch Linux](arch_postgresql_nspawn.md)
+1
View File
@@ -6,6 +6,7 @@ pages:
- 'Home': index.md
- 'Serve And Share Apps From Your Phone With Fdroid': serve_and_share_apps_from_your_phone_with_fdroid.md
- 'Nspawn': nspawn.md
- 'Debian Nspawn Container On Arch For Testing Apache Configurations': debian_nspawn_container_on_arch_for_testing_apache_configurations.md
- 'Dynamic Cacheing Nginx Reverse Proxy For Pacman': dynamic_cacheing_nginx_reverse_proxy_for_pacman.md
- 'Quick Dirty Redis Nspawn Container on Arch Linux': arch_redis_nspawn.md
- 'Quick Dirty Postgresql Nspawn Container on Arch Linux': arch_postgresql_nspawn.md
+5
View File
@@ -64,6 +64,11 @@
<li class="toctree-l1">
<a class="" href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1">
<a class="" href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
+5
View File
@@ -64,6 +64,11 @@
<li class="toctree-l1">
<a class="" href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1">
<a class="" href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
@@ -0,0 +1,251 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>Debian Nspawn Container On Arch For Testing Apache Configurations - Trent Docs</title>
<link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="../css/theme.css" type="text/css" />
<link rel="stylesheet" href="../css/theme_extra.css" type="text/css" />
<link rel="stylesheet" href="../css/highlight.css">
<script>
// Current page data
var mkdocs_page_name = "Debian Nspawn Container On Arch For Testing Apache Configurations";
var mkdocs_page_input_path = "debian_nspawn_container_on_arch_for_testing_apache_configurations.md";
var mkdocs_page_url = "/debian_nspawn_container_on_arch_for_testing_apache_configurations/";
</script>
<script src="../js/jquery-2.1.1.min.js"></script>
<script src="../js/modernizr-2.8.3.min.js"></script>
<script type="text/javascript" src="../js/highlight.pack.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
<div class="wy-side-nav-search">
<a href=".." class="icon icon-home"> Trent Docs</a>
<div role="search">
<form id ="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1">
<a class="" href="..">Home</a>
</li>
<li class="toctree-l1">
<a class="" href="../serve_and_share_apps_from_your_phone_with_fdroid/">Serve And Share Apps From Your Phone With Fdroid</a>
</li>
<li class="toctree-l1">
<a class="" href="../nspawn/">Nspawn</a>
</li>
<li class="toctree-l1 current">
<a class="current" href="./">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
<ul class="subnav">
<li class="toctree-l2"><a href="#debian-nspawn-container-on-arch-for-testing-apache-configurations">Debian Nspawn Container On Arch For Testing Apache Configurations</a></li>
</ul>
</li>
<li class="toctree-l1">
<a class="" href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
<li class="toctree-l1">
<a class="" href="../arch_redis_nspawn/">Quick Dirty Redis Nspawn Container on Arch Linux</a>
</li>
<li class="toctree-l1">
<a class="" href="../arch_postgresql_nspawn/">Quick Dirty Postgresql Nspawn Container on Arch Linux</a>
</li>
<li class="toctree-l1">
<a class="" href="../self_signed_certs/">Self Signed Certs</a>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="..">Trent Docs</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="..">Docs</a> &raquo;</li>
<li>Debian Nspawn Container On Arch For Testing Apache Configurations</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main">
<div class="section">
<h1 id="debian-nspawn-container-on-arch-for-testing-apache-configurations">Debian Nspawn Container On Arch For Testing Apache Configurations</h1>
<p>Begin by exporting the environmental variable for your squid cacheing
proxy. If you're deboostrapping Debian file systems, the best way to
speed this up is with squid.</p>
<p>The ArchWiki page for nspawn containers has a
<a href="https://wiki.archlinux.org/index.php/Systemd-nspawn#Create_a_Debian_or_Ubuntu_environment">Debian/Ubuntu subsection</a>
Obviously you're going to want to install debootstrap and debian-archive-keyring.</p>
<pre><code class="bash"># to create a Stretch Container
cd /var/lib/machines
mkdir &lt;container name&gt;
deboostrap stretch &lt;container name&gt;
</code></pre>
<p>After some experimentation, perhaps this is the best time to write
the intended hostname into the container, and write any
apt-cacher or apt-cacher-ng proxies into /etc/apt/apt.conf
on the container.</p>
<pre><code class="bash">cp apt.conf /etc/apt/apt.conf
echo &quot;&lt;hostname&gt;&quot; &gt; /var/lib/machines/&lt;container name&gt;/etc/hostname
</code></pre>
<p>And then start the container, and set the root password.</p>
<pre><code class="bash"># boot in interactive mode
systemd-nspawn -D &lt;container name&gt;
# set the passwd and logout
password
logout
</code></pre>
<p>Now we can boot the container in non-interactive mode, either
from the command line or using nspawn files. In either case
double check that the your bind mounts have the correct permissions
from inside the container.</p>
<pre><code class="bash"># for instance attached to a bridge interface br0
systemd-nspawn -b -D &lt;container name&gt; --network-bridge=br0
# or if you've set up a package cache
systemd-nspawn -b -D &lt;container name&gt; --network-bridge=br0 --bind=/var/cache/apt/archives
</code></pre>
<p>Alternately, if you use an nspawn file, then you can use a command
similar to the following to start it, you'll first need to
boot the container from the command line and install dbus,
because <code>machinectl shell</code> and <code>machinectl login</code> won't work
without dbus. In this case use the following sequence of commands.</p>
<pre><code class="bash"># start the container and login as root
systemd-nspawn -b -D &lt;container name&gt; --network-bridge=br0
# bring up networking so you can install dbus
# this is also a good time to install and configure locale
apt install dbus locales
# to configure locale
dpkg-reconfigure locales
poweroff
</code></pre>
<p>After this you can start the container with systemd, when
using an nspawn file.</p>
<pre><code class="bash">systemctl start systemd-nspawn@&lt;container name&gt;
</code></pre>
<pre><code class="text"># /etc/systemd/nspawn/&lt;container name&gt;.spawn
[Files]
# Bind=/var/cache/apt/archives
[Network]
bridge=br0
</code></pre>
<p>You can use tasksel to install a web-server.</p>
<pre><code class="bash"># apache2 will immediately be listening on port 80
tasksel install web-server
# enable mod ssl
a2enmod ssl ; systemctl restart apache2
# enable the default ssl test page
a2ensite /etc/apache2/sites-available/default-ssl.conf
</code></pre>
<p>You'll be up and running with the default self-signed certs.</p>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/" class="btn btn-neutral float-right" title="Dynamic Cacheing Nginx Reverse Proxy For Pacman">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../nspawn/" class="btn btn-neutral" title="Nspawn"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<!-- Copyright etc -->
</div>
Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<div class="rst-versions" role="note" style="cursor: pointer">
<span class="rst-current-version" data-toggle="rst-current-version">
<span><a href="../nspawn/" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span style="margin-left: 15px"><a href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
<script src="../js/theme.js"></script>
</body>
</html>
@@ -62,6 +62,11 @@
<a class="" href="../nspawn/">Nspawn</a>
</li>
<li class="toctree-l1">
<a class="" href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1 current">
<a class="current" href="./">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
@@ -465,7 +470,7 @@ WantedBy=timers.target
<a href="../arch_redis_nspawn/" class="btn btn-neutral float-right" title="Quick Dirty Redis Nspawn Container on Arch Linux">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../nspawn/" class="btn btn-neutral" title="Nspawn"><span class="icon icon-circle-arrow-left"></span> Previous</a>
<a href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/" class="btn btn-neutral" title="Debian Nspawn Container On Arch For Testing Apache Configurations"><span class="icon icon-circle-arrow-left"></span> Previous</a>
</div>
@@ -491,7 +496,7 @@ WantedBy=timers.target
<span class="rst-current-version" data-toggle="rst-current-version">
<span><a href="../nspawn/" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span><a href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span style="margin-left: 15px"><a href="../arch_redis_nspawn/" style="color: #fcfcfc">Next &raquo;</a></span>
+7 -1
View File
@@ -76,6 +76,11 @@
<li class="toctree-l1">
<a class="" href="debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1">
<a class="" href="dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
@@ -132,6 +137,7 @@
<ul>
<li><a href="serve_and_share_apps_from_your_phone_with_fdroid/">Serve And Share Apps From Your Phone With Fdroid</a></li>
<li><a href="nspawn/">Nspawn Containers</a></li>
<li><a href="debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a></li>
<li><a href="dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a></li>
<li><a href="arch_redis_nspawn/">Quick Dirty Redis Nspawn Container on Arch Linux</a></li>
<li><a href="arch_postgresql_nspawn/">Quick Dirty Postgresql Nspawn Container on Arch Linux</a></li>
@@ -186,5 +192,5 @@
<!--
MkDocs version : 0.16.3
Build Date UTC : 2017-07-01 21:12:17
Build Date UTC : 2017-07-04 21:53:11
-->
+12 -2
View File
@@ -2,7 +2,7 @@
"docs": [
{
"location": "/",
"text": "Welcome to Trent Docs\n\n\nGit Repo For These Docs\n\n\nObviously, the commit history will reflect the time when these documents are written.\n\n\n\n\nServe And Share Apps From Your Phone With Fdroid\n\n\nNspawn Containers\n\n\nDynamic Cacheing Nginx Reverse Proxy For Pacman\n\n\nQuick Dirty Redis Nspawn Container on Arch Linux\n\n\nQuick Dirty Postgresql Nspawn Container on Arch Linux\n\n\nSelf Signed Certs",
"text": "Welcome to Trent Docs\n\n\nGit Repo For These Docs\n\n\nObviously, the commit history will reflect the time when these documents are written.\n\n\n\n\nServe And Share Apps From Your Phone With Fdroid\n\n\nNspawn Containers\n\n\nDebian Nspawn Container On Arch For Testing Apache Configurations\n\n\nDynamic Cacheing Nginx Reverse Proxy For Pacman\n\n\nQuick Dirty Redis Nspawn Container on Arch Linux\n\n\nQuick Dirty Postgresql Nspawn Container on Arch Linux\n\n\nSelf Signed Certs",
"title": "Home"
},
{
@@ -12,7 +12,7 @@
},
{
"location": "/#git-repo-for-these-docs",
"text": "Obviously, the commit history will reflect the time when these documents are written. Serve And Share Apps From Your Phone With Fdroid Nspawn Containers Dynamic Cacheing Nginx Reverse Proxy For Pacman Quick Dirty Redis Nspawn Container on Arch Linux Quick Dirty Postgresql Nspawn Container on Arch Linux Self Signed Certs",
"text": "Obviously, the commit history will reflect the time when these documents are written. Serve And Share Apps From Your Phone With Fdroid Nspawn Containers Debian Nspawn Container On Arch For Testing Apache Configurations Dynamic Cacheing Nginx Reverse Proxy For Pacman Quick Dirty Redis Nspawn Container on Arch Linux Quick Dirty Postgresql Nspawn Container on Arch Linux Self Signed Certs",
"title": "Git Repo For These Docs"
},
{
@@ -180,6 +180,16 @@
"text": "You can start/stop nspawn containers with machinectl command. You can start nspawn containers with systemd-nspawn command. You can configure the systemd service for a container with @nspawn.service file override Or you can configure an nspawn container with a dot.nspawn file But in regards to the above list\nI have noticed differences in behaviour,\nin some scenarios, concerning file attributes\nfor bind mounts. Another curiosity: when you have nspawn containers natted on VirtualEthernet connections,\nthey might be able to ping each other at 10.x.y.z, but not resolve each other. But they might\nbe able to resolve each other if they are all connected to the same bridge interface or nspawn\nnetwork zone, but will randomly resolve each other in any of the 10.x.y.z, 169.x.y.z,\nor fe80::....:....:....%host (ipv6 local) spaces, which would complicate configuring the containers\nto talk to each other. But I intend to look into this some more.",
"title": "Final Observations"
},
{
"location": "/debian_nspawn_container_on_arch_for_testing_apache_configurations/",
"text": "Debian Nspawn Container On Arch For Testing Apache Configurations\n\n\nBegin by exporting the environmental variable for your squid cacheing \nproxy. If you're deboostrapping Debian file systems, the best way to\nspeed this up is with squid.\n\n\nThe ArchWiki page for nspawn containers has a\n\nDebian/Ubuntu subsection\n\nObviously you're going to want to install debootstrap and debian-archive-keyring.\n\n\n# to create a Stretch Container\ncd /var/lib/machines \nmkdir <container name> \ndeboostrap stretch <container name>\n\n\n\n\nAfter some experimentation, perhaps this is the best time to write\nthe intended hostname into the container, and write any\napt-cacher or apt-cacher-ng proxies into /etc/apt/apt.conf \non the container.\n\n\ncp apt.conf /etc/apt/apt.conf \necho \"<hostname>\" > /var/lib/machines/<container name>/etc/hostname\n\n\n\n\nAnd then start the container, and set the root password.\n\n\n# boot in interactive mode\nsystemd-nspawn -D <container name>\n# set the passwd and logout\npassword \nlogout \n\n\n\n\nNow we can boot the container in non-interactive mode, either\nfrom the command line or using nspawn files. In either case \ndouble check that the your bind mounts have the correct permissions \nfrom inside the container.\n\n\n# for instance attached to a bridge interface br0 \nsystemd-nspawn -b -D <container name> --network-bridge=br0\n# or if you've set up a package cache \nsystemd-nspawn -b -D <container name> --network-bridge=br0 --bind=/var/cache/apt/archives\n\n\n\n\nAlternately, if you use an nspawn file, then you can use a command \nsimilar to the following to start it, you'll first need to \nboot the container from the command line and install dbus,\nbecause \nmachinectl shell\n and \nmachinectl login\n won't work \nwithout dbus. In this case use the following sequence of commands.\n\n\n# start the container and login as root\nsystemd-nspawn -b -D <container name> --network-bridge=br0 \n# bring up networking so you can install dbus\n# this is also a good time to install and configure locale\napt install dbus locales \n# to configure locale \ndpkg-reconfigure locales \npoweroff\n\n\n\n\nAfter this you can start the container with systemd, when \nusing an nspawn file.\n\n\nsystemctl start systemd-nspawn@<container name>\n\n\n\n\n# /etc/systemd/nspawn/<container name>.spawn \n[Files] \n# Bind=/var/cache/apt/archives \n\n[Network] \nbridge=br0 \n\n\n\n\nYou can use tasksel to install a web-server.\n\n\n# apache2 will immediately be listening on port 80\ntasksel install web-server\n# enable mod ssl\na2enmod ssl ; systemctl restart apache2\n# enable the default ssl test page \na2ensite /etc/apache2/sites-available/default-ssl.conf\n\n\n\n\nYou'll be up and running with the default self-signed certs.",
"title": "Debian Nspawn Container On Arch For Testing Apache Configurations"
},
{
"location": "/debian_nspawn_container_on_arch_for_testing_apache_configurations/#debian-nspawn-container-on-arch-for-testing-apache-configurations",
"text": "Begin by exporting the environmental variable for your squid cacheing \nproxy. If you're deboostrapping Debian file systems, the best way to\nspeed this up is with squid. The ArchWiki page for nspawn containers has a Debian/Ubuntu subsection \nObviously you're going to want to install debootstrap and debian-archive-keyring. # to create a Stretch Container\ncd /var/lib/machines \nmkdir <container name> \ndeboostrap stretch <container name> After some experimentation, perhaps this is the best time to write\nthe intended hostname into the container, and write any\napt-cacher or apt-cacher-ng proxies into /etc/apt/apt.conf \non the container. cp apt.conf /etc/apt/apt.conf \necho \"<hostname>\" > /var/lib/machines/<container name>/etc/hostname And then start the container, and set the root password. # boot in interactive mode\nsystemd-nspawn -D <container name>\n# set the passwd and logout\npassword \nlogout Now we can boot the container in non-interactive mode, either\nfrom the command line or using nspawn files. In either case \ndouble check that the your bind mounts have the correct permissions \nfrom inside the container. # for instance attached to a bridge interface br0 \nsystemd-nspawn -b -D <container name> --network-bridge=br0\n# or if you've set up a package cache \nsystemd-nspawn -b -D <container name> --network-bridge=br0 --bind=/var/cache/apt/archives Alternately, if you use an nspawn file, then you can use a command \nsimilar to the following to start it, you'll first need to \nboot the container from the command line and install dbus,\nbecause machinectl shell and machinectl login won't work \nwithout dbus. In this case use the following sequence of commands. # start the container and login as root\nsystemd-nspawn -b -D <container name> --network-bridge=br0 \n# bring up networking so you can install dbus\n# this is also a good time to install and configure locale\napt install dbus locales \n# to configure locale \ndpkg-reconfigure locales \npoweroff After this you can start the container with systemd, when \nusing an nspawn file. systemctl start systemd-nspawn@<container name> # /etc/systemd/nspawn/<container name>.spawn \n[Files] \n# Bind=/var/cache/apt/archives \n\n[Network] \nbridge=br0 You can use tasksel to install a web-server. # apache2 will immediately be listening on port 80\ntasksel install web-server\n# enable mod ssl\na2enmod ssl ; systemctl restart apache2\n# enable the default ssl test page \na2ensite /etc/apache2/sites-available/default-ssl.conf You'll be up and running with the default self-signed certs.",
"title": "Debian Nspawn Container On Arch For Testing Apache Configurations"
},
{
"location": "/dynamic_cacheing_nginx_reverse_proxy_for_pacman/",
"text": "Dynamic Cacheing Nginx Reverse Proxy For Pacman\n\n\nYou set up a dynamic cacheing reverse proxy and then you put the ip address or hostname for that server in \n/etc/pacman.d/mirrorlist\n on your client machines.\n\n\nOf course if you want to you can set this up and run it in an\n\nNspawn Container\n.\nThe \nArchWiki Page for pacman tips\n\nmostly spells out what to do, but I want to document\nthe exact steps I would take.\n\n\nAs for how you would run this on a server with other virtual hosts?\nWho cares? That is what is so brilliant about using using an\nnspawn container, in that it behaves like just another\ncomputer on the lan with it's own ip address. But it only does one\nthing, and that's all you have to configure it for.\n\n\nI see no reason to use nginx-mainline instead of stable.\n\n\npacman -S nginx\n\n\n\n\nThe suggested configuration in the Arch Wiki\nis to create a directory \n/srv/http/pacman-cache\n,\nand that seems to work well enough\n\n\nmkdir /srv/http/pacman-cache\n# and then change it's ownershipt\nchown http:http /srv/http/pacman-cache\n\n\n\n\nnginx configuration\n\n\nand then it references an nginx.conf in\n\nthis gist\n,\nbut that is not a complete nginx.conf and so here is a method to get that\nworking as of July 2017 with a fresh install of nginx.\n\n\nYou can start with a default \n/etc/nginx/nginx.conf\n,\nand add the line \ninclude sites-enabled/*;\n\nat the end of the \nhttp\n section.\n\n\n# /etc/nginx/nginx.conf\n#user html;\nworker_processes 1;\n\n#error_log logs/error.log;\n#error_log logs/error.log notice;\n#error_log logs/error.log info;\n\n#pid logs/nginx.pid;\n\n\nevents {\n worker_connections 1024;\n}\n\n\nhttp {\n include mime.types;\n default_type application/octet-stream;\n\n #log_format main '$remote_addr - $remote_user [$time_local] \"$request\" '\n # '$status $body_bytes_sent \"$http_referer\" '\n # '\"$http_user_agent\" \"$http_x_forwarded_for\"';\n\n #access_log logs/access.log main;\n\n sendfile on;\n #tcp_nopush on;\n\n #keepalive_timeout 0;\n keepalive_timeout 65;\n\n #gzip on;\n\n server {\n listen 80;\n server_name localhost;\n\n #charset koi8-r;\n\n #access_log logs/host.access.log main;\n\n location / {\n root /usr/share/nginx/html;\n index index.html index.htm;\n }\n\n #error_page 404 /404.html;\n\n # redirect server error pages to the static page /50x.html\n #\n error_page 500 502 503 504 /50x.html;\n location = /50x.html {\n root /usr/share/nginx/html;\n }\n\n # proxy the PHP scripts to Apache listening on 127.0.0.1:80\n #\n #location ~ \\.php$ {\n # proxy_pass http://127.0.0.1;\n #}\n\n # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\n #\n #location ~ \\.php$ {\n # root html;\n # fastcgi_pass 127.0.0.1:9000;\n # fastcgi_index index.php;\n # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;\n # include fastcgi_params;\n #}\n\n # deny access to .htaccess files, if Apache's document root\n # concurs with nginx's one\n #\n #location ~ /\\.ht {\n # deny all;\n #}\n }\n\n\n # another virtual host using mix of IP-, name-, and port-based configuration\n #\n #server {\n # listen 8000;\n # listen somename:8080;\n # server_name somename alias another.alias;\n\n # location / {\n # root html;\n # index index.html index.htm;\n # }\n #}\n\n\n # HTTPS server\n #\n #server {\n # listen 443 ssl;\n # server_name localhost;\n\n # ssl_certificate cert.pem;\n # ssl_certificate_key cert.key;\n\n # ssl_session_cache shared:SSL:1m;\n # ssl_session_timeout 5m;\n\n # ssl_ciphers HIGH:!aNULL:!MD5;\n # ssl_prefer_server_ciphers on;\n\n # location / {\n # root html;\n # index index.html index.htm;\n # }\n #}\n include sites-enabled/*;\n\n}\n\n\n\n\nAnd then create the directory \n/etc/nginx/sites-enabled\n\n\nmkdir /etc/nginx/sites-enabled\n\n\n\n\nAnd then create \n/etc/nginx/sites-enabled/proxy_cache.conf\n,\nwhich is \nmostly\n a\n\ncopy-and-paste from this gist\n.\n\n\nNotice the \nserver_name\n. This has to match the entry in\n\n/etc/pacman.d/mirrorlist\n on the client machines you are\nupdating from. If you can use the hostname, great. But if you\nhave to assign static ip addresses and explicitly write the local\nip address instead, then that should match what you write in your mirrorlist.\n\n\nAnd of course your mirrorlist entry\non the client machine, has to preserve the directory sLine truncated
+7 -2
View File
@@ -86,6 +86,11 @@
<li class="toctree-l1">
<a class="" href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1">
<a class="" href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
@@ -285,7 +290,7 @@ to talk to each other. But I intend to look into this some more.</p>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/" class="btn btn-neutral float-right" title="Dynamic Cacheing Nginx Reverse Proxy For Pacman">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/" class="btn btn-neutral float-right" title="Debian Nspawn Container On Arch For Testing Apache Configurations">Next <span class="icon icon-circle-arrow-right"></span></a>
<a href="../serve_and_share_apps_from_your_phone_with_fdroid/" class="btn btn-neutral" title="Serve And Share Apps From Your Phone With Fdroid"><span class="icon icon-circle-arrow-left"></span> Previous</a>
@@ -317,7 +322,7 @@ to talk to each other. But I intend to look into this some more.</p>
<span><a href="../serve_and_share_apps_from_your_phone_with_fdroid/" style="color: #fcfcfc;">&laquo; Previous</a></span>
<span style="margin-left: 15px"><a href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/" style="color: #fcfcfc">Next &raquo;</a></span>
<span style="margin-left: 15px"><a href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/" style="color: #fcfcfc">Next &raquo;</a></span>
</span>
</div>
+5
View File
@@ -60,6 +60,11 @@
<li class="toctree-l1">
<a class="" href="debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1">
<a class="" href="dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
+5
View File
@@ -64,6 +64,11 @@
<li class="toctree-l1">
<a class="" href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1">
<a class="" href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
@@ -98,6 +98,11 @@
<li class="toctree-l1">
<a class="" href="../debian_nspawn_container_on_arch_for_testing_apache_configurations/">Debian Nspawn Container On Arch For Testing Apache Configurations</a>
</li>
<li class="toctree-l1">
<a class="" href="../dynamic_cacheing_nginx_reverse_proxy_for_pacman/">Dynamic Cacheing Nginx Reverse Proxy For Pacman</a>
</li>
+15 -7
View File
@@ -4,7 +4,7 @@
<url>
<loc>/</loc>
<lastmod>2017-07-01</lastmod>
<lastmod>2017-07-04</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -12,7 +12,7 @@
<url>
<loc>/serve_and_share_apps_from_your_phone_with_fdroid/</loc>
<lastmod>2017-07-01</lastmod>
<lastmod>2017-07-04</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -20,7 +20,15 @@
<url>
<loc>/nspawn/</loc>
<lastmod>2017-07-01</lastmod>
<lastmod>2017-07-04</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>/debian_nspawn_container_on_arch_for_testing_apache_configurations/</loc>
<lastmod>2017-07-04</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -28,7 +36,7 @@
<url>
<loc>/dynamic_cacheing_nginx_reverse_proxy_for_pacman/</loc>
<lastmod>2017-07-01</lastmod>
<lastmod>2017-07-04</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -36,7 +44,7 @@
<url>
<loc>/arch_redis_nspawn/</loc>
<lastmod>2017-07-01</lastmod>
<lastmod>2017-07-04</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -44,7 +52,7 @@
<url>
<loc>/arch_postgresql_nspawn/</loc>
<lastmod>2017-07-01</lastmod>
<lastmod>2017-07-04</lastmod>
<changefreq>daily</changefreq>
</url>
@@ -52,7 +60,7 @@
<url>
<loc>/self_signed_certs/</loc>
<lastmod>2017-07-01</lastmod>
<lastmod>2017-07-04</lastmod>
<changefreq>daily</changefreq>
</url>