From: Chris Koeritz Date: Tue, 21 Nov 2017 08:02:20 +0000 (-0500) Subject: Merge branch 'dev' of feistymeow.org:feisty_meow into dev X-Git-Tag: 2.140.105^2~4^2 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=907c7603c5aa7a6f1ab095df566383f9eb7c4533;hp=d9c59866994cc5d419a1f40cb048e03f84c6747f;p=feisty_meow.git Merge branch 'dev' of feistymeow.org:feisty_meow into dev --- diff --git a/production/feisty_meow_config.ini b/production/feisty_meow_config.ini index e11b6d7a..8d40e50c 100644 --- a/production/feisty_meow_config.ini +++ b/production/feisty_meow_config.ini @@ -3,7 +3,7 @@ # specifies the version of the code that is being constructed here. major=2 minor=140 -revision=102 +revision=104 build=420 # specifies the remainder of the version record info. 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 561e734a..2d540069 100644 --- a/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html +++ b/production/sites/cakelampvm.com/docs/manual/cakelampvm_guide_v002.html @@ -7,21 +7,29 @@

The cakelampvm VM:
Configuration and Usage

-

By Chris Koeritz

+
By Chris + Koeritz
+ feisty meow® concerns ltd.

Vintage: cakelampvm v002    - Updated: 2017-11-16 (rev E)

+ Updated: 2017-11-20 (rev. g)

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.

+ in a bottle", serving up your web sites securely and only to your local + host.  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.  + This VM was built with the assistance of and was partially funded by Saco Design of Winterport, + Maine.

Commands preceded by an octothorpe ('#') below are intended to be typed into a bash shell running on the cakelampvm virtual machine.  The bash shell can be obtained either by logging into the VM through ssh or by @@ -29,52 +37,28 @@ ssh session more convenient, because copy & paste features work as expected.

Commands preceded by a greater-than symbol ('>') are intended to be - run on the Host PC in a Windows command prompt (or in a bash prompt running - on the Host PC).

+ run on the Host PC in a Windows command prompt (or in a bash prompt + running on the Host PC).

Guest VM Configuration

-

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 feisty meow scripts recently - incorporated the "avbash" collection from Saco Designs and added those - scripts to a new "site_avenger" collection of scripts.  The site - avenger scripts 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 an accompanying DNS domain and - Apache2 site definition. -

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 initially.  The site avenger script commands - are documented 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. +
  3. Download and install virtualbox: https://www.virtualbox.org/wiki/Downloads
  4. Install the extension pack for Virtualbox: This provides USB drivers and other features.  This is installed on Virtualbox itself (on the Host PC), not on the guests.
    1. -
    2. Download the extension pack at - https://www.virtualbox.org/wiki/Downloads
    3. +
    4. Download the extension pack (also) at https://www.virtualbox.org/wiki/Downloads
    5. Stop any running Virtualbox VMs.
    6. Close the Virtualbox control panel.
    7. Double-click on the downloaded extensions package (in a file @@ -95,11 +79,13 @@ meow

      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.

      + internet or from the LAN, and can only be accessed by your host PC.  + This is a key component of security for your VM and your host PC, and is + considered a crucial configuration step.

      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.

      + This can be corrected simply by opening the cakelampvm 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 @@ -126,10 +112,11 @@ meow

        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.

        + for any communication off of the host machine.  This is another + crucial component for the security of the VM and your host PC.  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 @@ -148,47 +135,91 @@ meow

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

          + remaining configuration problems in the VM.  The Linux boot sequence + will show many lines of text, before bringing up a black console window + with a login dialog.

          If Windows complains about the Virtualbox application slamming into its 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.

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

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

          +

          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

          Updating cakelampvm to the Latest Model

          -

          The cakelampvm is released with the intention to not be released - again.  Version 001 was not built with that explicit intention, which - then required the release of Version 002.  We hope to not need a v003 - release.

          +

          The cakelampvm v002 is released with the intention that it not need to be + released again.  Version 001 was not built with that explicit + intention, which then required the release of Version 002.  But we + hope to not need a v003 release...

          There is an update feature built into the VM that is quite easy to use.  The updates are driven by the feisty meow script repository in conjunction with a local scripted command.  To activate the "update - process" for your VM, run the following commands (without the initial '#' - symbol):

          -

          # rpuffer $FEISTY_MEOW_APEX   # updates to the latest version - of feisty meow
          - # revamp_cakelampvm    # enacts any configuration changes - needed, plus fixes web folder and other permissions.

          + process" for your VM, run the following commands on the VM (without the + initial '#' symbol):

          +
          # rpuffer $FEISTY_MEOW_APEX   # updates to the latest version of feisty meow
          +# revamp_cakelampvm           # enacts any configuration changes needed,
          # plus fixes web folder and other permissions.

          These two commands can be run at any time to patch up your VM to the latest.

          The first command ("rpuffer ...") is also useful on its own for getting - the latest version of the feisty meow code.  If there are bug fixes - you need for the scripts or you want updated cakelampvm documentation, - that is the command to use.

          + the latest version of the feisty meow code.  Run it again if there + are bug fixes you need for any of the scripts or if you would like the + most up-to-date cakelampvm documentation.

          +

          First Tasks as the Developer User

          +

          Here are some first steps that will make the vm your own:

          +
            +
          1. Change your password for the developer account.  (This may + eventually be required and automatic.)  First, log into the VM with + ssh.  Then type this command:
            +
            # passwd
            + The 'passwd' command will ask for your current password, and then for a + new password plus a verification of that new password.
            +  
          2. +
          3. Change your git configuration for the user and email address.  + This is how we've configured it so far:
            +
            # git config --global user.email "developer@cakelampvm.com"
            +
            # git config --global user.name "Developer J. Cakemo"
            + If you're developing on a real project, you probably don't want the + bogus email and even more bogus name above attached to your + commits.  Just run the two commands again but with proper values.
          4. +
          +

          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 feisty meow scripts recently + incorporated the "avbash" collection from Saco Design and added those + scripts to a new "site_avenger" collection of scripts.  The site + avenger scripts 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 an accompanying DNS domain and an + Apache2 site definition. +

          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 initially.  The site avenger script commands + are documented in the feisty + meow command reference file.

          +

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

          +

          X11 applications launched from the VM

          +

          [incomplete section]

          +

          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.  This section + describes how to set up Cygwin to run X server, which enables X11 + 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 lookup requests on any of the sites that the cakelampvm is hosting @@ -213,15 +244,17 @@ meow

          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 - keeps going forever, so hit control-C when you are tired of seeing the pings:

          + keeps going forever, so hit control-C when you are tired of seeing the + pings:

          # ping cakelampvm.com
          # ping mapsdemo.cakelampvm.com

          Note that any other answer than 10.28.42.20 for the address is *bzzzt* wrong, and means something needs to be fixed.

          If these pings succeed (which hopefully they will!), then try accessing the websites of each domain:

          -
          (browse to) http://cakelampvm.com
          -
          (browse to) http://mapsdemo.cakelampvm.com
          +
          (browse to) http://cakelampvm.com
          +
          (browse to) http://mapsdemo.cakelampvm.com

          These should show local sites on the VM rather than sites on the 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 @@ -285,13 +318,10 @@ meow developer's home folder also ("/home/developer").

          If you run into any permission problems that prevent file access, either remotely or within the VM itself, then try running this command to fix - them:

          + them (repeated from the section above about updating the cakelampvm):

          # revamp_cakelampvm

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

          -

          The revamp command above is also used to deliver new configuration to the - VM from the feisty meow script environment; running it after any update of - the feisty meow codebase is a good idea.

          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 @@ -312,7 +342,7 @@ meow

          Note: these instructions, even the quick approaches below, pale in comparison to the ease of use of the "standup" command in feisty meow's site avenger scripts.  The standup command is detailed in the feisty + target="_blank" title="useful commands" href="https://feistymeow.org/feisty_meow/documentation/feisty_meow_command_reference.txt">feisty meow command reference document.  These instructions are for situations when the domain or site is idiosyncratic in some way that standup doesn't support.

          @@ -418,9 +448,10 @@ meow it means the DNS is working.  If there are no responses or it's some other IP address talking back, check the instructions in the above DNS sections.

          -

          Once the DNS is working, try browsing to the site at "http://excalibur.tv".  - That should at least bring up the configured site storage path, even if - nothing is being served from that folder yet.

          +

          Once the DNS is working, try browsing to the site at "http://excalibur.tv".  That should + at least bring up the configured site storage path, even if nothing is + being served from that folder yet.

          If the new site is not showing up properly, try examining the apache logs for any error messages that can be corrected.  The log files are stored in "/var/log/apache2" and are named after the website (if @@ -428,13 +459,14 @@ meow

          Handy Techniques for Using cakelampvm

          Assorted Guides and Cheat-Sheets

          A Cheat sheet for the Vim editor (there are many of these available): https://vim.rtorr.com/

          -

          A git branching model that seems to work well: https://vim.rtorr.com/

          +

          A 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, - if there are multiple network interfaces.

          +

          Run this command:

          +
          # ifconfig
          +

          In the results, look for "inet addr".  + There may be more than one, if there are multiple network interfaces.

          The standard IP address is 10.28.42.20 for the cakelampvm.

          How to cleanly reboot or shut down the guest VM

          When you've got the DNS and everything integrated, these commands will @@ -447,8 +479,6 @@ meow

          # sudo shutdown -h now

          Using these commands is kinder to the VM than just cycling the power from the Virtualbox control panel.

          -


          -

          Gritty Details of the Nitty Variety

          This is the lowest level of plumbing for your VM.  Hopefully you will not need to engage with this section.  The most useful doc @@ -503,23 +533,24 @@ meow

          • Downloaded and installed Virtualbox for host computer (where the vm image will be built).
          • -
          • Downloaded ubuntu server 16.04 iso. - (https://www.ubuntu.com/download/server)
          • +
          • Downloaded ubuntu server 16.04 iso. (https://www.ubuntu.com/download/server)
          • Created a new vm in Virtualbox, telling it to start from the ubuntu server iso.
          • -
          • Installed LAMP stack on guest VM.  Some help here: - http://howtoubuntu.org/how-to-install-lamp-on-ubuntu
          • -
          • Configured CAKE on the guest VM.  Useful link: - https://askubuntu.com/questions/628938/how-to-install-cakephp-in-ubuntu-14-04
          • +
          • Installed LAMP stack on guest VM.  Some help here: http://howtoubuntu.org/how-to-install-lamp-on-ubuntu
          • +
          • Configured CAKE on the guest VM.  Useful link: https://askubuntu.com/questions/628938/how-to-install-cakephp-in-ubuntu-14-04
          • Configured the two network adapters as needed (one for host-only network and one for nat network).  Here's some info about - Virtualbox networking with two adapters similar to our setup: -https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in
            + Virtualbox networking with two adapters similar to our setup: https://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-...
          • Installed and configured Samba service for the guest VM.  The main config file lives in "/etc/samba/smb.conf".  Some pointers - 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
          • + here: https://help.ubuntu.com/community/How%20to%20Create... +

          • +