Downgrade php version from 5.3 to 5.2 on Ubuntu 10.10 x86

New Server has come and again I must downgrade php version to 5.2 due to some problem on web application. I use same method I use for Ubuntu 10.04 for Ubuntu 10.10 x86.

Let start

Download required files for PHP 5.2 from Ubuntu Karmic repository

#cd /etc/apt/sources.list.d

#wget http://randyfay.com/sites/default/files/karmic_0.list

# cd /etc/apt/preferences.d/

#wget http://randyfay.com/sites/default/files/php_1.

# mv php_1. php

Find out installed PHP version

# php -v

PHP 5.3.3-1ubuntu9.1 with Suhosin-Patch (cli) (built: Oct 15 2010 14:00:18)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
#

# dpkg –get-selections | grep php
libapache2-mod-php5                             install
php-db                                          install
php-pear                                        install
php5                                            install
php5-cli                                        install
php5-common                                     install
php5-gd                                         install
php5-mcrypt                                     install
php5-mysql                                      install
php5-xsl                                        install

Delete those PHP with apt-get remove

# apt-get remove libapache2-mod-php5 php-db php-pear php5 php5-cli php5-common php5-gd php5-mcrypt php5-mysql php5-xsl

# apt-get autoremove

Add php5-mcrypt

# nano /etc/apt/preferences.d/php

put these lines :

Package: php5-mcrypt
Pin: release a=karmic
Pin-Priority: 991

at the bottom.

Update repository and reinstall PHP

#apt-get update

#apt-get install php5 libapache2-mod-php5 php-db php5-cli php5-common php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache php5-mcrypt

Check PHP version

# php -v

PHP 5.2.10-2ubuntu6 with Suhosin-Patch 0.9.7 (cli) (built: Oct 23 2009 16:30:10)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
#

Great.

PHP successfully downgrade to 5.2.10 on Ubuntu 10.10 x86

Downgrade php version from 5.3 to 5.2 on Ubuntu 10.04 i386

I have chance to install new server with standard requirement. SSH, Bind9 and LAMP.

All process is smooth using i386 version of Ubuntu 10.04 but my friend complain about his web application not work well and after little investigation it looks like due to PHP version.

Quick search on Google lead me to RandyFay post about downgrade PHP version to 5.2 on Ubuntu 10.04

I follow the method and rewrite it with a few things that might useful for newbie like me 🙂

Note :

I use ubuntu 10.04 i386 and username : alam

Let start

Download required files for PHP 5.2 from Ubuntu Karmic repository

# wget http://randyfay.com/sites/default/files/karmic_0.list

# mv /home/pusda/karmic_0.list /etc/apt/sources.list.d

# wget http://randyfay.com/sites/default/files/php_1.

# mv /home/pusda/php_1. /etc/apt/preferences.d/php

Find out installed PHP version

# dpkg –get-selections | grep php

libapache2-mod-php5                             install
php-db                                          install
php-pear                                        install
php5                                            install
php5-cli                                        install
php5-common                                     install
php5-gd                                         install
php5-mcrypt                                     deinstall
php5-mysql                                      install

Delete those PHP with apt-get remove

# apt-get remove libapache2-mod-php5 php-db php-pear php5 php5-cli php5-common php5-gd php5-mcrypt php5-mysql

# apt-get autoremove

Update repository and reinstall PHP

#apt-get update

#apt-get install php5 libapache2-mod-php5 php-db php5-cli php5-common php5-xsl php5-gd php-pear php5-mysql php5-curl php5-memcache

Check PHP version

# php -v

PHP Warning:  PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20060613+lfs/mcrypt.so’ – /usr/lib/php5/20060613+lfs/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.2.10-2ubuntu6 with Suhosin-Patch 0.9.7 (cli) (built: Oct 23 2009 16:30:10)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
#

Dealing with php5-mcrypt error

# apt-get install php5-mcrypt

Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
php5-mcrypt: Depends: phpapi-20090626+lfs
E: Broken packages
#

Quick solution for php5-mcrypt installation error

# nano /etc/apt/preferences.d/php

put these lines :

Package: php5-mcrypt
Pin: release a=karmic
Pin-Priority: 991

at the bottom.

Try reinstall php5-mcrypt

# apt-get install php5-mcrypt

Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libmcrypt4
Suggested packages:
libmcrypt-dev mcrypt
The following NEW packages will be installed:
libmcrypt4 php5-mcrypt
0 upgraded, 2 newly installed, 0 to remove and 4 not upgraded.
Need to get 91.4kB of archives.
After this operation, 332kB of additional disk space will be used.
Do you want to continue [Y/n]?y

Recheck php version after install php5-mcrypt

# php -v

PHP 5.2.10-2ubuntu6 with Suhosin-Patch 0.9.7 (cli) (built: Oct 23 2009 16:30:10)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
#

Great.

PHP successfully downgrade to 5.2.10

Upgrade Zimbra Network Edition from 6.0.1 to 6.0.8

Stop Zimbra Service

su – zimbra

$ zmcontrol stop
Host mail.yourdomain.com
Stopping stats…Done.
Stopping mta…Done.
Stopping spell…Done.
Stopping snmp…Done.
Stopping archiving…Done.
Stopping antivirus…Done.
Stopping antispam…Done.
Stopping imapproxy…Done.
Stopping memcached…Done.
Stopping mailbox…Done.
Stopping convertd…Done.
Stopping logger…Done.
Stopping ldap…Done.
$
$ exit
logout
#

Backup Zimbra

# cd /opt
# tar cvzf zimbra.tar.gz zimbra

Check Zimbra Version

$ zmcontrol -v

Release 6.0.1_GA_1816.UBUNTU8 UBUNTU8 NETWORK edition.

Check License
$ zmlicense -c
license is in grace period

$ zmlicense -c
license is OK

Continue reading

How to update / renew Zimbra License

Your Zimbra Network License expired 24 days ago 🙂

Yes, that message show up when I log in to one of my client and they ask me to renew the license.

Well, the process itself isn’t difficult as what you need to extend zimbra license just ask sales at zimbra.com.

they will email license key and with the key what you need to do is login to zimbra admin.

Click on Global Settings.

Click License will give this screen.

Click Update License.

Browse for license file and click Next.

Your license file is uploaded successfully.

Click Install.

You license file is installed successfully.

Done.

Client can continue their zimbra mailbox.

Renew Certificate or Create New Certificate from Zimbra CLI

my emailLicense for one of our client get expired and current status is in grace period.

Accident happen when server was forced to shutdown due to electrical problem. When the server goes up nothing email server still down. I try to start the service manually.

$ zmcontrol start
Host mail.yourdomain.com
Unable to determine enabled services from ldap.
Unable to determine enabled services. Cache is out of date or doesn’t exist.

Further investigation tell me about certificate expiration, I must renew it.

Here the steps :

# su – zimbra
$ /opt/zimbra/bin/zmcertmgr createca -new
/opt/zimbra/bin/zmcertmgr must be run as user root
$ exit
logout

Hohoho, the command must run by root.

Begin by generating a new Certificate Authority (CA).

# /opt/zimbra/bin/zmcertmgr createca -new

** Creating /opt/zimbra/ssl/zimbra/ca/zmssl.cnf…done
** Creating CA private key /opt/zimbra/ssl/zimbra/ca/ca.key…done.
** Creating CA cert /opt/zimbra/ssl/zimbra/ca/ca.pem…done.

Then generate a certificate signed by the CA that expires in 365 days.

# /opt/zimbra/bin/zmcertmgr createcrt -new -days 365

Validation days: 365
** Creating /opt/zimbra/conf/zmssl.cnf…done
** Backup /opt/zimbra/ssl/zimbra to /opt/zimbra/ssl/zimbra.20101009200401
** Generating a server csr for download self -new -keysize 1024
** Creating /opt/zimbra/conf/zmssl.cnf…done
** Backup /opt/zimbra/ssl/zimbra to /opt/zimbra/ssl/zimbra.20101009200401
** Creating server cert request /opt/zimbra/ssl/zimbra/server/server.csr…done.
** Saving server config key zimbraSSLPrivateKey…failed.
** Signing cert request /opt/zimbra/ssl/zimbra/server/server.csr…done.

Next deploy the certificate.

# /opt/zimbra/bin/zmcertmgr deploycrt self

** Saving server config key zimbraSSLCertificate…done.
** Saving server config key zimbraSSLPrivateKey…done.
** Installing mta certificate and key…done.
** Installing slapd certificate and key…done.
** Installing proxy certificate and key…done.
** Creating pkcs12 file /opt/zimbra/ssl/zimbra/jetty.pkcs12…done.
** Creating keystore file /opt/zimbra/mailboxd/etc/keystore…done.
** Installing CA to /opt/zimbra/conf/ca…done.

Next deploy the CA

# /opt/zimbra/bin/zmcertmgr deployca

** Importing CA /opt/zimbra/ssl/zimbra/ca/ca.pem into CACERTS…done.
** Saving global config key zimbraCertAuthorityCertSelfSigned…done.
** Saving global config key zimbraCertAuthorityKeySelfSigned…done.
** Copying CA to /opt/zimbra/conf/ca…done.

To finish, verify the certificate was deployed to all the services.

# /opt/zimbra/bin/zmcertmgr viewdeployedcrt

::service mta::
notBefore=Oct  9 13:04:03 2010 GMT
notAfter=Oct  9 13:04:03 2011 GMT
subject= /C=US/ST=N/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration

Suite/CN=mail.yourdomain.com
issuer= /C=US/ST=N/A/L=N/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration

Suite/CN=mail.yourdomain.com
SubjectAltName=
::service proxy::
notBefore=Oct  9 13:04:03 2010 GMT
notAfter=Oct  9 13:04:03 2011 GMT
subject= /C=US/ST=N/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration

Suite/CN=mail.yourdomain.com
issuer= /C=US/ST=N/A/L=N/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration

Suite/CN=mail.yourdomain.com
SubjectAltName=
::service mailboxd::
notBefore=Oct  9 13:04:03 2010 GMT
notAfter=Oct  9 13:04:03 2011 GMT
subject= /C=US/ST=N/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration

Suite/CN=mail.yourdomain.com
issuer= /C=US/ST=N/A/L=N/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration

Suite/CN=mail.yourdomain.com
SubjectAltName=
::service ldap::
notBefore=Oct  9 13:04:03 2010 GMT
notAfter=Oct  9 13:04:03 2011 GMT
subject= /C=US/ST=N/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration

Suite/CN=mail.yourdomain.com
issuer= /C=US/ST=N/A/L=N/A/O=Zimbra Collaboration Suite/OU=Zimbra Collaboration

Suite/CN=mail.yourdomain.com
SubjectAltName=
#

done.

Try start the service :

~$ zmcontrol start
Host mail.yourdomain.com
Starting ldap…Done.
Starting logger…Done.
Starting convertd…Done.
Starting mailbox…Done.
Starting antispam…Done.
Starting antivirus…Done.
Starting snmp…Done.
Starting spell…Done.
Starting mta…Done.
Starting stats…Done.
$