From: Chris Koeritz Date: Tue, 21 Nov 2017 13:59:10 +0000 (-0500) Subject: penultimate update for v002 X-Git-Tag: 2.140.105^2~3 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=6dbd9d16275e19554ba720999973ba141959888a;p=feisty_meow.git penultimate update for v002 --- diff --git a/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html b/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html index 2d540069..88317904 100644 --- a/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html +++ b/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html @@ -132,7 +132,7 @@ These are my settings, with IPv6 left disabled:
nat net config -

Starting up the VM

+

Starting up the VM and Connecting to It

Using the Virtualbox interface, you should now be able to start your virtual machine.  Virtualbox will complain if it detects any remaining configuration problems in the VM.  The Linux boot sequence @@ -142,16 +142,24 @@ firewall, then allow the Virtualbox to get through.  Usually, telling Windows that once is enough, but if any odd network access problems result, edit the Windows firewall settings and allow Virtualbox to use - both "Public" and "Private" networks.

-

You can log in directly on the VM console with the developer account, but - it is generally more useful to connect to the cakelampvm over ssh.  - If the networking has been established properly, you should be able to do - this with:

+ both "Public" and "Private" networks.  (Cortana can find the firewall + settings if you ask her about 'firewall'.  Within the firewall + configuration dialog, look for "Allow an app or feature through..." on the + left and configure Virtualbox from within that list.)

+ You can log in directly on the VM console with the developer account, but it + is generally more useful to connect to the cakelampvm over ssh.  If the + networking has been established properly, you should be able to do this + with:
# ssh developer@10.28.42.20   # or the equivalent with your ssh client

And then provide the password to log in.

Once the DNS services are set up (discussed in detail below), you will be able to run the much friendlier command:

# ssh developer@cakelampvm.com
+

Key Forwarding to the VM

+

It is important to set up ssh key forwarding to enable your use of git + repositories while logged into the VM.  Key forwarding should be + enabled for the VM's two fake host identities:

+
cakelampvm.com
10.28.42.20

Updating cakelampvm to the Latest Model

The cakelampvm v002 is released with the intention that it not need to be released again.  Version 001 was not built with that explicit @@ -231,8 +239,8 @@ meow 10.28.42.20.  (The DNS server can be tested with nslookup, dig and other tools.)

Note that the cakelampvm DNS should be listed first, if one intends to - override any DNS names that actually exist out on the internet.  We - have also found it most effective to have only the cakelampvm as your DNS + override any DNS names that actually exist out on the internet.  Further, + we have found it most effective to have *only* the cakelampvm as your DNS server, because a secondary DNS server can "take over" providing the name lookups, and thus foul up DNS requests that should succeed for your VM-hosted sites.

@@ -240,7 +248,8 @@ meow below that is tailored to that operating system.

Important Note: It behooves you to remember to switch back to a normal DNS server configuration when you shut off the cakelampvm, or your machine - will not know the names of any sites on the internet any more!

+ will not know the names of any sites on the internet any more!  The + official Google DNS servers are 8.8.8.8 and 8.8.4.4.

Once the DNS server is properly set up (by whatever means necessary), these ping commands should get answering responses (from 10.28.42.20) on both the cakelampvm VM and on your host PC.  Note: ping on Linux @@ -259,11 +268,27 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com internet.  If you instead get failures to find the domains, or if the "real internet" site comes up for cakelampvm.com (the page covered with red X marks and complaining), then the DNS is not hooked up properly yet.

+

Setting up DNS on Windows

+

The ipconfig tool will provide helpful information about your current + networking and DNS configuration:

+
> ipconfig --all
+

The DNS configuration on Windows is somewhat byzantine.  The pipe + characters ('|') below are used to separate the menus or tabs or dialogs + to traverse.  Follow this path to get to the DNS config:

+
Control Panel | Network & Internet | Network & Sharing | click WiFI or Ethernet link near top right | click Adapter Settings button...
 | click on the specific network device to modify | select Properties
+

Once the properties dialog is displayed, find "internet protocol version + 4" in the list and double click it.

+

Change the DNS setting from "obtain...automatically" to "use the + following dns addresses".

+

Enter 10.28.42.20 as the first DNS address and clear the second address + (all blanks).

+

Hit okay, then okay, then close, etc to back out of adapter + configuration.

Troubleshooting the DNS

If your pings are getting the wrong answers and you're certain the DNS settings on your Host PC are right, then you may need to flush your DNS - cache, and that might be sufficient.  On Windows, the command for - flushing DNS is:

+ cache, and that might be sufficient to start getting the right IP + address.  On Windows, the command for flushing DNS is:

> ipconfig /flushdns

and on Linux the flush DNS command can be many different things, but try these two most common options:

@@ -274,6 +299,33 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com over your DNS configuration very carefully.  The cakelampvm's DNS feature *does* actually work, but operating systems sometimes do their best to deny this.
+

Host Key Issues for ssh

+

There is one caveat to be aware of when connecting to the cakelampvm.com + domain.  If you have accidentally added the "real" cakelampvm.com + domain from the internet to your ssh known_keys at some point, then ssh + will complain about connecting to the VM on the cakelampvm.com + domain.  This complaint will look like:

+
The authenticity of host 'cakelampvm.com (104.236.56.82)' can't be established.
+

Note that the IP address shown is not our beloved 10.28.42.20 local IP + address.

+

To fix this, remove the entry pointing at the "real" site from the + known_hosts file (ssh will print out the line number of the offending + entry).  The DNS configuration needs to be configured before you will + get the warning about the cakelampvm.com domain.  Up until then, the + domain name is always referring to the site out on the internet with the + red X's and warnings.  See the DNS configuration section below to + configure DNS the first time.

+

Once you connect to the VM and the ssh client records the VM's host key + in your known_hosts, then you're in good shape.  This state also + gives you a "canary in a coal mine" warning system...  Once the VM is + registered as a known host, then any attempt to connect back to the "real" + internet version of cakelampvm.com will garner a complaint from ssh.  + This version of the ssh warning should be heeded; you do not want to + connect to the real internet site, and the warning indicates that the host + PC is no longer using the DNS on the VM (since it reached the real + internet site instead of the VM).  That situation needs to be + corrected by running through the DNS configuration section again (and + testing the DNS until it is working).

Troubleshooting the Apache Sites

If your DNS pings and lookups are functioning properly, but you're just not getting the right websites, then try clearing your browser's cache and @@ -281,20 +333,6 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com and try the address again.  Often this cache dumping is enough to fix the browser so that you start seeing the local website versions on cakelampvm.com.

-

Setting up DNS on Windows

-

The ipconfig tool will provide helpful information about your current - networking and DNS configuration:

-
ipconfig --all
-

The DNS configuration on Windows is somewhat byzantine.  The pipe - characters ('|') below are used to separate the menus or tabs or dialogs - to traverse.  Follow this path to get to the DNS config:

-
Control Panel | Network & Sharing | click WiFI or Ethernet link near top right | click Adapter Settings on left | click on specific network device to modify | select Properties
-


-

-

{fill in rest}
-

-


-

Editing files on the guest VM from the host

On the host computer, look for the guest vm as a networked computer @@ -462,6 +500,22 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com target="_blank" title="vim commands" href="https://vim.rtorr.com/">https://vim.rtorr.com/

A git branching model that seems to work well: http://nvie.com/posts/a-successful-git-branching-model/

+

This is a basic guide to the Google Developer Console and API Key + management: Google + API Docs

+

 

+

Using the "meld" Tool to Compare Files & Directories

+

Meld is a great comparison tool that displays differences between two + files or directories or directory trees in a graphical view.  Meld is + pre-installed on the VM.  This tool can be launched either in the + VM's X Windowing System (on the console) or if X11 forwarding is enabled.

+

To run meld, just type this command:

+

#meld A B

+

where A and B are either both file names or they are both directory names.  + If A and B are directories, meld will compare the entire tree structure + between the two directories.  It allows one to copy from one side to + the other, even if the item that needs to be copied is an entire + subdirectory.

Get the network address on the guest vm

Run this command:

# ifconfig
@@ -527,6 +581,28 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com
auto enp0s8
iface enp0s8 inet dhcp

+

Compacting the VM Disk Image

+

To minimize the size used for the disk image, there are three major + steps.

+

1. While running the VM, run this command:

+
# sudo apt clean
+

This throws away any cached data from the apt tool, which can be + substantial.

+

If there are other junk files you know of that can be removed, delete + those now also.

+

2. Reboot the VM to the gparted ISO image (available at the gparted + site) and run the following command:

+
# sudo zerofree /dev/sda
+

This sets all free space to the zero byte, enabling Virtualbox to free + that space in the next step.

+

3. Shut the vm down after zerofree is complete and run this command on + the host PC (this is the Linux version of the command):

+
# VBoxManage modifyhd --compact ~/cake_lamp_vm/cake-lamp-vm-hd.vdi
+

Replace the ~/cake_lamp_vm + path with the real VM storage path.  This command compacts the root + (and only) partition of the VM.

+

After these steps are complete, the VM should be its minimal size.

Notes on building the Cake Lamp VM

This is all work that should already have been done.  It is mentioned here just as breadcrumbs for a future vm builder.