Ispconfig3 on Ubuntu 12.04 upgrade to 14.04

Upgrading a system running Ispconfig3 on Ubuntu 12.04 (LTS) to 14.04 is quite straight forward. However there are some issues to consider before doing so. It might affect some of the sites that are being hosted.

  • Ubuntu 14.04 will move you from Apache 2.2 to 2.4
  • php will be upgraded from 5.3 to 5.5. Most modern CMS:es like Joomla and WordPress will run on php 5.5 but clients can be using other software or third party extensions that are not ready for php 5.5

Upgrade procedure:

  • Backup, backup and backup. And do some backup again.
  • Prepare your users for some downtime. The upgrade can take up to several hours depending on your server.
  • Upgrade all installed packages so you have the latest versions;
    apt-get update
    apt-get upgrade
  • Then run do-release-upgrade
  • During the upgrade process you probably will be prompted several times about configuration files that have been locally modified. I usually examine the differences using D option and in most cases I select to install the new configuration file using Y option.
  • After Ubuntu has been upgraded and the system has been rebooted you must reconfigure Ispconfig3. I did it by using the update procuedure even though I was running the latest Ispconfig before I upgraded Ubuntu:
    cd /tmp
    wget http://sourceforge.net/projects/ispconfig/files/ISPConfig%203/ISPConfig-3.0.5.4p5/ISPConfig-3.0.5.4p5.tar.gz
    tar xvzf ISPConfig-3.0.5.4p5.tar.gz
    cd ispconfig3_install/install
    php -q update.php
  • Allow Ispconfig3 to reconfigure your services
  • In my case Apache2 wouldn’t start after the upgrade. It was caused by the ruby module and since I don’t use it my simple solution for the moment was just to disable it:
    a2dismod ruby
    service apache2 restart
  • php imap extension had been disabled, so to fix it:
    php5enmod imap
    service apache2 restart
  • If you are hosting PrestaShop sites, you may need to disable php opcache described here or disable encryption by issuing the SQL command: UPDATE `ps_configuration` SET `value` = ‘0’ WHERE `name` = ‘PS_CIPHER_ALGORITHM’;
  • Apache2 configuration files has been moved from /etc/apache2/conf.d to /etc/apache2/conf-availible directory. Then to enable them you need to symlink the configuration file from /etc/apache2/conf-availible to /etc/apache2/conf-enabled and issue the command: service apache2 restart
  • You might experience problems with Postfix after the upgrade with log entries like fatal: no SASL authentication mechanisms and mail not being sent from the mailqueue. In that case:
    apt-get install sasl2-bin
    edit /etc/default/saslauthd and set START=yes
    /etc/init.d/saslauthd start
    service amavis restart
    service postfix restart

    I also had to comment out two lines in /etc/postfix/main.cf:
    #smtpd_sasl_path = private/auth
    #smtpd_sasl_type = dovecot

    And then do:
    service postfix restart

 

Ispconfig3 site cron not executing

When setting up a website in Ispconfig3 I wanted to run a cron job (shell script) for the site (setup under Sites -> Cron jobs) but the job did not execute. When examining the /var/log/auth.log I found lines like these:

Mar 22 10:31:01 servername jk_chrootsh[28726]: abort, homedir ‘/var/www/clients/client6/web284’ for user web284 (5015) does not contain the jail separator <jail>/./<home>

Mar 22 10:31:01 servername jk_chrootsh[28725]: abort, homedir ‘/var/www/clients/client1/web283’ for user web283 (5014) does not contain the jail separator <jail>/./<home>

The solution was to just add a dummy ssh user (using Jailkit as Chroot shell) in Ispconfig3 for the website.
I haven’t verified but I suspect the issue could be caused by the fact that the system originally was set up under Ubuntu 12.04 (LTS) and recently I did a do-release-upgrade to Ubuntu 14.04.

Incoming mail to Outlook.com / Hotmail.com / Live.com is visible in the webmail but doesn’t show up in the Outlook.com for Android app

I was developing a php script that should send emails to a receiver. It worked great with a number of email services, like gmail for example. But with Outlook.com, aka Hotmail.com or Live.com the emails I sent to an account was only visible when logging in to the account through the web. If the same account was configured in the Android app Outlook.com the emails never showed up.

After some headscratching I found the reason. The problem was that my php script sent the emails using only html (Content-type: text/html; charset=utf-8 in the email headers). When the script was changed to send it as a multipart message, both html and text, the message showed up in the Android Outlook.com application also. Even though the Android app had no problems displaying the html-version of the email, it was just ignored if it wasn’t a multipart message with both html and text.

An example on how to send multipart emails in php can be found here.

FileZilla FTP-client retrieve directory listing failed on MLSD command using TLS

Some week ago FileZilla released a new version – 3.10.0.1. After installing this version some clients had problems connecting with their web hosting servers using FTP. One of the changes in FileZilla was that it now defaults to TLS encrypted connections if the server supports it, which many web hosting providers do.

However, if the FTP server is not properly configured together with it’s firewall the client will connect but fail to retrieve the directory listing (timeout).

A workaround on the client side is to connect with plain old FTP using no encryption. To do this in the later versions of FileZilla you must create a connection in the site manager and select plain FTP (unsecure) in the encryption field. (This option is not availible in the quick connect.)

A better solution is to solve the problem on the server side. To do this the FTP server must be configured to use a specific range of ports for passive mode and allowing traffic to them through the server firewall. The example below shows how to do this with pure-ftpd and iptables. In the example we setup pure-ftpd to use ports 50000-55000 for passive transfers and then we allow the same range in iptables.

echo “50000 55000” > /etc/pure-ftpd/conf/PassivePortRange
/etc/init.d/pure-ftpd restart

Then add the following to your iptables rules and reload them:

iptables -I INPUT -p tcp -m tcp –dport 50000:55000 -j ACCEPT

Convert Microsoft Outlook PST email to IMAP without Outlook

A client was going to stop using Microsoft Outlook and Exchange server and move their email to an ordinary web hosting company using IMAP. The client was downscaling and had no use of the benefits of Microsoft Exchange like shared contacts and calendars. They where just using it for email which could be obtained much cheaper by using the IMAP account at their web hosting provider.

So I was faced with the task of converting their old email contained in PST files. They had already shut down their Exchange server and I could not use the Outlook program. I just had the PST files that where exported before the server shutdown and needed them imported into the IMAP account without using Outlook as it was not availible for me.

This is how I solved it.

Tools used:

  1. Download and install Thunderbird. Set it up with the target email account both as an IMAP account and a POP3 account (it was a problem importing the converted eml files directly to the IMAP account so I had to import them to the POP3 account which is stored locally and then drag them over to the IMAP account, more about that later on). Make sure you setup the POP3 account to leave mail on server and not delete mail when deleted locally.
  2. Download the ImportExportTools extension for Thunderbird. Drag the downloaded file onto Thunderbird in the task bar to install it.
  3. Download the free trial of the SysTools PST converter and install it. The free version is limited to 25 emails per folder so if you have more emails you need to purchase it ($49 when writing this article). You can make a test run with the free version so you see everything works before you go on and buy it.
  4. Run the SysTools PST converter.
  5. Click the Add file button and select your PST file.
  6. Click the Export button and select EML format, and check the folders you wish to export (normally the top folder). Enter a target folder. Then click the Export button.
  7. In Thunderbird, right click the POP3 email account and select New folder and call it “From PST” for example.
  8. Select the “From PST” folder and go to the menu icon in Thunderbird and select Tools -> ImportExport-tools -> Import all EML from a folder -> and it’s subfolders. Select the top folder of your email export in step 6 and click Select folder.
  9. All subfolder and it’s email should now turn up in the “From PST” folder. Now drag the “From PST” folder from the POP3 account to the IMAP account in Thunderbird.
  10. Finally delete the POP3 account in Thunderbird.

Akeeba Backup for WordPress Internal Server Error 500 XHR ReadyState: 4

I experienced this error when trying to run a backup on a site hosted at the One.com provider.

The solution is to manually adjust the JPA part size for split archives. Even if the configuration wizard had been used, it didn’t work.

  1. Go to Akeeba Backup -> Settings
  2. Scroll down to Archiver engine where JPA is selected.
  3. Click on the Configure button to the right of JPA.
  4. In my case the Part Size for split archives was set to over 2 GB. I lowered it until it worked, which for me was 100 MB.

Joomla! 1.5 menu items not visible

I was moving a Joomla! 1.5 site to a new hosting server. The site had been running on PHP 5.2 on the prevoius server but on the new host only PHP 5.6 or later was available. Joomla! was version 1.5.14.

After installing the site on the new server, no menu items were visible, not in backend, nor in frontend. I checked the database tables and the menu items were present in the database, they just didn’t show up in Joomla!.

The solution was simply to upgrade Joomla! to the latest verion, 1.5.26, which is compatible with PHP 5.6 (something that I would have done anyway as the next step).

Joomla! 1.5 upates can be downloaded here.

Change sorting / position of products in PrestaShop featured section on the start page

  1. In the PrestaShop backoffice (admin), go to Catalog -> Products
  2. Above the product list, tick the “Filter by category”
  3. Select the “Home” category in the category list that drops down under the “Filter by category”
  4. Now far to the right you will find a “Position” column where you can use the arrows to move the products up and down

Extend a wrapped div to full screen width outside it’s wrapper

A very common design model for websites in fluid/reponsive design is to make a centered container taking up for example 80% of the screen width. It is not very unusual that the designer then wants the background on a header, footer, horizontal menu or any other similar object to have it’s background extended to the fulls screen width.

 

Website with wrapper container

Website with wrapper container

The problem with this quickly becomes pretty obvious as all objects are contained in a 80% wrapper. One solution is of course to close the wrapping container, then create a full width object with the background and the begin a new wrapper.

However, there is a neat trick that can be used to make an object “break out” outside the containing wrapper. It is done by using negative margins. To not get a horizontal scrollbar in the browser we add overflow-x: hidden to the body.

This is an example how to do it (click here to view the example live):

<html>
<head>
<style>
 body {
   overflow-x: hidden; /* to prevent horizontal scroll bars */
 }
 .container {
   width: 80%;
   height: 100%;
   margin-left: auto; /* center the container */
   margin-right: auto;
   padding: 10px; /* some padding inside the container */
   background-color: yellow;
 }
 .divider {
   line-height: 30px;
   background-color: grey;
   color: white;
   margin-left: -1000%;
   margin-right: -1000%;
   padding-left: 1000%; /* push content back in on the screen */
   padding-right: 1000%;
 }
</style>
</head>
<body>
<div class="container">
 <p>Some text inside the container</p>
 <div class="divider">Here is a section divider in full width</div>
</div>
</body>
</html>

Centering a horizontal bullet list

Horizontal bullet lists are often used to create a horizontal menu. This is how to make the horizontal bullet list centered.

  1. Create a <div> container and set the text-align: center style on it.
  2. Create a <ul> <li> inside the div and set display: inline-block style on it.

This is an example of how it is done:

<html>
<head>
  <style type="text/css">
   div#container {
     text-align: center; /* center the horisontal list */
   }
   ul.list {
     list-style: none; /* no bullets */
     display: inline-block; /* this will cause the list to be centered */
   }
   ul.list li {
     float: left; /* horizontal list */
     margin-left: 10px; /* some space between items */
     margin-right: 10px;
   }
  </style>
</head>
<body>
<div id="container">
 <ul class="list">
   <li>Item 1</li>
   <li>Item 2</li>
   <li>Item 3</li>
 </ul>
</div>
</body>
</html>