phpBB upgrade error: group_skip_auth

July 4th, 2009 bill Comments off

Encountered this whilst attempting to upgrade phpBB using svn:

SQL ERROR [ mysql4 ]

Unknown column 'g.group_skip_auth' in 'where clause' [1054]

SQL

SELECT a.forum_id, a.auth_option_id, a.auth_role_id, a.auth_setting
FROM acl_groups a, user_group ug, groups g
WHERE a.group_id = ug.group_idAND g.group_id = ug.group_id
  AND ug.user_pending = 0
  AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
  AND ug.user_id = 22

BACKTRACE

The solution took awhile to determine but it’s quite simple.  Go to your board’s database update module at:

http://example.com/install/database_update.php

which will add the requisite columns to the tables.

Categories: pbpBB Tags:

Supporting multiple Wordpress installs

June 27th, 2009 bill Comments off

Here’s a little Perl script that uses some modules off CPAN to :

  • Find the names and document-root of each website configured on your server
  • Find the version of Wordpress (if any) for each website, and the Subversion repository version used (if any).
  • Sort these by name, owner UID, or Wordpress version

Rename the .pl.txt file to .pl, chmod a+x so you can run it, and then:

# ./show_wp_versions.pl

which would display, for example,

Domain                         Version    Tracking Subversion  Owner
-----------                    --------   -------------------  -----
alphabetcompany.com             2.8       tags/2.8             alphabet
awkwardaardvark.com             2.7.1     tags/2.7.1           aardvark
brilliant-doorstops.co.uk       2.3                            dumbasapost

-n sorts by numeric version number; -u sorts alpha by UID.

Very handy when you’re supporting a large number of Wordpress installs on a single server, to know who’s running what, and who needs to be updated!

NOTE: To install on a fresh system, you will probably need to:

# cpan
cpan[3]> install App::Info::HTTPD::Apache
cpan[1]> install SVN::Class::Info
cpan[2]> install Apache::ConfigParser
Categories: WordPress Tags:

APC UPS in Centos 5.x

June 10th, 2009 bill Comments off
$ sudo yum install apcups*
...
---> Package apcupsd.x86_64 0:3.14.3-1.el5.rf set to be updated
...
$ sudo /sbin/chkconfig --list apcupsd
apcupsd         0:off   1:off   2:on    3:on    4:on    5:on    6:off

Before you start the apcupsd service, edit /etc/apcupsd/apcupsd.conf and set the cable type (to usb for most modern units) and other parameters as needed… then:

$ sudo /etc/init.d/apcupsd start
Categories: System Admin Tags:

Mounting LVM volumes from Ubuntu LiveCD

June 8th, 2009 bill Comments off
sudo -i
apt-get install lvm2
modprobe dm-mod
vgchange -a y

Also try –

pvdisplay
Displays physical volumes
vgdisplay
Displays volume groups
lvdisplay
Displays logical volumes

and: man lvm

Categories: System Admin Tags:

Retrieving multiple mail accounts’ info on Plesk

May 29th, 2009 bill Comments off

Try the command-line utilities:

# /usr/local/psa/bin/mail -i user@example.com
Categories: System Admin Tags:

Recovery Tools

May 14th, 2009 bill Comments off

An excellet collection is Hiren’s Boot CD

Categories: Uncategorized Tags:

Export only a Subset of Wordpress pages

May 13th, 2009 bill Comments off

In the process of splitting one existing Wordpress site (comprised mostly of hierarchically arranged Pages, not posts) I needed to export a batch of pages into the new one. Here’s how to modify your wp-admin/includes/export.php to do that.

First we find the ID number of the parent page that we want to export. This process will export that page and all its sub-pages (children), sub-sub-pages, etc. You can find this by hovering over the “Edit” link in the Wordpress “Pages/Edit” area and noting the “&post=number” section. In my case it was “2″ — that’s the number we will use below.

In wp-admin/includes/export.php, find the lines:

// grab a snapshot of post IDs, just in case it changes during the export
$post_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");

Comment that out, and replace with:

# Export only a particular page and all its children
$post_ids = array();
$new_pages = array();
$new_pages[] = 2; # Parent page ID, which we will export, along with all its children
while (count($new_pages)) {
  $where = "WHERE post_parent IN (".join(',', $new_pages).")";
  foreach ($new_pages as $np) {
    $post_ids[] = $np;
  }
  $new_pages = array();
  $new_pages = $wpdb->get_col("SELECT ID FROM $wpdb->posts $where ORDER BY post_date_gmt ASC");
}
# $post_ids array now contains the pages we wish to export

Simply run the Export process and you will have just those pages.

Categories: WordPress Tags:

After installing Ubuntu 9.04

April 26th, 2009 bill Comments off

If you want support for MP3 files, Youtube video, and Java on your webpages, you could hunt down several packages – or just install the ubuntu-restricted-extras package install all the codecs and other files in one step. This also includes Microsoft core fonts.

sudo apt-get install ubuntu-restricted-extras

Eliminate Irritating Update Notifier Pop-Unders

This from Joseph Sinclair

In Ubuntu 9.04, update-notifier doesn’t display an icon, it actually runs update-manager full-screen as a “pop-under”. It’s easy to miss, and there’s no way to make it NOT run (so on a laptop, for instance, where stupid useless no-change updates are pending, you’ll get the blasted thing running every time you boot, and quite often multiple times in a session).

There is a “magic” command to make it stop and go back to how it used to run (which you may have to run regularly since some updates seem to overwrite it), but it must be run for every user who can run updates:

gconftool -s --type bool /apps/update-notifier/auto_launch false

Adding that to /etc/bash.bashrc seems to be a quick-and-dirty fix that restores it for every user, and resets it if it gets overwritten. There’s no guarantee this will work after the 9.10 update, but at least it works for now.

Categories: Uncategorized Tags:

Hosting Quotas Gotcha

April 5th, 2009 bill Comments off

I am really liking Virtualmin, but just got bitten, hard, by an unexplained problem. Postfix started rejecting incoming mail, saying in the logfile (/var/log/maillog)

status=bounced (can't create user output file)

Well after much gnashing of teeth, it turns out that the user (me) was over quota. You can see this with:

# quota itsme.mydomain
Disk quotas for user itsme.mydomain (uid 536):
     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace
      /dev/xvda   51200   51200   51200              73       0       0

Hmm… where are those extra files?  Not anywhere in /home … read on — Read more…

Categories: System Admin, Uncategorized Tags:

Setting up Virtualmin on Centos with a Linode

March 23rd, 2009 bill Comments off

Once you know these few steps, setting up a LAMP (Linux/Apache/MySQL/Perl-PHP) server on a Linode (please use that link, as it includes my referral code) is insanely simple:

First, starting with a freshly provisioned CentOS install, ssh into the root account.  First, update the base system –

# yum update

I find it convenient to also install the console version of emacs:

# yum install emacs-nox

Next, edit /etc/sysconfig/network and change the hostname.  That file is read at boot, so you might also want to set the hostname for the current session:

# hostname www.example.com

Download the install.sh script from http://www.virtualmin.com/download.html into /usr/src … and then execute it:

# cd /usr/src
# wget http://software.virtualmin.com/gpl/scripts/install.sh
# sh install.sh

Then login, as root, to your new virtualmin configuration at your linode’s address: https://li99-999.members.linode.com:10000 where the 99-999 is replace with your linode’s address (see the linode control panel).

Clamd update problem

NOTE: After installing Virtualmin updates, I got an error:

ERROR: Command rejected by clamd (wrong clamd version?)

which I resolved with:

# /etc/rc.d/init.d/clamd-virtualmin restart

Default settings when you configure

System Settings / Server Templates

Default Settings

  • Mail for Domain / Mail alias mode for alias domains: Copy aliases from target
  • BIND DNS Domain / Hostname to your preferred world-visible hostname; SPF DNS disabled (until you configure each domain manually)

Update 2009-05-08

Killed clamd as it is a huge memory pig and leads to Out Of Memory webserver freezes!

Postfix was accepting email for anything@aliased-domain.com … to solve this, open the aliased sub domain in Virtualmin, and under:

Server Configuration
  Email Settings

change:

Virtual server email-related settings
  Mail aliases mode

from Catchall forwarding to Copy aliases from target.  You probably want to change this on the System Settings / Server Templates / Default Settings for Sub-Servers page as well.  If you have already created several domains, you can adjust this all at once:

# virtualmin modify-mail --alias-copy --all-domains

NOTE: Is there a bug in Virtualmin 3.68.gpl? I had to manually:

# cd /etc/postfix
# postmap virtual
# postfix reload

to force that to refresh.

Viewing Postfix Mail Queue

On main Virtualmin menu: System Information. Open up Status. Click on Postfix Mail Server.

Problems with installing: awstats

Ran into this error message after install, when clicking the “Check Your System” button –

The AWstats command /usr/share/awstats/wwwroot/cgi-bin/awstats.pl was not found on your system.

Complicated by the fact that “yum install awstats” said it was already installed. But where? “rpm -ql awstats” gives the answer… and then I just copied it as follows:

# mkdir -p /usr/share/awstats/wwwroot/cgi-bin
# cp -a /var/www/awstats/awstats.pl /usr/share/awstats/wwwroot/cgi-bin

Out of Memory? — Taming Apache

With the default settings, Apache can veer out of control and eat all available memory.  In /etc/httpd/conf/httpd.conf, change as follows in the section shown:

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
# was: MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 400
0
<IfModule prefork.c>
StartServers       8
MinSpareServers    5
MaxSpareServers   10
ServerLimit      64
MaxClients       64
MaxRequestsPerChild  400
</IfModule>
Categories: System Admin Tags: