X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=production%2Fsites%2Fcakelampvm.com%2Fdocs%2Fmanual%2Fcakelampvm_guide_v002.html;h=279fd5f348fe317dc09403569b77563f4ab506d1;hb=32d3f111121f3a9ebdd60e6b777cf49ab1f2f60d;hp=610b4564f960ec684afd245a279c08a7bdffbbbc;hpb=b35bab5fbd73cdb028bc8374b0980ec2c1dc58f4;p=feisty_meow.git 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 610b4564..279fd5f3 100644 --- a/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html +++ b/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html @@ -9,18 +9,51 @@ Configuration and Usage

By Chris Koeritz

Vintage: cakelampvm v002    - Updated: 2017-11-10

-
-

Basic info for the guest VM

+ Updated: 2017-11-16 +

The cakelampvm project provides a Virtualbox VM that acts as an "internet + in a bottle".  The virtual machine provides DNS services (bind9), a Web server (Apache2), a full Ubuntu Linux desktop environment, + the Fluxbox X window manager, + and a suite of tools called the Feisty Meow® codebase .  + Together, these services provide you with a very flexible and powerful + testbed for web development, especially suited for CakePHP.

+

Guest VM Configuration

-

How to set up virtualbox for your host PC

+

Powering up with the Feisty Meow® scripts

+ The feisty meow scripts are a cohesive bash scripting environment for + getting a variety of tasks done.  The scripts recently incorporated the + "avbash" collection from Saco Designs and added those scripts to the + "site_avenger" collection of scripts.  These provide tools for bringing + up CakePHP web sites and managing the collection of repositories for those + sites.  Each website is considered an "application", and the + application name itself (e.g. "winterportlibrary") can often provide all the + details for "powering up" the site.  The feisty meow team has added + additional scripts for managing DNS domains and Apache websites that provide + the capability to "stand up" an entire website around an application, with + accompanying domain. +

The site avenger scripts are documented separately within the feisty meow + codebase.  Consult the feisty +meow + readme file first, as it provides some valuable information on + configuring the codebase.  The site avenger script documentation is + available in the feisty + meow command reference file.

+

(The feisty meow codebase is already configured for the developer account + on the cakelampvm virtual machine.)

+

How to set up virtualbox for your host PC

  1. Download and install virtualbox: https://www.virtualbox.org/wiki/Downloads
  2. @@ -47,16 +80,22 @@ machines.  Before starting it, perform the following network configuration sections.
-

Configure the Host-Only network on virtualbox

+

Configure the Host-Only network on virtualbox

Configuring host-only networking for the VM makes the VM completely local to your machine.  The cakelampvm will not be accessible on the internet or from the LAN, and can only be accessed by your host PC.

+

Note: If the host-only or NAT network exist ahead of time, virtualbox may + complain about them even if they have the correct configuration.  + This can be corrected simply by opening the VM settings and selecting the + appropriate network names again.

+

To configure the host-only network, follow these steps:

  1. Go to virtual box "Preferences" (global preferences, not for a specific vm).
  2. Click on the "Network" tab.
  3. Choose the "Host-only Networks" tab from within "Network".
  4. -
  5. Click the plus icon to add a new host-only network.
  6. +
  7. Click the plus icon to add a new host-only network, or if there is + already a Host-only network, then edit it.
  8. Set the "Adapter" parameters:
    IPv4 Address: 10.28.42.1
    IPv4 Network Mask: 255.255.255.0
    @@ -71,9 +110,15 @@ for convenience and stability.

Additional information on host-only (and other) network adapter types is - at: https://www.virtualbox.org/manual/ch06.html#network_nat_service
-

-

Configure the Nat Network on virtualbox

+ at: https://www.virtualbox.org/manual/ch06.html#network_nat_service

+

Configure the NAT Network on virtualbox

+

The NAT (Network Address Translation) network allows the VM to get off of + the machine and onto the internet safely.  It will use this interface + for any communication off of the host machine.  Since the real IP + address of the VM is hidden behind the NAT firewall on Virtualbox, this + keeps the VM safe from attackers, and hence your machine stays safe as + well.

+

To set up the NAT network, follow these steps:

  1. Go to virtual box "Preferences" (global preferences, not for a specific vm).
  2. @@ -88,22 +133,65 @@ These are my settings, with IPv6 left disabled:
    nat net config
-

Using the guest VM's DNS services

+

Start up the VM

+

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, but it should start + normally.  The Linux boot sequence will show many lines of text, + before bringing up a black console window with a login dialog.

+

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@cakelampvm.com  (or equivalent with your ssh client)
+

And then provide the password to log in.

+

If a feature called "X forwarding" is enabled in your ssh client, then + you can start graphical applications on the VM and display them on your + local machine.  This works right away on most Linux hosts, but can + also work on PCs with X window system installed.  The section below + describes how to set up Cygwin to run X server, which enable X forwarding + to your local display.

+

...{insert that info}...

+

Using the guest VM's DNS services

The cakelampvm has been set up to provide a DNS server which will answer - name requests for all of the sites that the VM hosts.

+ name lookup requests on any of the sites that the cakelampvm is hosting + for you.  It will also serve as a general DNS server for any other + domains that need to be looked up.

To use the cakelampvm DNS, modify your host operating system network configuration by adding or changing the DNS server to use the guest VM's - DNS service.  This is available at the local address - 10.28.42.20.  The DNS server can be tested with nslookup, dig and - other tools.

+ DNS service.  The cakelampvm is available at the local IP address + 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.

-

If the DNS server is properly set up, then these ping commands should get - answering responses:

+ 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 + 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.

+

It is important 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!

+

Once the DNS server is properly set up, these ping commands should get + answering responses (from 10.28.42.20):

ping cakelampvm.com
ping defaultcake.cakelampvm.com
ping mapsdemo.cakelampvm.com
-

Editing files on the guest VM from the host

+

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 called cakelampvm.  This should provide some network shares using Microsoft SMB protocol, and they can be attached to using the "developer" @@ -121,7 +209,7 @@

sudo chmod g+w /var/www

Afterwards, the www folder should allow the developer user to create new folders at will.

-

Accessing files on the host PC from the guest VM

+

Accessing files on the host PC from the guest VM

If you want to share a folder from the host to the guest, perhaps for driver updates or other conveniences, then make the share with these steps:

@@ -139,14 +227,21 @@

Adding a new website and domain on the guest VM

-

To add a new website, you will need to pick one of the DNS options below - (A or B) depending on how you want to name the site.  After the DNS - is updated, then follow the section after for creating a new apache conf - file.

-

Assuming one has created a new folder in "www" called "greatsite", then - the new web site can be brought online on the vm with one of the following - options.

-

DNS Option A: Using a sub-domain in the cakelampvm.com domain

+

To add a new website, you will first need to pick one of the DNS options + below (A or B) depending on how you want to name the site.

+

Let us say a customer needs an application called "excalibur".  It + will be a new subdomain within an existing domain, such as the + "cakelampvm.com" domain, meaning we want the VM to start answering + requests for "excalibur.cakelampvm.com".

+

DNS Option A: Adding a sub-domain in an existing domain

+ Note that this option requires the containing domain "cakelampvm.com" to + already exist before adding the subdomain; see DNS Option B below for + details on how to add a containing domain for the first time. +

Quick approach: Use the feisty meow add_domain command.

+

Run this command in a bash shell on the VM:

+
add_domain excalibur.cakelampvm.com
+

Done.

+

Manual approach: Edit the bind9 configuration.

Connect to the cakelampvm via ssh as the developer user, e.g.: ssh developer@cakelampvm.com

Execute the following command to edit the DNS file for the cakelampvm @@ -243,6 +338,12 @@

iface enp0s8 inet dhcp

Handy Techniques

+

Assorted Guides and Cheat-Sheets

+

Cheat sheet for Vim: https://vim.rtorr.com/

+

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

+


+

Get the network address on the guest vm

Run this command: ifconfig

In the results, look for "inet addr".  There may be more than one, @@ -279,7 +380,20 @@ https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-v here: https://help.ubuntu.com/community/How%20to%20Create%20a%20Network%20Share%20Via%20Samba%20Via%20CLI%20%28Command-line%20interface/Linux%20Terminal%29%20-%20Uncomplicated%2C%20Simple%20and%20Brief%20Way%21 +


+

+


+

+


+

+

remaining work:

+

todo: arrange gritty details to back.

+

todo: toc goes after intro paragraph.


+
+


+

+