rebuild site

This commit is contained in:
trent committed 2021-10-16 03:59:04 -07:00
1 parent db2d6a8f54
commit ff573d8b18
29 files changed
+2403 -54

No files matched your search

+1 -1
View File
@@ -1 +1 @@
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"","title":"Home"},{"location":"links/","text":"Trent's Blog Links Home RSS Source For This Blog AudioBooks Attention Span History GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"links/#trents-blog","text":"","title":"Trent's Blog"},{"location":"links/#links","text":"Home RSS Source For This Blog AudioBooks Attention Span History GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"rss/","text":"Trent's Blog RSS Created Updated Links Home Links","title":"RSS"},{"location":"rss/#trents-blog","text":"","title":"Trent's Blog"},{"location":"rss/#rss","text":"Created Updated","title":"RSS"},{"location":"rss/#links","text":"Home Links","title":"Links"},{"location":"posts/apache-virtual-hosts/","text":"date: 2020-12-20 Use Virtual Hosts This is a very useful way to keep your server organized. Virtual Hosts On Your Lan You can practice on your Lan. Setting up DNS on your Lan For instance, if your router is running dnsmasq , this may be as simple as describing the virtual hosts in /etc/hosts on the router. 192.168.1.101 blog.devbox blogstatic.devbox Here's An Example Reverse Proxy for A Flask Blog On Your Lan # /etc/apache2/sites-enabled/blog.devbox.conf <VirtualHost *:80 > ServerName blog.devbox # dont' block LetsEncrypt # ProxyPass \"/.well-known\" ! ... not needed on your Lan # don't block /var/www/html/favicon.ico ProxyPass \"/favicon.ico\" ! ProxyPass \"/\" \"http://127.0.0.1:8000/\" ProxyPassReverse \"/\" \"http://127.0.0.1:8000/\" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> Here's An Example for A Static Blog On Your Lan # /etc/apache2/sites-enabled/blogstatic.devbox.conf <VirtualHost *:80 > ServerName blogstatic.devbox DocumentRoot /var/www/html/blogstatic/site ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> Wan Deployment Set up DNS Log into your dns provider and create records A record for blog.example.com pointing to your ipv4 address AAAA record for blog.example.com pointing to your ipv6 address A record for blogstatic.example.com pointing to your ipv4 address AAAA record for blogstatic.example.com pointing to your ipv6 address Start With Virtual Hosts for HTTP You don't need to create virtual hosts for SSL configuration, because CertBot will automatically do that for you. Reverse Proxy # /etc/apache2/sites-enabled/blog.example.com.conf <VirtualHost *:80 > ServerName blog.example.com # dont' block LetsEncrypt ProxyPass \"/.well-known\" ! # don't block /var/www/html/favicon.ico ProxyPass \"/favicon.ico\" ! ProxyPass \"/\" \"http://127.0.0.1:8000/\" ProxyPassReverse \"/\" \"http://127.0.0.1:8000/\" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> Static Site # /etc/apache2/sites-enabled/blogstatic.example.com.conf <VirtualHost *:80 > ServerName blogstatic.example.com DocumentRoot /var/www/html/blogstatic/site ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> Get LetsEncrypt Certs certbot --apache -d blog.example.com -d blogstatic.example.com Certbot will create and enable new conf files with SSL encryption configured, and will modify your http conf files with redirections to https.","title":"Apache Virtual Hosts"},{"location":"posts/apache-virtual-hosts/#use-virtual-hosts","text":"This is a very useful way to keep your server organized.","title":"Use Virtual Hosts"},{"location":"posts/apache-virtual-hosts/#virtual-hosts-on-your-lan","text":"You can practice on your Lan.","title":"Virtual Hosts On Your Lan"},{"location":"posts/apache-virtual-hosts/#setting-up-dns-on-your-lan","text":"For instance, if your router is running dnsmasq , this may be as simple as describing the virtual hosts in /etc/hosts on the router. 192.168.1.101 blog.devbox blogstatic.devbox","title":"Setting up DNS on your Lan"},{"location":"posts/apache-virtual-hosts/#heres-an-example-reverse-proxy-for-a-flask-blog-on-your-lan","text":"# /etc/apache2/sites-enabled/blog.devbox.conf <VirtualHost *:80 > ServerName blog.devbox # dont' block LetsEncrypt # ProxyPass \"/.well-known\" ! ... not needed on your Lan # don't block /var/www/html/favicon.ico ProxyPass \"/favicon.ico\" ! ProxyPass \"/\" \"http://127.0.0.1:8000/\" ProxyPassReverse \"/\" \"http://127.0.0.1:8000/\" ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>","title":"Here's An Example Reverse Proxy for A Flask Blog On Your Lan"},{"location":"posts/apache-virtual-hosts/#heres-an-example-for-a-static-blog-on-your-lan","text":"# /etc/aLine truncated
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"","title":"Home"},{"location":"links/","text":"Trent's Blog Links Home RSS Source For This Blog AudioBooks Attention Span History GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"links/#trents-blog","text":"","title":"Trent's Blog"},{"location":"links/#links","text":"Home RSS Source For This Blog AudioBooks Attention Span History GitHub Twitter Facebook Trent Docs Hugo Themes Report libre_gps_parser Concise PDX Free Code Camp Challenges Device Layout Oregon Hikers' Field Guide","title":"Links"},{"location":"rss/","text":"Trent's Blog RSS Created Updated Links Home Links","title":"RSS"},{"location":"rss/#trents-blog","text":"","title":"Trent's Blog"},{"location":"rss/#rss","text":"Created Updated","title":"RSS"},{"location":"rss/#links","text":"Home Links","title":"Links"},{"location":"posts/add-kvm-network-with-virsh/","text":"date: 2021-10-16 Introduction This is a short and sweet walk-through for how to create a new network for libvirt for kvm , from the command line, using virsh . Name Resolution Let's start with name resolution. Install libnss-libvirt : apt install libnss-libvirt In /etc/nsswitch.conf , add libvirt to hosts key. # /etc/nsswitch.conf # change this ... hosts: files dns mymachines ... # to this ... hosts: files libvirt dns mymachines ... Starter XML You could dumpxml on the existing default network: virsh net-dumpxml default > foonet.xml Then, edit foonet.xml: remove the network uuid change the network name to taste remove the bridge mac change the bridge name to taste change the bridge ip address and dhcp range to taste <!-- foonet.xml --> <network> <name> foonet </name> <forward mode= 'nat' > <nat> <port start= '1024' end= '65535' /> </nat> </forward> <bridge name= 'virbr101' stp= 'on' delay= '0' /> <ip address= '10.55.44.1' netmask= '255.255.255.0' > <dhcp> <range start= '10.55.44.2' end= '10.55.44.254' /> </dhcp> </ip> </network> Define The Network With the above xml file: virsh net-define foonet.xml The network definition can now be found in /etc/libvirt/qemu/networks/foonet.xml <!-- /etc/libvirt/qemu/networks/foonet.xml --> <!-- WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE OVERWRITTEN AND LOST. Changes to this xml configuration should be made using: virsh net-edit foonet or other application using the libvirt API. --> <network> <name> foonet </name> <uuid> e6e40bfc-d449-4043-924c-ca0f0edf4210 </uuid> <forward mode= 'nat' > <nat> <port start= '1024' end= '65535' /> </nat> </forward> <bridge name= 'virbr111' stp= 'on' delay= '0' /> <mac address= '52:54:00:49:a7:f8' /> <ip address= '10.55.44.1' netmask= '255.255.255.0' > <dhcp> <range start= '10.55.44.2' end= '10.55.44.254' /> </dhcp> </ip> </network> You could also start the network without defining it using virsh net-create foonet.xml . Start/Stop Start the network virsh net-start foonet Stop the network virsh net-destroy foonet Undefine the network virsh net-undefine foonet Autostart the network virsh net-autostart foonet Disable autostart for the network virsh net-autostart foonet --disable Tab completion is you friend!","title":"Add KVM Network With Virsh"},{"location":"posts/add-kvm-network-with-virsh/#introduction","text":"This is a short and sweet walk-through for how to create a new network for libvirt for kvm , from the command line, using virsh .","title":"Introduction"},{"location":"posts/add-kvm-network-with-virsh/#name-resolution","text":"Let's start with name resolution. Install libnss-libvirt : apt install libnss-libvirt In /etc/nsswitch.conf , add libvirt to hosts key. # /etc/nsswitch.conf # change this ... hosts: files dns mymachines ... # to this ... hosts: files libvirt dns mymachines ...","title":"Name Resolution"},{"location":"posts/add-kvm-network-with-virsh/#starter-xml","text":"You could dumpxml on the existing default network: virsh net-dumpxml default > foonet.xml Then, edit foonet.xml: remove the network uuid change the network name to taste remove the bridge mac change the bridge name to taste change the bridge ip address and dhcp range to taste <!-- foonet.xml --> <network> <name> foonet </name> <forward mode= 'nat' > <nat> <port start= '1024' end= '65535' /> </nat> </forward> <bridge name= 'virbr101' stp= 'on' delay= '0' /> <ip address= '10.55.44.1' netmask= '255.255.255.0' > <dhcp> <range start= '10.55.44.2' end= '10.55.44.254' /> </dhcp> </ip> </network>","title":"Starter XML"},{"location":"posts/add-kvm-network-with-virsh/#define-the-network","text":"With the above xml file: virsh net-define foonet.xml The network definition can now be found in /etc/libvirt/qemu/networks/foonet.xml <!-- /etc/libvirt/qemu/networks/foonet.xml --> <!-- WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE OLine truncated