Troubleshooting “server-manager” in SME Server

November 19th, 2010

Originally this post was going to document my troubleshooting of my login problem with the web based administrative interface of SME Server 7 after my bare (virtual) metal restore. In the end, I gave up fixing the problem, and did the upgrade via CD to SME Server 8 beta 6.  This didn’t turn out to be an easy fix, and I also had my eye on some nice benefits to upgrading to SME8, such as PHP5 and MySQL5 (finally!)

The following now serves as a review of how I think the “server-manager” interface is delivered in SME’s architecture.  It’s elegant, but complex.

The exact error was:

Forbidden
You don’t have permission to access /server-manager on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Unfortunately, I just didn’t know how to troubleshoot this error.  A lot of the problem was that SME is more complex than your normal web server do to  security precautions.

This is how I think the “server-manager” GUI is hosted:

  • You normally go to https://192.168.81.1/server-manager (or whatever your server’s local IP is)
  • The web server, “httpd”, which runs as user www and group www (which I assume has minimal permissions) then reverse proxies to a second httpd process, httpd-admin
  • The second Apache server, httpd-admin, runs on port 980, and runs as user admin and group admin.
  • The 2nd web server has it’s own configuration files.
  • The web scripts are in this folder: /etc/e-smith/web/panels/manager/
  • On a fresh install, the Linux admin user is group id 101, and the admin group is id 101 (my restored server had a different group id)

Increasing the Drive Space of an SME Server – a crash course in LVM

November 11th, 2010

My adventurous rebuild of my home server continues.

I made a mistake when rebuilding my VMWare Server virtual machine, I used the default 8GB partition size, which is too small, even though it only holds work files for a couple of users.

I had most things back up and running, so it was time to fix my disk space error.  This turned into a crash course in Logical Volume Manager (LVM).

DISCLAIMER: I take no responsibility for any actions that you take on your own systems.  As I mentioned, this is all new to me, and it is very possible that I have made mistakes. Follow at your own risk. I’m not even sure that I have all the terminology correct.

The following are somewhat edited  notes that I took as I went along.

First, some terminology, mostly from: http://www.linux-tutorial.info/modules.php?name=Howto&pagename=LVM-HOWTO/vg.html

  • LVM abstracts disk space as seen by the operating system from physical disks.
  • A Volume Group is the highest level abstraction used within the LVM. It gathers together a collection of Logical Volumes and Physical Volumes into one administrative unit. (This is an extra level of organization than you might be used to… you might put all SSDs in one VG and all HDDs in a separate one to make it easier to keep track.)
  • A physical volume is typically a hard disk, though it may well just be a device that ‘looks’ like a hard disk (eg. a software raid device).
  • LV = Equivalent of a disk partition in a non-LVM system. The LV is visible as a standard block device; as such the LV can contain a file system (eg. /home).

General overview:  Create disk space in VMWare (or add physical disk space in a non virtualized environment).  Create a new partition. Join that partition to a Logical Volume to make the Logical Volume larger. Expand the Linux partition to fill it’s now bigger Logical Volume.

The steps that I took:

  • Expand the VMWare virtual disk with the VMWare tool (Google for it).  The non-VM equivalent would be to clone an old, smaller drive onto a new, larger drive.
  • create a new disk partition on the VMWare “physical” disk.
    • /sbin/fdisk /dev/sda
    • n [new]
    • p [primary – I wonder if E would have been a better long term choice]
    • 3 [I think there are two already]
    • defaults for size
    • w [write]
    • /sbin/shutdown -r now
  • create the physical partition (LVM)
    • /sbin/pvcreate /dev/sda3
  • that worked:
#/usr/sbin/pvdisplay
— Physical volume —
PV Name               /dev/md2
VG Name               main
PV Size               7.90 GB / not usable 23.31 MB
Allocatable           yes (but full)
PE Size (KByte)       32768
Total PE              252
Free PE               0
Allocated PE          252
PV UUID               n2Qp6p-Afuc-CE2F-rtdi-7ypO-wnLw-rXtb0J
“/dev/sda3” is a new physical volume of “12.00 GB”
— NEW Physical volume —
PV Name               /dev/sda3
VG Name
PV Size               12.00 GB
Allocatable           NO
PE Size (KByte)       0
Total PE              0
Free PE               0
Allocated PE          0
PV UUID               nc37cI-D4hZ-sR8K-XB7r-Cxh4-N8vn-SecZIf
  • Now,  I add the physical volume to the Volume Group (this was helpful: http://www.gentoo.org/doc/en/lvm2.xml). I have a volume group “main” already. I have to add the physical partition to it.
# /usr/sbin/vgextend main /dev/sda3
Volume group “main” successfully extended
  • Now, add I have to extend the Logical Volume to use up all the new space in the Volume Group (see:  http://wiki.contribs.org/Raid#Upgrading_the_Hard_Drive_Size).
    • # /usr/sbin/lvresize -l +100%FREE main/root
Extending logical volume root to 19.34 GB
Logical volume root successfully resized
  • Ugh.  I still have to resize the EXT3 partition.
    • #/usr/sbin/ext2online -d -v /dev/main/root
  • Phew. It looks like I have a 20G root volume that works.
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/main-root20G  6.3G   12G  35% /
/dev/md1               99M   16M   78M  18% /bootnone                  125M     0  125M   0% /dev/shm
Wow, LVM sure adds a lot of extra steps.  But, in the end, it’s pretty powerful.  It probably cost me time for my simple home network, but someday, I’m sure that I’ll run into LVM again.

Are 5400 RPM drives more reliable than 7200 RPM drives?

November 11th, 2010

Bottom line, I don’t have an answer.  But, if I had to bet, I would bet yes.

I skimmed many of the top 10  pages that came up on a Google search and found a lot of hand-waving and very little actual data.  So, I decided to post my own theory here!

Even if there was data, it doesn’t matter.  The differences between various models of drives, or different factories, or different years from the same manufacturer, are probably larger than the difference from spindle rotation speed.  Every brand of hard drive has head crashes, and generally, it seems proportional to market share.  Every once in a while a company has a bad run, and it’s happened to almost all the brands at one time or another.

I decided to replace the crashed hard drive of my home “server” with a 5400 RPM Western Digital Green drive.

My theory is that almost all the components that go into a hard drive are designed and spec’d for 7200 RPM drives.  I can’t imagine a hard drive manufacturer producing parts that are only stable up to 5400 RPM.  The engineering and machinery costs are far higher than the price of the bits of metal and chemicals.  Thus, if the majority (or even all) of the parts are designed to run at a faster speed, running at a lower speed will generally be better for the drive life.

Besides, for this particular machine, speed isn’t that important, plus saving a few watts in power is an added benefit.

What do you think?

 

Fixing the Time in an SME Server Running in VMWare Server 2

November 8th, 2010

First, a PSA: Please do a backup of all your data, if you haven’t done one in the last week!

A good daily backup over the network  saved my behind this week, after a hard drive crash on our home “server”.  My data was safe, though, I do have some rebuilding of the operating systems to do (Yes, systems, the server is a virtual machine).

I had the craziest time trying to get the time in the VM to stay in sync with the universe.   There are many posts on the web about a dozen different tricks and settings for making the time in a Linux VM work properly.  In my case, I think it turned out to be a simple problem, I didn’t have VMWare Tools automatically starting at boot time.

This page gave me the hints I needed: http://www.sonoracomm.com/index.php?option=com_content&task=view&id=54&Itemid=32

The gist:
START VMWARE TOOLS
At the SME console:
/etc/rc.d/init.d/vmware-tools start
Make tools start on reboot:
# Redhat-based distros
chkconfig vmware-tools on
# SME 7
ln -s /etc/rc.d/init.d/vmware-tools /etc/rc7.d/S19vmware-tools

 

I had to do a song and dance to restore my DAR2 backup, but, generally I’m happy.  I still can’t access SME Server’s “/server-manager” web based GUI… that may be the next post on the PSI blog.

Background: My home server runs SME Server, formerly known as E-smith, from contribs.org.  I’ve been running this Linux based, server bundle for years, maybe even a decade.  However, a couple years ago, I migrated it into a virtual machine to reduce the number of computers that are running 24×7 at home.

Epilog: It might be time to do RAID at home.  Backups are good, but reconfiguration of a highly customized computer still takes a while.

Our New Web Based Whitespace Trimming Tools

October 29th, 2010

We added a couple new tools to Web Tools by Perceptus today.  We also cleaned up the look of the site a little – it’s gone all the way from ugly to almost passable.  Similar to our blog, over time, the trickle of traffic to our web based text mangling site has grown, and it had earned a bit of our effort to tidy it up. Who knows, if this keeps up, we’ll have to keep adding more tools!

The new tools?

  • The Whitespace Trimmer – Paste a blob of text. Every line  of text will be trimmed of spaces on the left and right and returned to you.
  • The Blank Line Remover – Paste a blob of text.  Every blank line will be removed.

Like the rest of the site, the clipboard is your friend.  Run one tool.  Copy the result to the clipboard, and run another one of our tools on the result.