Converted LocalHost Drupal site to Multisite

Search is a Wonderful Thing

Someone else has done it already so I followed their lead

http://drupal.org/node/1114158

I found this page on Drupal.org and decided to follow it’s instructions

Keep in mind, I’m fairly new to Drupal, Linux and Apache servers

  • Followed directions to set default site hostname
    • Create a file called /etc/apache2/sites-available/drupal7 saying:
      <VirtualHost *:80>
      DocumentRoot /vagrant/public/var/www/drupal7
      ServerName drupal7
      </VirtualHost>
      <VirtualHost *:80>
      DocumentRoot /vagrant/public/var/www/drupal7
      ServerName foxfamily
      </VirtualHost>
      <VirtualHost *:80>
      DocumentRoot /vagrant/public/var/www/drupal7
      ServerName foxcustom
      </VirtualHost>
    • Create a file called /etc/apache2/conf.d/drupal7.conf saying:
      Alias drupal7 127.0.0.1
      Alias foxfamily 127.0.0.1
      Alias foxcustom 127.0.0.1
      <Directory /vagrant/public/var/ww/drupal7>
      Options +FollowSymLinks
      AllowOverride All
      order allow,deny
      allow from all
      </Directory>
  • Created new databases
    • Using Putty – created dbname_fox and dbname_default
  • Setting up Subdirectories
    • Since I didn’t understand the structure of apache, I set up everything under /vagrant/public
    • So, I moved everything, except for the make file and made var/www/drupal7
    • created /sites/fox-custom-software.com/ directory
    • created /sites/fox-family-website.us/ directory
    • Followed Bulk loop 2 and copied /sites/default to /sites/fox-custom-software.com
    • For each site subdirectory, I edited setting.php to have the database names for each site
      • fox-family-website.us – dbname_fox
      • fox-custom-software-com – dbname (no change)
      • default – dbname_default
    • Copy /var/www/drupal7/sites/example.sites.php to /var/www/drupal7/sites/sites.php .
    • Edited the site.php and set up entries for all the hosts:
      • $sites[drupal7] = “fox-default-site.com”;
      • $sites[foxcustom] = “fox-custom-software.com”;
      • $sites[foxfamily] = “fox-family-website.us”;
    • Setting the hostnames – /etc/apache2/sites-enabled/drupal7
      <VirtualHost *:80>
      DocumentRoot /vagrant/public/var/www/drupal7
      ServerName drupal7
      </VirtualHost>
      <VirtualHost *:80>
      DocumentRoot /vagrant/public/var/www/drupal7
      ServerName foxfamily
      </VirtualHost>
      <VirtualHost *:80>
      DocumentRoot /vagrant/public/var/www/drupal7
      ServerName foxcustom
      </VirtualHost>
    • In /etc/apache2/conf.d/drupal7.conf added lines for each host
      • Alias drupal7 127.0.0.1
      • Alias foxcustom 127.0.0.1
      • Alias foxfamily 127.0.0.1
      • The whole file:
        Alias drupal7 127.0.0.1
        Alias foxfamily 127.0.0.1
        Alias foxcustom 127.0.0.1<Directory /vagrant/public/var/ww/drupal7>
        Options +FollowSymLinks
        AllowOverride All
        order allow,deny
        allow from all
        </Directory>
    • Relauch Apache
      • sudo service apache2 restart
      • I got some messages
        Restarting web server apache2                                                apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
        [Sat Feb 16 02:45:23 2013] [warn] NameVirtualHost *:443 has no VirtualHosts
        … waiting apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
        [Sat Feb 16 02:45:24 2013] [warn] NameVirtualHost *:443 has no VirtualHosts
      • Using my browser, I went to foxfamily/install.php and set up the blank site
      • Using my browser, I went to drupal7/install.php and set up the blank site.

      Problems

    • Since I copied everything from sites/default to sites/fox-custom-software.com/ and followed the suggestion to not use the sites/default, I had to correct some file name errors and had to correct entry in Configuration>Media>Public file system path to sites/fox-custom-software.com/files

    Future

  • Learn how to use Backup/Restore Module (This is a reoccurring theme with me)
  • Learn more about Apache – I later saw that there is a /var directory, but decided to put the stuff under /vagrant/public so I could use the Windows editors that I know and (love?).  I know that I have to be careful as Windows has a habit of putting CR LF where you don’t want them. (or is it the other way around?)
  • Work on redoing my family website into Drupal and then migrating this whole mess up to my Host.

How I Migrated the Live Drupal site to VirtualBox site

This is what I did–Brute Force, But it worked, sort of

  1. Used MyPHPAdmin and exported the database (after following Katy’s instructions to clear the various cache tables and other ones–I forget)
  2. Downloaded the foxfami1_drp10.sql file to vagrant-chef-dlamp/public directory
  3. Using Putty:  Went into MySql and deleted/redefined dbname database (easier than manually deleting all the tables)
    1. mysql -u root -p
    2. drop database dbname;
    3. create database dbname;
  4. Using Putty: mysql -u root -p dbname<vagrant/public/foxfami1_drp10.sql – to restore the database.
  5. On Host:  Used Zip to save the existing Site folder, downloaded and unZipped it to /vagrant-chef-dlamp/public and replaced the existing site directory.
  6. Using Putty: drush updatedb

Problems

  • Even though I thought that I had the same modules in the LocalHost Drupal, I was missing the Libaries Module,  This caused a problem with my Views Slideshow.
    • Undefined variable: module_path in _views_slideshow_cycle_preprocess_views_slideshow_cycle_main_frame() (line 91 of /vagrant/public/sites/all/modules/views_slideshow/contrib/views_slideshow_cycle/theme/views_slideshow_cycle.theme.inc).
    • From Putty:  drush dl libaries and then drush en libraries

Future

I need to figure out how exactly to use the Backup/Restore module to keep the database in sync and modules/themes.

Drupal Multihost on VirtualBox – Part 1

The Misadventures of Dabbling into Drupal and VirtualBox

Part 1: Following the Directions from Katy’s Site

I looked at the Part 1 directions and installed:

  1. VirualBox
    1. Download and install VirtualBox from https://www.virtualbox.org/wiki/Downloads
      Start VirtualBox.
  2. Vagrant
    1. Download and install the latest version of Vagrant from http://downloads.vagrantup.com. For this tutorial, we will use version 1.0.6.
      Windows users, download Vagrant.msi
    2. You may need to add “C:/vagrant/vagrant/bin” to your Path
  3. Create a directory /workflow under $c:/Users/[your user]
  4. Git
    1. Download Git for Windows here:
      http://code.google.com/p/msysgit/downloads/list
    2. See tutorial on How to Install Git in Windows 7 PC.
  5. Download Vagrant Chef script with Git, Open Git-Bash and type the following commands:
    1. $ cd C:/Users/User/workflow
    2. $ git clone https://github.com/eaton/vagrant-chef-dlamp
  6.  In order for this chef script to work on Wndows 7, you need to make the following edits in a file called VagrantfileLine 24  should be: config.vm.forward_port(80,8888)Line 29 should be: config.vm.share_folder(“v-root”, “/vagrant”, “.” :nfs => FALSE)
  7. Open your text editor in Windows and edit  $c:/Windows/System32/etc/hosts file
    10.0.0.10 dev-site.vm
  8. Use a Windows command prompt to install the Linux+Apache+PHP in the VirtualBox
    1. C:/Users/User>
    2. C:/Users/User> cd workflow
    3. C:/Users/User> cd vagrant-chef-dlamp
    4. C:/Users/User/workflow/vagrant-chef-dlamp> vagrant destroy
    5. C:/Users/User/workflow/vagrant-chef-dlamp > vagrant up
    6. The ‘vagrant up’ command will take time…
    7. Create a Shared folder  – shared between Windows and Vagrant DLAMP server In Windows cmd prompt:
      C:/Users/User/workflow/vagrant-chef-dlamp> mkdir public
  9. Putty (What you use to work on your virtual system)
    1. Install Putty – http://www.putty.org
    2. Open Putty
      1. Setup the Hostname as: 127.0.0.1
      2. Port: 2222
    3. You get a nasty security message, Click Yes
    4. Login: vagrant
    5. Password: vagrant
  10. Go to http://drushmake.me and create your drush file.  Download and Save it in the C:/Users/[youruser]/workflow/vagrant-chef-dlamp/public as starter.make
  11. There are some errors in the drush make file that need to be corrected:
    1. This line projects[drupal][version] = 7 should be projects[drupal][version] = 7.19 or
    2. projects[] = drupal
  12. Back in Putty session:
    1. $ drush make starter.make
    2. $ drush site-install – -db-url=mysql://root:root@localhost/dbname – Note** – the last part of this command created a dbname database for me
  13. Misc Drush Commands:
    1. Drush dl modulename1 for download
    2. Drush en modulename1 for enable
    3. Drush pm-disable modulename1 for disable
  14. Look at your site – http://dev-site.vm/

Problems encountered:

Vagrant up:  I had some odd messages that I needed a better guest additions and spent a lot of wasted time, thinking that is why the drush make and drush site-install didn’t work.

I had problems that the drush acted like it downloaded stuff, but didn’t really do it. Then when I went to do the drush site-install, it wouldn’t find Drupal.   I ended up going back to drushmake.me and regenerating a make file and downloading it. (Well, I actually did a Select-All and Copy-and-paste into the starter.make file)

Putty:  directory not found problem – I ended up making sure to do a cd / to go back to the root of the Linux and then cd dir1/dir2 (or whatever)

After the VirtualBox crash:  I had my laptop down for hibernate and it shut itself down and forced Virtual Box down.  (hadn’t been saved). When I restarted it, then it had problems finding the /public directory and I started again to reload the box.

Next Posts:  How I copied from Live Site down to VirtualBox, How I converted to a Multisite on the VirtualBox

What is NaBloPoMo?

Answer: National Blog Post Month

A Facebook friend has accepted a challenge to post an entry every day this month.  Perhaps, I will join her in this quest to share my inner being with others on the web.  My other blog is a Family blog, where I share pictures and stories of my family and friends. That is my ‘fun’ blog and this is where I let ‘my fingers do the talking’. Wait!  the slogan I was thinking of was actually, ‘let your fingers do the walking’.

NaBloPoMo

Sometimes, blogging comes easy to me and the words just flow from my mind through my fingers onto the page, and sometimes I don’t know what to write about. I think this is one of those ‘don’t know’ days.

I love penguins too and hope to have an adventure like this some day.

cloudlessness

Penguins.

They appear to be such innocent, beguiling creatures. So adorable. So darn cute.

Well, from previous experience, I already know they attack. The Adelie penguins that came at me en masse while I took photos around the Aurora Australis will forever be a disturbing highlight of my life. Now I know penguins can lull you into suicidal behaviour.

My friend Sharon and I found ourselves in Argentina’s Tierra del Fuego thwarted by boat scheduling difficulties in a last minute attempt to scoot over to the Chilean Antarctic territory of Isla Navarino.

Our Antarctic cravings would have to be satisfied elsewhere. Plan B would have us spying on penguins hanging out on an island a kilometre or two north of the most southerly part of Chile.

We headed off on a bus and zodiac tour with the only Ushuaia company allowed to let touristy types wander respectfully near the penguins…

View original post 563 more words

The Desert of Lent

This Journey thru the Wilderness

We have passed the fourth Sunday of Lent. In two Sundays, will be Palm Sunday and then Easter. I’m still looking for the right job. Just when I think that an interview went well–the silent treatment happens, which signifies that it did not go well. I mourn the fact that people can’t just say they are not interested in you for a position and just leave you out in the cold desert.

I had a phone call out of the blue for a developer position for a firm in Westerville. Not a head-hunter, a real representative from the company. I had a pleasant discussion with the HR person and a technical interview on Wednesday. I hope that I will not be sent to the desert again.

I also got an email from Apple about a work-at-home position to provide Apple support. I had applied to work at the Apple store and had a couple interviews (before they sent me to the desert). I have a Skype interview this week. Will see if I have what they are looking for.

Finally, got all the medical paperwork sent to the TSA from my various doctor offices. I expect to hear from them that something is wrong and needs to be resubmitted. I could be pleasantly surprised and see my application go further on in this long process. This adventure started in August of 2011 and progressed to a Medical exam in December. They came back with requests for more information from my Doctors and some were slow in getting the reams of documents that TSA wanted.

When I have not been out on the bicycle or babysitting, I have been filling the time and working on enhancing my bicycle trip logging Android app. It is functionally ready. Now I need to review the ‘Look and Feel’ before I publish it to the Google Marketplace, now named Google Play. (I prefer the first name).

Next week, I will have a companion in the desert, as it is spring break for the New Albany school district, and my husband Mike will be home. Edgar, my son and other unemployed companion, is now a working member of society. I miss his daily visits, but am glad he is getting on with his life and not just hanging around with his Mom.

Footprints in the snow

Strange, but usual weather in Central Ohio

image

There is a saying here, that if you don’t like the weather, just wait a day and it will change. Valentine’s Day was one of those days. We had a couple of inches of heavy, crunchy snow. I decided to walk to an appointment at the Credit Union, instead of driving. Mel, a church friend, saw me walking and asked if I needed a ride. That was so caring. It was a pleasant walk in the snow, that I decided to take Cooper out to enjoy a walk later in the day.

I found it interesting to look at the various footprints as I walked with him. That is the beauty of new snow