Tech4Him – Technology with Integrity

A Christian technology chaos wrangler and his thoughts

Archive for December, 2007

Force a Frontpage Node in Drupal

Posted by admin On December - 28 - 2007

This tip is handy if you have a need to specify a new frontpage node on your Drupal site and cannot get into the admin pages to change it. You can specify a number of configuration items in the settings.php file for your site.

In this case your are going to set the frontpage configuration. Near the bottom of your settings.php file is a section that is commented our by default for overriding configuration settings. Just add the following code below and change ‘node/1′ to whatever node you want for your new frontpage.

$conf = array ( ’site_frontpage’ => ‘node/1′,);


One big thing not to forget is the comma after the last setting statement.

We ran into this the other day helping somone on #drupal-support irc who had a multisite Drupal setup with subdirectories. He had removed the panels module and the site went belly up.

Blessings

Popularity: 6% [?]

By default, the Ubuntu installer has configured our system to get
its IP address and other network settings via DHCP. This is not what we
want so we have to change the server to have a static IP address. Edit /etc/network/interfaces and adjust it per your requirements. For this example we are using an IP address of 192.168.167.210 for this server.


Now,
there are a myriad of examples on the web and I am including a few
links to them for convenience sake in case they explain this better.
(they probably do) ;o)

vi /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo

iface lo net loopback

# The primary network interface

auto eth0

iface eth0 net static

address 192.168.167.210

netmask 255.255.255.0

network 192.168.167.0

broadcast 192.168.167.255

gateway 192.168.167.1

Now, restart your network:

/etc/init.d/networking restart

Then edit /etc/hosts.
We are telling the server what names it is going to answer to and to
which IP addresses those names belong. This is somewhat analogous to
the Windows hosts file if you are familiar with Windows:

vi /etc/hosts

127.0.0.1 localhost.localdomain localhost

192.168.0.100 server1.example.com server1

# The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

ff02::3 ip6-allhosts

Now execute the following commands.

hostname
hostname -f

The results from both commands should show server1.example.com. If they do not, reboot the system:

shutdown -r now

Log back into your server and try the hostname commands again.

hostname
hostname -f

They should show server1.example.com.

Now for those links I promised:

Link 1 on cyberciti.biz
Link 2 on howtogeek.com
Link 3 on howtoforge.com

Blessings

Popularity: 5% [?]

Well, victory is ours….sort of. See our previous post.

The
long and short of it is that we ended up just removing that Promise
FastTrak TX2 controller card and placed the two drive on the built-in
motherboard controllers. Since we have some other devices we
piggybacked both drives from the same controller which is not going to
be as performance minded as put each drive on a different controller
but for this application it is fine.

I thought that I would post
some articles describing in more detail our steps and experiences in
case it may be of use to others. So here we go.

Ubuntu 6.06 Server LTS Installation with Software RAID Support

  1. Boot from the Ubuntu 6.06 LTS Bootable CD (available from here)
  2. Choose the Start Server Install Option
  3. Follow and answer the standard prompts and entries until you get to the partitioning section
  4. This
    is where we did some research and manually created 4 partitions, 2 on
    each drive in order to create two RAID 1 arrays. The best explanation
    of this that we have found thus far is here.
    We deviated a bit from this article however. Our primary difference was
    in the changing of the partition sizes with the largest being the root
    filesystem and the smaller being the swap space.

    1. So
      here is our new physical partition view. (Be sure the root "/" mount
      points are set to "bootable" or you won’t be able to boot into your
      newly install Ubuntu Server.)

      Drive Partition Type Mounted on Size
      Drive0 /dev/hda1 Primary / 70GB
      /dev/hda2 Primary (swap area) 10 GB
      Drive1 /dev/hdb1 Primary / 70 GB
      /dev/hdb2 Primary (swap area) 10 GB
    2. We then used the above physical partitions to create these two Multidisk devices (arrays).
      RAID device Type Mounted on Size Members
      /dev/md0 RAID1
      mirror
      / 70 GB /dev/hda1
      /dev/hdb1
      /dev/md1 RAID1
      mirror
      (swap) 10 GB /dev/hda2
      /dev/hdb2
    3. Once
      you have the partition looking like the above, choose that you are
      finished and choose "yes" to the warning about writing these changes to
      the disks.
  5. Continue finishing out standard server installation prompts
  6. If
    you want to be sure you can boot from either of the two drives in the
    array (like if one goes out which is why you went to all this trouble
    to begin with) then you need to follow the step to get the grub loader
    install on the second disk. This is in the same article under the "Make
    Every Drive Bootable Section".

    1. Essentially boot the server CD again and choose "Rescue a broken system"
    2. Follow the system prompts until you see the "Device to use as root filesystem" prompt. STOP!
    3. Press
      Alt-F2 to go to the second console (TTY2) and hit enter. Here you are
      going to enter the follow command to mount the second drive

      mount /dev/md0 /mnt
      chroot /mnt
      grub
      device (hd0) /dev/sda
      root (hd0,0)
      setup (hd0)
      device (hd1) /dev/sdb
      root (hd1,0)
      setup (hd1)
      quit

    4. Now
      reboot your server. Don’t know how??? "shutdown -r now" (This tells the
      system shutdown. The "-r" says restart after the shutdown and the "now"
      means do it now instead of in 10 minutes or whatever else you might
      want to include there.)
  7. Login as administrator or whatever you choose for the username and password in the installation sequence.
  8. Perform
    "sudo apt-get update" to have apt-get update the list of packages and
    the "sudo apt-get upgrade" to ensure latest versions of all packages
    are applied.
  9. Finally I always like
    to install an SSH server right away so I can finish the system
    configuration form the comfort of my desk, a couch or some other comfy
    place. So run the "sudo apt-get install openssh-server" command.

A big thanks to the Ubuntu community and especially to Derrick Webber whose post was the basis for our successful installation.

Now
in our future new production hardware we will further distribute the
"/" root, "/var" and "/usr" mount points to individual partitions.

Blessings

Popularity: 9% [?]

Whew….this is a bit of an enigma right now. I know I read about some potential issues with this controller card but it is what we have to use. I thought those issue were primarily around driver support and bit write issues. What I did not expect was the difficulty in installing Ubuntu 6.06 LTS onto a mirror array created with the controller. Perhaps this is a symptom of the “poor driver support” issue?



Others seem to have similar issues. This one with no response as of today. This one without the expertise to resolve. A hopeful possibility is this one which I will try next if need be.



When the installer gets to the partitioner section instead of seeing a single array to install on as I would expect, it see’s the two physical drives. Of course that isn’t really going to work now is it. (or….maybe I am missing something fundamental with Linux and hardware raid controllers?)



So, now I am starting from scratch since this is a temporary production rebuild. As I write this I deleted the old array, created a new mirror RAID 1 array from the two disks, select one as the primary image and the controller is copying the image. Once that finishes, I will attempt to do one more installation of Ubuntu Server 6.06 LTS and see what happens.



If anyone has any ideas or thoughts, I welcome them.



UPDATE:



Finally realized that this discontinued controller is the cause of the issue and since we have to use the hardware available for this project, decided to go with software raid. Really not much performance difference since the controller wasn’t offloading the array needs anyhow.



Found this post describing how to perform the manually partitioning for the installation although I disagree with a 10 GB root volume and a 100+ GB swap volume. So I flipped them around as we are going to be using this machine as a VMWare Server host. (Small installation).



Worked like a charm and I’m ready to start updating the system and getting the VMWare server installation cooking. We’ve already done this numerous times in our test environment. Too bad we didn’t have this controller card in the test environment to had spotted this issue sooner. No harm, no foul. Time to move on.



Blessings!

Popularity: 27% [?]