Upgrading from Debian 6 Squeeze with ISPConfig and courier/postfix to Debian 7 Wheezy

Datetime:2016-08-23 01:50:36          Topic: Debian           Share

This How-To has been compiled by the Howtoforge User@manarak from the following two sources and complemented with additional fixes.

Also thank you Till for helping me with the suphp.conf problem.

This How-To supposes that your server runs:

  • Debian 6 with Courier/Postfix
  • ISPconfig

at least, that's what mine ran.

Part One: upgrade Debian

Check that your /etc/apt/sources.list looks fairly standard. Mine looks like this:

deb http://ftp.no.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.no.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free
#squeeze-updates, previously known as ‘volatile’
deb http://ftp.no.debian.org/debian/ squeeze-updates main contrib non-free
deb-src http://ftp.no.debian.org/debian/ squeeze-updates main contrib non-free

Next, run current upgrade to make sure squeeze is completely up-to-date:

apt-get update

apt-get upgrade

apt-get dist-upgrade

Now we will check that no packages are on hold. These needs to return nothing:

dpkg -–audit

dpkg -–get-selections | grep hold

Last run aptitude to check if any packages are awaiting to be installed or removed:

aptitude

Press g to view the list and to go ahead and fix these. List should be clean for no packages to be installed, removed or upgraded. If any packages are shown, go in the menu “actions” and select the first item “install/remove packages”. Press Q to quit

Now, edit your /etc/apt/sources.list and make updates for wheezy repositories. Mine looks like this:

deb http://ftp.no.debian.org/debian wheezy main contrib non-free
deb-src http://ftp.no.debian.org/debian wheezy main contrib non-free
deb http://ftp.no.debian.org/debian wheezy-updates main contrib non-free
deb http://security.debian.org/ wheezy/updates main contrib non-free

Run the commands for upgrading your system with wheezy packages:

apt-get update

(System complains about missing public keys... no problem)

apt-get upgrade

(system will show some text walls, press Q to quit)

(keep the installed crontab)

(install package maintainers version of rkhunter config)

(keep my awstats config version)

(keep my suphp config)

(take package’s version of phpmyadmin apache.conf)

apt-get dist-upgrade

(install package’s version of Rcs)

(install package’s version of my.cnf)

(don’t change mysql password)

...etc... I think these were all the important choices

I chose default answer for all other questions.

When everything is done do a

reboot.

The wheezy upgrade is now complete.

Part two: upgrade ISPconfig

Log back in to your server and make sure we are root:

su -

We need to make sure that apache got all the wheezy packages ISPConfig needs:

apt-get install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libruby libapache2-mod-ruby libapache2-mod-python php5-curl php5-intl php5-memcache php5-memcached php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl memcached

After, do a autoremove to clean up:

apt-get autoremove

Go to /tmp dir, download ISPConfig archive, extract and run update.php to make sure ISPConfig is properly setup for wheezy. Default answer for all questions. Most important part is to let it reconfigure services:

cd /tmp

wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz

tar xvfz ISPConfig-3-stable.tar.gz

cd ispconfig3_install/install/

php –q update.php

ISPConfig should now be properly setup. Do a

reboot.

Part Three: Fixes

mod_security

If you run mod_security (you really should), you will need this for phpmyadmin to work:

in /etc/phpmyadmin/apache.conf add

<IfModule mod_security2.c>
   SecRuleEngine Off
</IfModule>

Error: syntax error, proxy_html.load failed, configtest failed...

After installing and enabling proxy_html (libapache2-mod-proxy-html) on a fresh 12.04 server install, we get the following error:

apache2: Syntax error on line 210 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/proxy_html.load: Cannot load /usr/lib/libxml2.so.2 into server: /usr/lib/libxml2.so.2: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.

explanation: libxml2 is installed, but as on amd64 architecture, the libxml2 file is in : /usr/lib/x86_64-linux-gnu/libxml2.so.2

The solution consists of changing in /etc/apache2/mods-available/proxy_html.load

LoadFile /usr/lib/libxml2.so.2

into :

LoadFile /usr/lib/x86_64-linux-gnu/libxml2.so.2

OR (more simple in my opinion and probably more upgrade-resistant):

navigate to /usr/lib and execute

ln -s /usr/lib/x86_64-linux-gnu/libxml2.so.2 libxml2.so.2

source: https://bugs.launchpad.net/ubuntu/+source/mod-proxy-html/+bug/964397

Error: dpkg: warnings when running commands with sudo:

dpkg: warning: ‘ldconfig’ not found in PATH or not executable
dpkg: warning: ‘start-stop-daemon’ not found in PATH or not executable
dpkg: error: 2 expected programs not found in PATH or not executable
Note: root’s PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)

Edit /etc/sudoers as root and insert this line after Defaults env_reset:

Defaults secure_path=“/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”

Source: http://blog.coffeebeans.at/?p=380

Error: PHP warnings when starting Apache

When trying to start apache this came up:

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

The solution is to remove suhosin package.

apt-get purge php5-suhosin

Source: http://blog.tordeu.com/?p=417

Error: deprecated comment marks cause logs to swell

ISPConfig Cron log showed this at every cron run, every minute:

PHP Deprecated: Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0

Solution: Run this command to find comments in all .ini files and replace # with ;

find /etc/php5/cli/conf.d/ -name “*.ini” -exec sed -i -re ‘s/^(\s)#(.)/\1;\2/g’ {} \;

or

find /etc/php5/ -name “*.ini” -exec sed -i -re ‘s/^(\s)#(.)/\1;\2/g’ {} \;

Source: http://stackoverflow.com/questions/14074101/getting-comments-starting-with-are-deprecated-message-via-cli

Error: Saslauthd will periodically fail and users can't login to the mailbox or send mail.

I have no idea if the following fix actually fixes anything, the issue seems complex and seems to involve a bug

This is what I tried to solve the problem, saslauthd now still fails, but much much less often.

If you want to try: in /etc/default/saslauthd modify the options to look like this:

OPTIONS="-n 0 -c -m /var/spool/postfix/var/run/saslauthd -r"

sources and discussions around this problem:

  • https://www.howtoforge.com/community/threads/saslauthd-stops-working-every-few-weeks.66123/
  • https://github.com/webmin/webmin/issues/58
  • https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758660

Error: after upgrade, phpmyadmin doesn't want to log you in, but offers to download the index.php file instead

in /etc/apache2/mods-available/suphp.conf comment out the

<FilesMatch "\.ph(p3?|tml)$">

section and add the line

AddType application/x-httpd-suphp .php .php3 .php4 .php5 .phtml

otherwise, all PHP files will be run by SuPHP.

(Thank you Till)

Error: log files show SASL authentication error

After the upgrade this can show up in the logs:

...  SASL PLAIN authentication failed: no mechanism available

solution: edit /etc/postfix/sasl/smtpd.conf and replace

auxprop_plugin: mysql

with

auxprop_plugin: sql
sql_engine: mysql

and

%u

has to be replaced with

%u@%r

source: thank you anonymous user





About List