From 3ace9d287d657b6f4ca75b7813763843933d1f00 Mon Sep 17 00:00:00 2001
From: Chris Koeritz The cakelampvm project provides a Virtualbox VM that acts as an "internet
in a bottle", serving up your web sites securely and only to your local
host. The virtual machine provides DNS services (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
- logging in directly to the Virtualbox VM console. You may find the
- ssh session more convenient, because copy & paste features work as
- expected. Commands in fixed-width bold 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 logging in
+ directly to the Virtualbox VM console. You may find the 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). 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: 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: The cakelampvm v002 is released with the intention that it not need to be
released again. Version 001 was not built with that explicit
@@ -168,30 +169,45 @@
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 on the VM (without the
- initial '#' symbol):
feisty meow® concerns ltd.
Vintage: cakelampvm v002
- Updated: 2017-11-20 (rev. g)
+ Updated: 2017-12-19 (rev. h)
IPv6 Address: (leave blank)
IPv6 Prefix Length: 0
- Virtualbox will fill in the other details like so:
+ Virtualbox will fill in the other details like so (this dialog may
+ differ between versions of virtualbox):
@@ -129,7 +129,8 @@
Network CIDR: 10.0.2.0/24
Supports DHCP: checked
Supports IPv6: optionally checked
- These are my settings, with IPv6 left disabled:
+ These are my settings, with IPv6 left disabled (this dialog may differ
+ between versions of virtualbox):
Starting up the VM and Connecting to It
@@ -150,16 +151,16 @@
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
+ ssh developer@10.28.42.20
# or perform the equivalent connection with your ssh client.# ssh developer@cakelampvm.com
+ ssh developer@cakelampvm.com
Key Forwarding to the VM
cakelampvm.com
+
10.28.42.20cakelampvm.com
10.28.42.20Updating cakelampvm to the Latest Model
# rpuffer $FEISTY_MEOW_APEX # updates to the latest version of feisty meow
-# revamp_cakelampvm # enacts any configuration changes needed,
+ process" for your VM, run the following commands on the VM:
# plus fixes web folder and other permissions.
# update to the latest version of feisty meow.
rpuffer $FEISTY_MEOW_APEX; reconfigure_feisty_meow
# enact any configuration changes needed, such as permissions and account setup.
+revamp_cakelampvm
+
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. 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.
+Recent versions of feisty meow support a new "get_feisty" + command, which will behave the same as the first line above. Once + you have run the "puffer..." command above for the first time (on + cakelampvm v002), this new command becomes available.
+Here are some first steps that will make the vm your own:
# passwd+
passwd
The 'passwd' command will ask for your current password, and then for a
new password plus a verification of that new password.# git config --global user.email "developer@cakelampvm.com"-
# git config --global user.name "Developer J. Cakemo"+
git config --global user.email "developer@cakelampvm.com"
+ git config --global user.name "Developer J. Cakemo"
+ (The feisty meow codebase is already configured for the developer account on the cakelampvm virtual machine.)
-[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}...
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 @@ -239,11 +246,11 @@ 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. 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.
+ 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.If your Host PC is running Windows, see the DNS configuration section below that is tailored to that operating system.
Important Note: It behooves you to remember to switch back to a normal @@ -255,8 +262,9 @@ meow 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:
-# ping cakelampvm.com-
# ping mapsdemo.cakelampvm.com+
ping cakelampvm.com
+
+ ping www.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 @@ -292,9 +300,9 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com
> ipconfig /flushdns
and on Linux the flush DNS command can be many different things, but try these two most common options:
-# sudo service dns-clean restart # restarts the client side DNS cache.+
# restarts the client side DNS cache.
sudo service dns-clean restart
or
-# sudo service nscd restart # restarts the nscd caching server.+
# restarts the nscd caching server.
sudo service nscd restart
After, this try the pings again. If they still fail, please go back
over your DNS configuration very carefully. The cakelampvm's DNS
feature *does* actually work, but operating systems sometimes do their best
@@ -357,7 +365,7 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com
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 (repeated from the section above about updating the cakelampvm):
-# revamp_cakelampvm+
revamp_cakelampvm
Afterwards, the www folder and others should allow the developer user to create new folders at will.
# mkdir ~/shared # for the guest's version of the shared folder+
# sudo mount -t vboxsf myshare ~/shared # mount the vm's share name onto the folder on the vm.
# make the guest's version of the shared folder
mkdir ~/shared
# mount the vm's share name onto the folder on the vm.
sudo mount -t vboxsf myshare ~/shared
[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}...
Note: these instructions, even the quick approaches below, pale in comparison to the ease of use of the "standup" command in feisty meow's @@ -404,18 +421,18 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com details on how to add a containing domain for the first time.
Run this command in a bash shell on the VM:
-# add_domain excalibur.cakelampvm.com+
add_domain excalibur.cakelampvm.com
Done.
Note: the manual approach is not compatible with later use of feisty meow's "remove_domain".
Execute the following command to edit the DNS file for the cakelampvm domain: -# sudo vi /etc/bind/cakelampvm.com.conf+
sudo vi /etc/bind/cakelampvm.com.conf
Add a stanza for the new site at the end of this file:
excalibur.cakelampvm.com. IN A 10.28.42.20
IN HINFO "linux server" "ubuntu"
Restart the DNS server:
-# sudo service bind9 restart+
sudo service bind9 restart
Afterwards, pinging excalibur.cakelampvm.com should work from both the guest VM and the host PC.
# add_domain excalibur.tv+
add_domain excalibur.tv
Done.
Note: the manual approach is not compatible with later use of feisty @@ -441,7 +458,7 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com to add the new file by adding this bit of configuration at the end:
zone "excalibur.tv" in {
file "/etc/bind/excalibur.tv.conf";
type master;
allow-query { any; };
};
Restart the DNS server:
-# sudo service bind9 restart+
sudo service bind9 restart
Afterwards, pinging excalibur.tv should work from both the guest and the host.
Run this command in a bash shell on the VM:
-# add_apache_site excalibur excalibur.tv+
add_apache_site excalibur excalibur.tv
(The first parameter is the application name, the second is the domain name.)
Done.
@@ -471,21 +488,21 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com appropriate file name that includes the site's domain name. We will call our config file "excalibur.tv.conf". If you developed the file in your home folder, this would be the command to move it up to Apache: -# sudo cp ~/excalibur.tv.conf /etc/apache2/sites-available+
sudo cp ~/excalibur.tv.conf /etc/apache2/sites-available
Then tell apache to use the new file:
-# sudo a2ensite excalibur.tv # the '.conf' portion of the filename is unnecessary for this command. +href="http://nvie.com/posts/a-successful-git-branching-model/">http://nvie.com/posts/a-successful-git-branching-model/sudo a2ensite excalibur.tv
# the '.conf' portion of the filename is unnecessary for this command.Finally, restart apache to get it to begin serving the site:
-# sudo service apache2 restart+sudo service apache2 restart
Test the new web site
Given the configuration above, your host PC should now be able to access the new website on the domain "excalibur.tv".
To test this, first try pinging the new DNS name:
-# ping excalibur.tv-If there are responses to the ping *and* the answer is 10.28.42.20, then - 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.
+ping excalibur.tv
+If there are responses to the ping *and* + the answer is 10.28.42.20, then 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 @@ -502,23 +519,22 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com
This is a basic guide to the Google Developer Console and API Key management: Google - API Docs
-+ API Docs
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.
+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.
Run this command:
-# ifconfig+
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.
@@ -526,11 +542,11 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.comWhen you've got the DNS and everything integrated, these commands will manage the vm's state:
First, log into the guest VM:
-# ssh developer@cakelampvm.com+
ssh developer@cakelampvm.com
Then, to reboot the guest VM:
-# sudo reboot+
sudo reboot
Or, to halt the guest VM:
-# sudo shutdown -h now+
sudo shutdown -h now
Using these commands is kinder to the VM than just cycling the power from the Virtualbox control panel.
# sudo mount /dev/sr0 /media/cdrom+
sudo mount /dev/sr0 /media/cdrom
Linux will mention that the device is mounted "read-only".
# cd /media/cdrom+
# sudo sh VBoxLinuxAdditions.run
cd /media/cdrom
sudo sh VBoxLinuxAdditions.run
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+
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 @@ -593,12 +609,12 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com
2. Reboot the VM to the gparted ISO image (available at the gparted site) and run the following command:
-# sudo zerofree /dev/sda+
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+
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.
@@ -625,8 +641,6 @@ href="http://mapsdemo.cakelampvm.com">http://mapsdemo.cakelampvm.com