<p>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.</p>
+ <p>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.</p>
+ <p>To configure the host-only network, follow these steps:</p>
<ol>
<li> Go to virtual box "Preferences" (global preferences, not for a
specific vm).</li>
for convenience and stability.</li>
</ol>
<p>Additional information on host-only (and other) network adapter types is
- at: https://www.virtualbox.org/manual/ch06.html#network_nat_service<br>
- </p>
- <h3>Configure the Nat Network on virtualbox<a id="#nat-network" name="#nat-network"></a></h3>
+ at: https://www.virtualbox.org/manual/ch06.html#network_nat_service</p>
+ <h3>Configure the NAT Network on virtualbox<a id="#nat-network" name="#nat-network"></a></h3>
+ <p>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.</p>
+ <p>To set up the NAT network, follow these steps:</p>
<ol>
<li> Go to virtual box "Preferences" (global preferences, not for a
specific vm).</li>
<pre>ping cakelampvm.com</pre>
<pre>ping defaultcake.cakelampvm.com</pre>
<pre>ping mapsdemo.cakelampvm.com</pre>
- <h3>Setting up DNS on Windows</h3>
+ <h3>Setting up DNS on Windows<a id="#windoze-dns" name="#windoze-dns"></a></h3>
<p>The ipconfig tool will provide helpful information about your current
networking and DNS configuration:</p>
<pre>ipconfig --all</pre>
<pre>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</pre>
<p><br>
</p>
- <p><br>
+ <p>{fill in rest}<br>
</p>
<p><br>
</p>
- <h2>Editing files on the guest VM from the host</h2>
+ <h2>Editing files on the guest VM from the host<a id="#editing-files-on-vm"
+ name="#editing-files-on-vm"></a></h2>
<p>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"
<pre>sudo chmod g+w /var/www</pre>
<p>Afterwards, the www folder should allow the developer user to create new
folders at will.</p>
- <h2>Accessing files on the host PC from the guest VM</h2>
+ <h2>Accessing files on the host PC from the guest VM<a id="#samba-shares" name="#samba-shares"></a></h2>
<p>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:</p>
</li>
</ol>
<h2>Adding a new website and domain on the guest VM</h2>
- <p>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.</p>
- <p>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.</p>
- <h3>DNS Option A: Using a sub-domain in the cakelampvm.com domain</h3>
+ <p>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 <a
+ title="useful commands" href="https://feistymeow.org/feisty_meow/documentation/feisty_meow_command_reference.txt">feisty
+ meow command reference</a> document. These instructions are for
+ situations when the domain or site is idiosyncratic in some way that
+ standup doesn't support.</p>
+ <p>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. If the
+ DNS name of the site is contained within another existing domain (e.g.,
+ "A.B.C" has subdomain A contained in domain B.C), use Option A. If
+ the DNS name is a so-called "Second Level Domain" (SLD), then it stands on
+ its own (e.g., "B.C" is an SLD).</p>
+ <p>Once the DNS option has been picked and implemented, continue to the next
+ section of "Creating a New Apache Site".</p>
+ <h3>DNS Option A: Adding a sub-domain in an existing domain</h3>
+ <p>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".</p>
+ 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.
+ <h4>Quick approach: Use the feisty meow "add_domain" command.</h4>
+ <p> Connect to the cakelampvm via ssh as the developer user, e.g.: ssh
+ developer@cakelampvm.com </p>
+ <p>Run this command in a bash shell on the VM:</p>
+ <pre># add_domain excalibur.cakelampvm.com</pre>
+ <p>Done.</p>
+ <h4>Manual approach: Edit the bind9 configuration.</h4>
+ <p>Note: the manual approach is not compatible with later use of feisty
+ meow's "remove_domain".</p>
Connect to the cakelampvm via ssh as the developer user, e.g.: ssh
developer@cakelampvm.com
<p>Execute the following command to edit the DNS file for the cakelampvm
domain:</p>
- <pre>sudo vi /etc/bind/cakelampvm.com.conf</pre>
+ <pre># sudo vi /etc/bind/cakelampvm.com.conf</pre>
<p>Add a stanza for the new site at the end of this file:</p>
- <pre>greatsite.cakelampvm.com IN A 10.28.42.20<br> IN HINFO "linux server" "ubuntu"</pre>
- <p>Restart the DNS server: sudo service bind9 restart</p>
- <p>Afterwards, pinging greatsite.cakelampvm.com should work from either the
- guest or the host.</p>
+ <pre>excalibur.cakelampvm.com IN A 10.28.42.20<br> IN HINFO "linux server" "ubuntu"</pre>
+ <p>Restart the DNS server:</p>
+ <pre># sudo service bind9 restart</pre>
+ <p>Afterwards, pinging excalibur.cakelampvm.com should work from both the
+ guest VM and the host PC.</p>
<h3>DNS Option B: Using an entirely new domain for the site</h3>
- <p>Similar procedure to above, but we will create a new file for the new
- domain and add it to the bind directory. For this example, we will
- create a file called /etc/bind/greatsite.tv.conf for our new domain
- greatsite.tv with these contents:</p>
- <pre>$TTL 1W<br>@ IN SOA @ fred.cakelampvm.com. (<br> 2017100801 ; serial<br> 2H ; refresh<br> 8M ; retry<br> 14D ; expiry<br> 6H ) ; minimum<br><br> IN NS ns.cakelampvm.com.<br> IN MX 10 mail.cakelampvm.com.<br><br># main domain for machine.<br>greatsite.tv. IN A 10.28.42.20<br> IN HINFO "linux server" "ubuntu"</pre>
- The gnarly prefix stuff above the "greatsite.tv." listing establishes
+ <p>This is a similar procedure to Option A, but we will create a totally new
+ config file for the new domain and add it to the bind directory. For
+ this example, we need to add the site "excalibur.tv" into the DNS.</p>
+ <h4>Quick approach: Use the feisty meow "add_domain" command.</h4>
+ <p> Connect to the cakelampvm via ssh as the developer user, e.g.: ssh
+ developer@cakelampvm.com </p>
+ <p>Run this command in a bash shell on the VM:</p>
+ <pre># add_domain excalibur.tv</pre>
+ <p>Done.</p>
+ <h4>Manual approach: Edit a new DNS config file</h4>
+ <p>Create a file called /etc/bind/excalibur.tv.conf for our new domain
+ excalibur.tv with these contents:</p>
+ <pre>$TTL 1W<br>@ IN SOA @ fred.cakelampvm.com. (<br> 2017100801 ; serial<br> 2H ; refresh<br> 8M ; retry<br> 14D ; expiry<br> 6H ) ; minimum<br><br> IN NS ns.cakelampvm.com.<br> IN MX 10 mail.cakelampvm.com.<br><br># main domain for machine.<br>excalibur.tv. IN A 10.28.42.20<br> IN HINFO "linux server" "ubuntu"</pre>
+ The gnarly prefix stuff above the "excalibur.tv." listing establishes
configuration info for the new domain. This file relies on the
existing cakelampvm.com infrastructure in DNS, such as the "ns" host, which
- is the domain's name server.
+ is the domain's name server. However, the new domain does <span style="text-decoration: underline;">not</span>
+ live inside the cakelampvm.com domain.<br>
<p>Now that the config file is in place, edit "named.conf.local" to add the
new file by adding this bit of configuration at the end:</p>
- <pre>zone "greatsite.tv" in {<br> file "/etc/bind/greatsite.tv.conf";<br> type master;<br> allow-query { any; };<br>};</pre>
- <p>Restart the DNS server: sudo service bind9 restart</p>
- <p>Afterwards, pinging greatsite.tv should work from either the guest or the
+ <pre>zone "excalibur.tv" in {<br> file "/etc/bind/excalibur.tv.conf";<br> type master;<br> allow-query { any; };<br>};</pre>
+ <p>Restart the DNS server:</p>
+ <pre># sudo service bind9 restart</pre>
+ <p>Afterwards, pinging excalibur.tv should work from both the guest and the
host.</p>
- <h3>Create a new apache configuration file and load it</h3>
+ <h3>Creating a New Apache site</h3>
<p>Start with the following template file for the new website, and modify it
for the appropriate host name:</p>
<pre><VirtualHost *:80><br> ServerName greatsite.cakelampvm.com<br> ServerAlias greatsite.cakelampvm.com *.greatsite.cakelampvm.com<br> DocumentRoot /var/www/greatsite<br> ErrorLog ${APACHE_LOG_DIR}/greatsite.cakelampvm.com-error.log<br> CustomLog ${APACHE_LOG_DIR}/greatsite.cakelampvm.com-access.log combined<br> Alias /statistics "/var/www/webwork.repository/webwork/maps_demo/webroot/statistics"<br> Include /etc/apache2/conf-library/basic-options.conf<br> Include /etc/apache2/conf-library/rewrite-enabling.conf<br></VirtualHost></pre>