Virtualmin Install notes for public use / debugging

I have saved my notes installing virtualmin on Centos 5 fresh installs on several different server hosts over the past year (some vps, some dedicated, some GPL, some Pro). FYI, yum update was always run before the initial install from a vm shell script install (and a few upgrades to Pro from the GUI afterwards).

Anyways, here they are in chronological order from newest to oldest, in case you are curious for debugging purposes or anyone googling can find a bunch of solutions all on one page (I have compiled some of these answers from information I found googling myself...so consider this my recognition to those posts being consolidated here and I am not the original author of all these solutions, only some of them).

The significant recurring incident was postfix and procmail not setting up automatically time and time again...other incidents in here varied per-setup (like vps servers losing 127.0.0.1 as a dns server on reboot, but dedicated servers saved this setting without a hack to scripting)

===============================================================

Webmin >> Networking >> Hostname and DNS Client keeps erasing 127.0.0.1 from dns server list (among throwing a warning upon virtualmin >> check config, this appears it can cause error 500 on websites running fastcgi php)

To solve this open "/sbin/dhclient-script", and modify it in the following manner:

FIND:
echo nameserver $nameserver >> $rscf

ADD THIS ONE LINE ABOVE IT:
echo nameserver 127.0.0.1 >> $rscf

This will sort out the DNS problem by adding the 127.0.0.1 address to the resolve.conf everytime the script runs. (everytime the network restarts).

===============================================================

to run CPAN, if this error ocurrs:

-- NOT OK
Running make test
Can't test without successful make
Running make install
make had returned bad status, install seems impossible

Do you have configure, make, gcc installed? If so, installing perl-LDAP may do the trick.

FYI, when logged into CPAN, this forces a reconfiguration:
o conf init

==============================================================

/var/log/maillog:

warning: do not list domain XXXXXXX.XXX in BOTH mydestination and virtual_alias_domains

Go to "Webmin > Servers > Postfix Mail Server > General Options":

What domain to use in outbound mail = use hostname

What domains to receive mail for = whole domain

========================================================

sasldb2 error :
unable to open Berkeley db /etc/sasldb2: No such file or directory

Specify sasl to just use "PLAIN LOGIN" in /usr/lib/sasl2/smtp.conf:
mech_list: PLAIN LOGIN

====================================================

Modprobe: FATAL: Could not load /lib/modules/x.x.x.x-xxx/modules.dep: No such file or directory

The solution:

mkdir /lib/modules/`uname -r`
depmod -a

===================================================

In /var/log/secure, twice every minute:

pam_loginuid(crond:session): set_loginuid failed opening loginuid

Comment out pam_loginuid from the /etc/pam.d/crond file to resolve the issue.

You may also want to remove pam_loginuid from sshd,crond,login,remote

================================================

Incoming email isn't recieved in postfix, it relays to nowhere instead of going to inboxes

SOLUTION

webserver.yourdomainhere.net should exist in DNS.

/etc/hosts (replace "your.internet.ip.goeshere" with your ip address):

127.0.0.1 localhost localhost.localdomain
your.internet.ip.goeshere webserver.yourdomainhere.net webserver

===============================================

"telnet localhost 25" works, but using an internet ip address "xxx.xxx.xxx.xxx 25", it says connection refused,
and port 25 is open in the firewall

---

In /etc/postfix/main.cf, check the setting of the inet_interfaces variable...Change it to "all" (without the quotes)

----------------------------------------

Installing a new server, if the email system goes screwy on it, check this stuff:

1) /etc/postfix/main.cf may need the following added by hand (copy/paste /etc/postfix/main.cf from file manager to a text editor, backup original contents in a backup file, then copy again and find/replace in and copy/paste back to server file and save...make sure "Windows newlines" is UNCHECKED...restart postfix):

virtual_alias_maps = hash:/etc/postfix/virtual

mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

home_mailbox = Maildir/

# And in case you fiddle with the decent default recipient restrictions in main.cf, here is a backup, lol
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination

2) Procmail needed this setup (use webmin GUI):
Set variable ORGMAIL to $HOME/Maildir/

Set variable DEFAULT to $HOME/Maildir/

ALSO, SOMETIMES DURING AN IMPORT THE MAIL SERVER EMAIL MAPPING GETS LET OUT IN /etc/postfix/virtual ...UPDATE ACCORDINGLY, AND RUN "postmap /etc/postfix/virtual" AFTERWARDS TO UPDATE THE MACHINE-READ DB FILE OF THIS DATA

---------------------------------------

UPGRADING VIA THE TAR.GZ IN THE WEBIN / USERMIN CONFIGURATION PAGES CAN CONFUSE VIRTUALMIN...JUST UPDATE IT ALL THROUGH THE VIRTUALMIN UPDATING SYSTEM INSTEAD

-------------------------------------

Status: 
Closed (fixed)

Comments