Archive for the '10.x' Category

Dual Fix: “deprecated pam_stack module” and “Unable to open env file: /etc/environment”

/var/log/secure gets slammed with these errors every time anyone tries to connect to any service which requires authorization.  The fix has been elusive, as Ensim continues to re-write the pam.d files, but running this script will take care of both issues posthaste.

Save this as /usr/local/sbin/fix_pam:

#!/bin/sh

# —————————————————————————–
#
# fix_pam ver 1.0a
#
# (c) Copyright 2007 Mark Steel / Catalyst IT. All rights reserved.
#
# This script may only be distributed unmodified.
#
# This script is intended to be used to fix the “depracated pam stack module”
# errors on servers and virtual hosts.
#
# NOTE: THIS SCRIPT IS NOT GPL
#
# —————————————————————————–

perl -i -p -e ’s/required(.*)pam_stack.so service=system-auth/include\tsystem-auth/’ /etc/pam.d/*
perl -i -p -e ’s/pam_pwdb/pam_unix/’ /etc/pam.d/*
perl -i -p -e ’s/pam_env.so$/pam_env.so readenv=0/’ /etc/pam.d/system-auth

perl -i -p -e ’s/pam_env.so$/pam_env.so readenv=0/’ /home/virtual/FILESYSTEMTEMPLATE/siteinfo/etc/pam.d/system-auth
VIRTUAL=`find /home/virtual/FILESYSTEMTEMPLATE -name pam.d`
for i in $VIRTUAL; do
perl -i -p -e ’s/required(.*)pam_stack.so service=system-auth/include\tsystem-auth/’ $i/*
perl -i -p -e ’s/pam_pwdb/pam_unix/’ $i/*
done

DOMAINS=`sitelookup -a site_root`
for i in $DOMAINS; do
perl -i -p -e ’s/required(.*)pam_stack.so service=system-auth/include\tsystem-auth/’ $i/etc/pam.d/*
perl -i -p -e ’s/pam_pwdb/pam_unix/’ $i/etc/pam.d/*
perl -i -p -e ’s/pam_env.so$/pam_env.so readenv=0/’ $i/etc/pam.d/system-auth
done

service saslauthd restart

Run once, and you’re golden.

Tip: Mark Steel @ CatalystX

3 Comments »

PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php4/imap.so’ – /usr/lib/php4/imap.so: cannot open shared object file: No such file or directory in Unknown on line 0

#!/bin/bash

if [ ! -f /root/bin/dsitelookup ]; then
DOMAIN_LIST=`sitelookup -a domain`
else
DOMAIN_LIST=`dsitelookup -a domain`
fi

for i in $DOMAIN_LIST; do
replace “extension_dir = /usr/lib/php4″ “extension_dir = /usr/lib/php/modules” — /home/virtual/$i/etc/php.ini
cp -f /etc/virtualhosting/templates/apache/var/www/interpreters/php-script /home/virtual/$i/var/www/interpreters/
done

Enjoy.

No Comments »

Sites can no longer SFTP into their domains after a clean install

New install, CentOS5.0 (or RHEL5.0) and Ensim X 10.3

It will ask for the password and even go through the motions of allowing site users the ability to connect but then it just closes the connection with no explanations or error.
Here are the procedures for running the script:

pico -w fix_sftp
chmod +x fix_sftp
./fix_sftp

Here is the actual code for the script it self:

#!/bin/bash

file[1]="/usr/lib/libnss3.so"
file[2]="/usr/lib/libplc4.so"
file[3]="/usr/lib/libplds4.so"
file[4]="/usr/lib/libnspr4.so"
sitelist=`sitelookup -a domain`

for i in $sitelist; do
cp ${file[*]} /home/virtual/$i/usr/lib
cp ${file[*]} /home/virtual/FILESYSTEMTEMPLATE/siteinfo/usr/lib
done

Enjoy.

5 Comments »

Unable to open env file: /etc/environment errors

01-Dec-2008 NOTE: This post is superceded with a different method. 
See http://www.ensimfixes.com/?p=46

The /var/log/secure log is full of these stupid error messages. For some reason, they forgot to add this file to all the domains and the server. The fix is really easy!

touch /etc/environment
for i in `sitelookup -a domain`; do touch /home/virtual/$i/etc/environment; done

Enjoy!

No Comments »