Ensim 10.x/CentOS 5.10: upgrade MySQL 5.0 to 5.5

Hello,

as you may have noticed, CentOS 5.10 has stopped upstream updates for its stock MySQL version which is stuck at version 5.0.95. They have added MySQL 5.5 now to their repository but these packages are installed in different locations and have other startup-scripts then the default stock version, so that they can be run at the same time, but that's not very compatible with Ensim and its database management. Therefore I wrote a small upgrade script which removes MySQL 5.0 and installs 5.5, taking care of Ensim's database structure. Here are some script requirements:

  • python 2.4+ installed
  • EPEL and IUS repositories installed
  • all stock mysql55 packages excluded in yum (found in /etc/yum.repos.d/CentOS-Base.repo)

Here how to do the upgrade:

  1. download my script and place it wherever you want and unzip it
  2. check if all requirements above are fulfilled
  3. launch my script with: python /path/to/upgrade_ensim_mysql.py
  4. edit /etc/virtualhosting/filelists/mysql.sh and add following lines to it:
    N:S,rpm:mysql55
    N:S,rpm:mysql55-server
    N:S,rpm:mysql55-libs
    N:S,rpm:mysqlclient15
  5. edit /etc/init.d/mysqld and remove the parameters –skip-bdb and –skip-innodb
  6. now restart your mysql server as usual and do an ensim maintenance

For all the admins who are sceptic about user programmed scripts, here is what it basically does:

  • backup old needed files
    /etc/my.cnf
    /etc/init.d/mysqld_app_init
    complete mysql dump to /root/mysql_backup.sql
  • removes mysql5.0 packages without their dependencies
  • installs needed mysql55 packages
  • unlinks all symlinks and relinks the databases
    this step is needed because mysql50 supported database names with "-" in it, mysql55 doesn't, thus the "-" is replaced by "@002d" in the symbolic link
  • upgrades all database using mysql_upgrade
Ensim MySQL Upgrader (356 downloads )

Sendmail: 5.6.0 DSN data format error

I had a problem with a local webserver when sending out email through php to an internet mail server which accepted only valid domain names resolvable by dns. You can masquerade the local domain/server name by enabling following lines in /etc/mail/sendmail.mc

MASQUERADE_AS(`mydomain.com')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(masquerade_entire_domain)dnl

and recompile your sendmail.cf:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Sendmail: Running SMTP With TLS

If you want to run your sendmail config with TLS enabled, here are some configration options you can add to your sendmail.mc file:

Option Description
define(`confCACERT', `path/to/file.ca') set the CA file
define(`confCACERT_PATH', `path/to/certs') path to the certificate folder
define(`confCLIENT_CERT', `path/to/file.crt') set the certificate used when sendmail connects to another host
define(`confCLIENT_KEY', `path/to/file.key') set the certificate key file used when sendmail connects to another host
define(`confSERVER_CERT', `path/to/file.crt') set the certificate used when someone connects to sendmail
define(`confSERVER_KEY', `path/to/file.key') set the certificate key file used when someone connects to sendmail
define(`confCRL', `path/to/file.crl') set file containing Cerificate Revocation List
define(`confTO_STARTTLS', `1h') set the time out for the STARTTLS command (default: 1h)
define(`confDH_PARAMETERS', `path/to/file.dh') set the file containing Diffie-Hellmann (DH) parameters
define(`confTLS_SVR_OPTIONS', `V') set TLS options (argument V disables certificate verification)

if all parameters you want have been added, simple recompile the sendmail.cf with following command:
# m4 sendmail.mc > sendmail.cf

and restart your sendmail service.

Note on GMX and WEB.DE servers:
the DH parameter is needed if these clients refuse to connect an deliver email or see similar errors in your log:

STARTTLS=server, error: accept failed=0, SSL_error=1, errno=0, retry=-1

STARTTLS=server: 11964:error:1409442F:SSL routines:SSL3_READ_BYTES:tlsv1 alert insufficient security:s3_pkt.c:1092:SSL alert number 71