Category Archives: Programming

Email forwarding in iRedMail having only Open-Source iRedAdmin Panel

ZPanel has a graphical admin interface which enables email administrators to easily setup email forwarding per user and per domain.  However, the open-source community version of iRedAdmin panel interface does not contain this same capability.  Only the iRedAdmin Pro version enables administrators to setup email forwarding.

iRedMail and ZPanel each utilize the Postfix email service.  Consequently, if both use a MySql database as their back-end to store user email configurations, then each of their MySql database table structures will be quite similar.  Certain fields of the database tables may be a bit dissimilar.

In order to manually configure an email address to forward all received email (and leave a copy of the email on the server) you must use PhpMyAdmin to edit email box records within the ‘goto’ field of the ‘alias’ table of the ‘vmail’ database.

Example — Before Editing the Record:

address field value — user@maildomain.com
goto field value — user@maildomain.com

Example — After Editing the Record to Provide Forwarding:

address field value — user@maildomain.com
goto field value — user@fwd-domain.com,user@maildomain.com

Notice that the email address where you will forward the email is inserted as the first address in the ‘goto’ field, followed by a comma, and followed by the original email box address.  This configuration keeps each received email in the original mailbox (user@maildomain.com) on the server and forwards a copy of it to the forwarding email address (user@fwd-domain.com).

Conect to Ubuntu via Windows Remote Desktop Protocol

Install xRDP on Ubuntu 12.04

Open a terminal window CTRL+ALT+T

sudo apt-get install xrdp (enter)
answer Y(es) when promted

After installing xRDP, make sure Ubuntu xRDP is listening on Tcp Port 3389. Somehow it proxies to 5210. Enter this at the terminal:

netstat -an | grep “LISTEN ” | grep “:3389”

Make sure that your router is port forwarding TCP port 3389 to the lan IP of your Ubuntu.

From Windows 7, click Start, Programs, Accessories, and select Remote Desktop Connection. Enter the router public IP or fully qualified Hostname.DomainName.com of your Ubuntu server. No username or password is necessary at this point. Click connect.

You should go past the windows warning to allow desktop connection.

At the Screen that says Login to xrdp, Make sure the module in the dropdown list is sesman-Xvnc. Enter your username or root, enter your password, and click OK.

You should connect.

If you only achieve a desktop background, without side or top Ubuntu desktop menu items, then you may need to install Ubuntu gnome session fallback or somehow make 2d the default for xRDP connections rather than Unity 3d.

So, if you have a problem connecting, run the commands below and restart Ubuntu, and try connecting again.

echo “gnome-session –session=ubuntu-2d” > ~/.xsession

Or install gnome session fallback.

sudo apt-get install gnome-session-fallback

Here are the links references that I must credit as the configuration resources for the instructions and content of this post:

http://www.liberiangeek.net/2012/05/connect-to-ubuntu-12-04-precise-pangolin-via-windows-remote-desktop/

http://askubuntu.com/questions/234856/unable-to-do-remote-desktop-using-xrdp

http://www.upubuntu.com/2012/01/how-to-open-specific-port-under-ubuntu.html

Installed DeepOfix Email Server which shows missing operating system on Dell Dimension 2400

After downloading and installing DeepOfix Email Server (including GNU/Linux – Squeeze – Operating System), upon first boot it shows “missing operating system – press any key to reboot” on Dell Dimension 2400 with new 160GB Seagate PATA 100 drive and 2GB RAM.  I installed it 6 times, after wiping the hard drive and removing partitions and building MBR, etc., to no avail.

So, I installed Ubuntu Desktop 12.04.02 on the same hard drive.  It booted on the first try and runs like a charm.

Some type of software driver on the DeepOfix must be lacking.  Before installing the new IDE 100 PATA drive, I first installed DeepOfix on a new 160GB SATA drive attached to a local SATA PCI add-on card, but the installed O/S would not boot.  DeepOfix detected and installed itself to the SATA drive, but, upon first restart, the PCI SATA controller and SATA drive were not supported by this particular linux operating system.

I was really looking forward to using the Easy Push Manager graphical interface on the Mail Server.  Although, I didn’t actually like the idea that the email server came pre-configured with Squirrel Mail web mail rather than Roundcube web mail interface.

I will search for an alternative email server to run on Ubuntu.  Maybe iRedMail open source email server will work.  Stay tuned.

Installing LAMP (Linux – Apache, MySql, PHP) on Ubuntu 12.04.02

This is one way to install Apache2 webserver, MySql database server, and PHP5 web server support, plus PhpMyAdmin, onto Linux Ubuntu server or Ubuntu desktop v. 12.04.02 distribution.

Credit to Kevin Whitman for his excellent youtube tutorial. http://www.youtube.com/watch?v=MrGD2X-sDQY

And credit Kevin Whitman’s Blog articles: See: Part 2  http://kevinwhitman.com/2011/06/27/set-up-a-sandbox-to-test-php-apps-part-2-install-web-server-php-mysql-and-phpmyadmin/

Note:  For windows remote SSH access to your Ubuntu server, you should download and execute PuTTY or similar SSH client for establishing a terminal interface to the Ubuntu server IP address.  You can find and download PuTTY open source from sourceforge.net here: http://sourceforge.net/projects/putty.mirror/ . This article assumes that Ubuntu server or Desktop version 12.04.02 (32 bit or 64 bit) is already installed as your server.

Installing Apache Webserver on Ubuntu:

root ~> apt-get install apache2 (Enter)
(answer Y(es) to download the installation package and install it.)

Installing MySQL on Ubuntu:

root ~> apt-get install mysql-server
(you should setup a MySQL ‘root’ password when prompted.  Write it down so you won’t forget the password for ‘root.’)

Install PHP on Ubuntu:

apt-get install php5 php5-gd php-pear php5-mysql php5-curl php5-memcache

Y(es) to download etc.

Restart the Apache web server after installing PHP:

root ~> /etc/init.d/apache2 restart (Enter)

Test Your PHP and Apache installation:

Create a php information file called “testinfo.php” to test PHP and Apache.

at the default /var/www/ directory, and the testinfo.php file should have only the following one line of content:

<?php phpinfo() ?>

Create this testinfo.php file using a text editor.  Access it from http://the_server_IP_address/testinfo.php

Install PHPMYADMIN

root~> apt-get install phpmyadmin

select apache

configure the database root password

Copy the phpmyconf file (configuration file) over

ls –s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf

Then restart apache web server 

/etc/init.d/apache2 restart

So, now phpmyadmin will come up in the browser http://Server_IP_address/phpmyadmin

Login to phpMyadmin with the username:  root
and the password you established

Cloned Ubuntu 12.04 from defective WD 1TB to new Seagate 1TB using Clonezilla

The brand new Western Digital 1TB drive that I bought had developed a harmonic squeal which began about 2 days after I started installing software on it. It sounded like a high-pitched tuning fork.  Before returning this WD drive to the store for a refund, I would want to clone it sector-by-sector to a new Seagate 1TB drive. I had installed Linux Ubuntu 12.04.02 64-bit O/S on the WD drive and had also installed Zpanel web hosting control panel, with Apache web server, MySQL database server, Roundcube Webmail and Postfix / Dovecot email SMTP, POP3 and IMAP mail protocols. I needed to clone the WD onto the new Seagate replacement drive because I didn’t want to make a fresh install of everything (Ubuntu and the Zpanel package) going onto the new Seagate. So, I looked for a good cloning solution.

EaseUS To Do 3.0 booted nicely from CD, but it reported that it could not clone the entire disk-at-once (going disk-to-disk all in one step) because EaseUS reported that the source drive (WD) was larger than the destination drive (Seagate). The source disk had more than one partition. Instead of trying to clone each disk partition separately from source to target, I decide to look for a better cloning solution than EaseUS.

I downloaded the 64-bit ubuntu-based version of Gparted Live, which I read that I could use to resize the source partitions on the WD drive, and hopefully to make them a little smaller (combined) so that a cloning program might allow me to do disk-to-disk at-once, or at least clone the separate partitions one at a time without exceeding the target Seagate total disk size.

The operating partition on the WD drive was quite empty. Probably only 10 percent of the partition actually contained files. I thought that I could use the Gparted Live CD to shrink the operating partition on the WD, and then try to use Clonezilla cloning software to clone the WD partitions (one at a time) over to the new empty Seagate Drive. Little did I know that the Gparted might not be necessary for my particular job.

When I finished burning the Clonezilla Live AMD-64 (64-bit) ISO onto a blank CD (creating a boot utility CD), I decided to try again cloning disk-to-disk at-once without first using Gparted to shrink the OS partition on the WD source drive. CLONEZILLA WORKED!!! It actually reported that the WD source drive was exactly 1.0 Terabyte in total size and that the Seagate drive was 1.2 Terabytes in total size!!! The source drive was actually larger than the destination drive!!! This meant that there was absolutely no reason to resize and shrink any partitions on the WD source drive. EaseUS was wrong. Maybe the free version of EaseUS that I was using had a 1 TB limit and the new Seagate exceeded that self imposed limit! Who knows? Not sure. But, I love Clonezilla. It actually rebuilt the Grub2 boot loader and re-sized (expanded) the operating partition on the target drive to utilize the extra 0.2 terabytes of space located on the destination Seagate drive.

After cloning, I booted to the Seagate OS and everything works just fine — so far.