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