Table of Contents

Linux Migration

Migration can be a result of having to restore data from an old server, or simply wanting to upgrade the current server.

These are the basic steps to perform:

Setup Operating System

OpenSUSE

Ubuntu

Restore Data

Setup System Users

Setup MySQL Databases

Setup Apache

Test Page

Test webpage with PHP support:

Virtual Hosts

Setup virtual hosts for apache.

Create virtual host for audina.net. Create or edit file default in /etc/apache2/sites-available:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
 
        DocumentRoot /var/www
        <Directory />
                Options FollowSymLinks
                #AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                #AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
 
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
 
        ErrorLog /var/log/apache2/error.log
 
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
 
        CustomLog /var/log/apache2/access.log combined
 
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
 
</VirtualHost>

Create virtual host for auditiva.us. Create file auditiva in /etc/apache2/sites-available:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName www.auditiva.us
        ServerAlias auditiva.us
 
        DocumentRoot /var/www/auditiva/es
        <Directory />
                Options FollowSymLinks
                #AllowOverride None
        </Directory>
        <Directory /var/www/auditiva/es/>
                Options Indexes FollowSymLinks MultiViews
                #AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
 
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>
 
        ErrorLog /var/log/apache2/auditiva-error.log
 
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
 
        CustomLog /var/log/apache2/auditiva-access.log combined
 
    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>
 
</VirtualHost>

Verify that AllowOverride None is commented out (add a # in front) for websites to take advantage of .htaccess overrides.

Create link to file /etc/apache2/sites-available/auditiva:

$ cd /etc/apache2/sites-enabled
$ ln -s ../sites-available/auditiva 001-auditiva

Setup Samba

Setup Joomla

Sample Joomla 1.x configuration file:

<?php
$mosConfig_MetaAuthor = '1';
$mosConfig_MetaDesc = 'Audina Hearing Instruments, Inc. - Digital, Programmable and Conventional Products, Intuitive Fitting Software, Old Fashioned Customer Care.';
$mosConfig_MetaKeys = 'audina, Audina, Longwood, Orlando, Florida, Manufacturer, Audiologist, Hearing, Hearing Loss, Hearing Instruments, Hearing Aids, Flx, Intellio, Intuition, Simplex, Sparo, BTE, ITE, OTE, Open Ear';
$mosConfig_MetaTitle = '1';
$mosConfig_absolute_path = '/var/www';
$mosConfig_allowUserRegistration = '0';
$mosConfig_back_button = '0';
$mosConfig_cachepath = '/var/www/cache';
$mosConfig_cachetime = '900';
$mosConfig_caching = '0';
$mosConfig_db = 'audina_joomla1_en';
$mosConfig_dbprefix = 'mos_';
$mosConfig_debug = '0';
$mosConfig_dirperms = '0755';
$mosConfig_editor = 'none';
$mosConfig_enable_log_items = '0';
$mosConfig_enable_log_searches = '0';
$mosConfig_enable_stats = '0';
$mosConfig_error_message = 'This site is temporarily unavailable.<br /> Please notify the System Administrator';
$mosConfig_error_reporting = '-1';
$mosConfig_favicon = '';
$mosConfig_fileperms = '0644';
$mosConfig_fromname = 'Audina Hearing Instruments, Inc.';
$mosConfig_gzip = '0';
$mosConfig_helpurl = '';
$mosConfig_hideAuthor = '1';
$mosConfig_hideCreateDate = '1';
$mosConfig_hideEmail = '0';
$mosConfig_hideModifyDate = '1';
$mosConfig_hidePdf = '1';
$mosConfig_hidePrint = '0';
$mosConfig_hits = '1';
$mosConfig_host = 'localhost';
$mosConfig_icons = '1';
$mosConfig_item_navigation = '0';
$mosConfig_lang = 'english';
$mosConfig_lifetime = '1800';
$mosConfig_link_titles = '1';
$mosConfig_list_limit = '50';
$mosConfig_live_site = 'http://www.audina.net';
//$mosConfig_live_site = 'http://192.168.0.133';
$mosConfig_locale = 'en_US';
$mosConfig_mailer = 'mail';
$mosConfig_mailfrom = 'webmaster@audina.net';
$mosConfig_ml_support = '0';
$mosConfig_multipage_toc = '1';
$mosConfig_offline = '0';
$mosConfig_offline_message = 'This site is down for maintenance.<br /> Please check back again soon.';
$mosConfig_offset = '4';
$mosConfig_offset_user = '0';
$mosConfig_pagetitles = '1';
$mosConfig_password = 'joomlapass';
$mosConfig_readmore = '1';
$mosConfig_secret = 'JuNgVY1BnynZQxTa';
$mosConfig_sef = '0';
$mosConfig_sendmail = '/usr/sbin/sendmail';
$mosConfig_session_life_admin = '1800';
$mosConfig_session_type = '0';
$mosConfig_shownoauth = '0';
$mosConfig_sitename = 'Audina Hearing Instruments, Inc.';
$mosConfig_smtpauth = '0';
$mosConfig_smtphost = 'localhost';
$mosConfig_smtppass = '';
$mosConfig_smtpuser = '';
$mosConfig_uniquemail = '0';
$mosConfig_user = 'joomlausr';
$mosConfig_useractivation = '1';
$mosConfig_vote = '0';
setlocale (LC_TIME, $mosConfig_locale);
?>

Setup Subversion

Install and Configure

Restore Repository

Setup IP Address

Setup Default Startup Services

Setup Firewall

Ubuntu 14.04 Migration

Patches to Apply After Installation

Some software packages (eg. Piwik/Matomo, Piwigo) generate this error: pclzip.lib.php : Missing zlib extensions. To fix it, add this code to each file using gzopen (a function deprecated in favor of gzopen64 in Ubuntu 14.04).

<?php
 
/**
 * On ubuntu in some cases, there is a bug that gzopen does not exist and one must use gzopen64 instead
 * Credit goes to the piwik team for this.
 * See more: http://www.thomasmonaco.com/pclzip-lib-php-missing-zlib-extensions/
 */
if (!function_exists('gzopen')
    && function_exists('gzopen64')) {
    function gzopen($filename , $mode = 'r', $use_include_path = 0 )
    {
        return gzopen64($filename , $mode, $use_include_path);
    }
}
 
?>