Digital Base – Blog » System Administration

Bug in Eclipse3.4 + PDT 2.0 (all platforms)

The Problem

After installing Eclipse 3.4 (codename : Ganymede ) and PDT 2.0 (PHP Development Tools ) as i explained in this post . You should have noticed a strange problem when opening/editing PHP files.

An internal error occured during “Selection Job Title”

After googling i found another user having the same problem but no real solution is posted, so here it comes .

The Solution

You need to install the latest version of DLTK (Dynamic Languages ToolKit ). Just download the files here , extract those to a local directory. Then launch eclipse, in software installs & updates (help menu) add a local site, and update DLTK.

After that just restart Ecipse (ganymede) and you can start using PDT.

Custom .debs for Symfony (1.0/1.1 & 1.2) for Debian/Ubuntu

Installing multiple versions of symfony

As i wanted to test some of my projects compability against symfony 1.1, i wanted to install multiple symfony versions on my system. The main reason for this i want to keep the default symfony installation on my desktop as well as on our production environment.Â

Now as you know, we are working with 5 workstations and multiple servers. So it’s a real pain in the *** doing this stuff all over again on each of those machines, so i decided to create some .debs.

The Solution

Thanks to a great guide posted on the Symfony Wiki i was up & running in under 5 minutes. I had to check out the different versions, create some folders to hold the different symfony installs and create some symlinks to make sure you can use those different versions by command line.

The Packages

I created 3 different packages for each version of symfony. You can install as many as you like, as those will all use a different path. Direct Link .

I tested these packages on an Ubuntu Hardy & Feisty and it works like a charm. Let me know if it doesn’t for you.

If you have a hard time figuring out which version of the symfony framework you want to use for your project, check this post

Show me the magic

You can see you now have 3 (or 4) different versions of Symfony available to you.Â

 Multiple Version of Symfony On the same system

Configuration

Now the hardest part (if you can even call it that). Howto tell your symfony application which symfony to use ? Just go to your applications config/config.php and update the paths to the corresponding version.

[code]#52[/code]

Don’t forget to also update the /js path in your virtual host configuration , change the version to the one you want to use for this project.

Alias /sf /usr/share/php/symfony_1.0/data/web/sf

Feedback/Suggestions welcome, just send an email to info@digitalbase.eu Â

Update : if you have a problem opening PHP files (error occured during Selection Job Title) here is my follow-up post (the fix)

Ubuntu : Thunderbird 2.x + Lighning : Sidebar Problem

The Problem

When using thunderbird 2.x and migrating profiles from one computer to another, i bumped into a lightning + thunderbird error where the calendar sidebar was shown on the left side without a way to disable/hide this bar.

 thunderbird + lightning sidebar bug

That problem is just way to irritating to ignore, as it would cause thunderbird to behave unexpectedly when browsing through email etc…This is clearly not normal behaviour and shouldn't happen.

More details

My google searches tell me this bug happens only when using Thunderbird 2.x and Lightning 0.8+ on an Ubuntu / Debian platform. Please tell me if you reported this problem on another environment.

The fix

First uninstall lightning and close down thunderbird

Then install the "libstdc++5 " package (it's in the official aptitude repositories ) so just :

[code]apt-getinstalllibstdc[/code]

Now reinstall lightning and fire up thunderbird (you can use synaptic to install lightning). That's it, a real easy fix for a simple problem.

Some more info :


http://ubuntuforums.org/showthread.php?t=624655
: a thread on ubuntu forums that suggests to uninstall thunderbird + lightning and tells you to go for ubuntuzilla , a pretty heavy workaround/fix if you ask me.Â

Installing Eclipse 3.4 + PDT 2.x (nightly build)

I told you previously about my frustration getting eclipse 3.3 as a default in the latest ubuntu (Hardy Heron 8.04 ). It looks like they are not going to come up with a solution soon.

This guide will take you through the steps howto get the latest Eclipse together with PDT (PHP development Tools) running on your ubuntu box (Feisty or Hardy). Windows users, this guide will also help you throughout the process of installing our favourite PHP IDE (get that Zend ?).

Downloading all files :

get Eclipse 3.4

Goto the eclipse download site and pick one of the Ganymede (codename for 3.4) packages. As i only need eclipse for PHP development i went for the “Eclipse Classic” package (about 150MB).

get Eclipse PDT (2.0 nightly build)

The PDT download page offers alot of different packages. As we are using eclipse 3.4 we will have to go for the 2.x release. Select the “2.0.0 Nightly Build” option and download the package (about 6MB), you don’t need the PDT JUnit Plugin Tests and Automated Testing Framework so just select the first option.

move the files

Ok that’s it, now you should have 2 files :

  • eclipse-SDK-3.4-linux-gtk.tar.gz
  • org.eclipse.php_feature-I20080707.zip

Move those files to your home directory in a folder called “eclipsepdt”.

Unpacking everything:

Fire up a terminal window and move to the “eclipsepdt” folder

cd ~
cd eclipsepdt

Now unpack both files

unzip org.eclipse.php_feature-*.zip
mv eclipse pdt
tar -zxvf eclipse-SDK-3.4-linux-gtk.tar.gz

Now when you ls -all it should something like this :

Directory listing

Cleanup : remove archives:

Once that’s done, you will want to remove the archives (already unpacked).

rm eclipse*.tar.gz;rm org.eclipse.php*.zip

This should leave you with a clean folder containing all needed files. You should see something very similar to this :

 listing of eclipse directory (in home)

Correct Java Installation

Install Sun’s Java

Luckily java’s sun is in ubuntu’s package library, so we can use aptitude. If you don’t want Java 6, you can use Java 5 too (sun-java5-jdk. After this command it will ask you to accept a few terms & agreements, and press OK a few times, just follow instructions.

sudo apt-get install eclipse sun-java6-jdk

Tell Ubuntu to use Sun’s Java

This will install the required packages, however, Eclipse will run very
slowly since (by default) it will be using GNU’s java, not Sun’s. We now need to tell ubuntu to use Sun’s java as the default one (for those using java 5, replace
java-6-sun with java-1.5.0-sun).

sudo update-java-alternatives -s java-6-sun

Next, edit the JVM configuration file

sudo -b gedit /etc/jvm

and add the following line ON TOP

/usr/lib/jvm/java-6-sun

Tell Eclipse to use Sun’s Java

If you thought that this was it for the java part you are mistaking. There is a bug where Eclipse totally ignores the default java set in Ubuntu (bug 45347 ). That’s why you need to tell Eclipse explicitly to use the one you just installed.

sudo -b gedit /etc/eclipse/java_home

And add

/usr/lib/jvm/java-6-sun

On top of that file. Now we’re all set for the java part. Pfew…

Install PDT

As we downloaded Eclipse and PDT separately, you need to tell that Eclipse installation to install the PDT project libraries. So launch Eclipse

~/eclipsepdt/eclipse/eclipse

If all goes well you should see something like :

 eclipse ganymede splash

Feel free to scream if you want to. Press “OK” when eclipse asks you which workspace you want to open (unless you know what you are doing). This is really not important at this point in time, we need to get the PDT functionality running first.

Now go to Help (alt + H) => “Software Updates” and click the “Add Site” button (right side).

 eclipse add local repositiry

Now click the “Local” button (again right side) and navigatie to your home directory/eclipsepdt/pdt or just enter “~/eclipsepdt/pdt/” in the Location bar. Then confirm using the OK button (hmm i am making this one really dummy proof).

If everything goes well you should see something similar to this :

 eclipse software updates screen

Note the local folder (eclipsepdt/pdt) being on top.

Now check the PDT feature and click install (guess where ?). Eclipse will now try to locate and include all PDT dependencies (previously you had to resolve those dependencies manually). A few seconds later it should give you an “install” window mentioning “your original request has been modified”.

You are installing Eclipse PDT

This basically means that eclipse added the PDT dependencies to your installation queue . If you want to go on (why wouldn’t you if you came this far) just press the Next button. Next page, accept the terms and conditions. (i am letting this one slip from the screenshot gallery) and press Finish.

 PDT installation in progress

Now it’s time to go for a cup of coffee.

 Woohoo, PDT installed

That’s it, reload eclipse and enjoy the PDT features.

Some interesting links :

If you like this post, just help the community by making your voice count :

Directadmin + Custom Webroot (for symfony…)

As a we are using directadmin for our webhosting machines we previously had problems with custom webroots.

The problem

Directadmin rewrites all uses httpd.conf files when adding/updateing subdomains or domain settings leading to a default httpd.conf, resulting in a blank page for symfony projects. (symfony projects use the /web) webroot.

Previous solution

The previous solution told you to update the symfony webroot directory, this way you went with the directadmin default configuration. (public_html document root). The downside of this solution was that your domain directory (/home/user/domain/mydomain.com) was a mess with directories like public_html, private_html, logs….

The final solution

Now i just bumped into a better & easier solution. Apperently directadmin ‘custom httpd configuration’ accepts the following tokens :

|DOMAIN|,
|IP|,
|HOME|,
|ADMIN|,
|DOCROOT|,
|USER|,
|GROUP|,
|CERT|,
|KEY|, |HOSTNAME|,
|SAFE_MODE|,
|OPEN_BASEDIR|,
|CREATOR|,
|BANDWIDTH|,
|QUOTA|Â

So for all your symfony projects you could update the documentroot right there (no manual httpd.conf configuration or changing the symfony webroot). Just add these 2 lines into your ‘custom httpd.conf’ for the selected domain :

1
2
Alias /sf /usr/local/lib/php/data/symfony/web/sf
|?DOCROOT=/home/USERNAME/domains/DOMAIN/public_html/web|

In the above example you should replace DOMAIN & USER by the variables you can find in the ‘contents of the httpd.conf file’ just below the custom httpd.conf configuration.

My Frustration : Ubuntu Hardy Heron and Eclipse PDT

As PHP developers we use ubuntu (now trying Hardy Heron 8.04), but for Eclipse PDT you need Eclipse 3.3 (that is not included in ubuntu repository). Eclipse 3.3 is about 1 year old, and 3.4 will be in testing pretty soon, so for me it's really not clear why Eclipse 3.3 is not the default choice for Ubuntu 8.04.

So we include Firefox 3b05 by default, but we are using an old version of Eclipse ?

Please vote for the idea to include 3.3 by default or provide an easy way for users to upgrade.

More information at launchpad bug #123064

Asterisk visual voicemail on iphone

Asterisk Voicemail for iPhone

Asterisk Voicemail for iPhone allows you to check your voicemail messages on your Asterisk phone system from your iPhone.

It works similar to the native iPhone Visual Voicemail, allowing you to list messages, listen to messages, display caller-id information, delete and move messages, return calls and change voicemail settings all from your iPhone.

The technology behind it is Asterisk , PHP for the backend, Smarty and iUI for the frontend. Asterisk is an open source PBX (Private Branch Exchange) that provides all the functionality of high-end business telephone systems, and much more. It is the world's most flexible and extensible telephone system, providing many features that are not yet available in even the most advanced proprietary systems. It is also the world's cheapest telephone system. The software is free and runs on inexpensive Linux servers. Here are a few reasons why you should try Asterisk in your environment:

  1. It is open source!
  2. It has a strong and loyal community that continues to grow. While there are many open source solutions, most don't have nearly the support that Asterisk has.
  3. Its configuration files are so granular you can configure Asterisk to do just about anything and you can easily add third-party applications (weather reports, Bluetooth integration, …).
  4. If a feature doesn't exist, or you need help with something, you can ask the Asterisk community.
  5. Even Linux novices can try Asterisk with a simple bootable ISO image called AsteriskNOW.

The application and code is available on Google's Code division or you can check out the live demo.

Working with Windows Home Server

 

I thought it was time to share my experience with Windows Home server with the world, so I'm going to dedicate this blog post to it.

What is Windows Home server ?

Before I go deeper into my personal experience with WHS let's take a minute to review what all the buzz is about.

Windows Home server generally provides a simpler, smarter and safer way for families to share, organize and protect their precious photos, videos, music, documents and much more. To know if you would benefit of using WHS for your home you need to ask yourself some questions:

  • Do you have 2 or more PC's in your home wich are in a network?
  • Do you have a broadband internet connection?
  • Do you oftenly spend time backing up those PC's?
  • Do you lack access to your files on your computers when you are not at home?


Same as most people these days, you probably answered yes to all of those questions. This means that Windows Home Server would be a great product for you.
You probably have a ton of data and are beginning to have touble keeping track of all of it.

The 4 core features of Windows Home Server:

  1. Share – With WHS you are able to to access your files from inside and outside of your home. You will be able to connect to your home computers and your server from virtually anywhere and share your files with family and friends through a very user friendly web interface. Also connecting to various devices such as windows mobile devices, smartphones and XBOX 360 is no problem.
  2. Protect – This is probably Home Server's main function. WHS will do a fully automated backup of your home computers every day. The backups are image based so if a hard drive fails on a home PC you can replace the drive and do a full restore of that machine. An other function is shared foler duplication and snapshots to enable users to restore a file a previous version easily.
  3. Store – Home server becomes the digital hub for all the data you have stored on your PC's. You can stream music, videos and photos to all PC's that are given access. It also works great with a Windows Media Center PC.
  4. Expand – With home server you don't have to worry about drive letters and it allows you to expand storage quickly and easily. If you have some old USH or ATA hord drives laying around just plug them in and WHS will add them to the total drive pool. Big points on usability here!

Some technical stuff

There is a lot of stuff going in the background to make all these great features work. Windows Home Server is based on the trustworthy Windows Server 2003 SP2 with additional services running to give you that home server magic. So what are they and how do they work ?

Automated Backup

This is a new service that takes care of all the daily backups on each PC in the house. If you have a problem on a home PC it allows you to either restore an individual file or an entire PC. So how does this work ?

After setting up your Home server you will need to install the Windows Home Server Connector Software on your home computers. This software will take care of communicating with WHS to arrange the backup process. You can choose what to backup and when. Normally this will be every night.

  1. When a computer is backed up, a snapshot or Volume Shadow Copy (VSS) is taken of each volume configured for backup. You can choose wich drives are included in each backup.
  2. The Windows Home Server Connector Software running on your home PC then determines which clusters ( standard 4KB in size) on the volume that have changed since the last backup.
  3. A hash is then calculated for each changed cluster and is then sent to the Home Server.
  4. The server then performs a lookup in the central backup database to determine if this cluster is already being stored.
  5. If the cluster does "not" exist in the backup database, the server then asks the client to send the entire cluster. Otherwise the location of the cluster in this snapshot is recorded and we then move on to the next cluster..and it goes on and on..
  6. This is repeated until all changed clusters on the PC have been evaluated.


What's really nice about the backup feature is that Home Server uses Single Instance Storage, meaning it will only store a single copy of a given file.

We all know that files get duplicated around on the various home PC's in the house and of course we don't want to backup all these file smultiple times. WHS takes care of this by only backing up each file only once.

Drive Extender

Drive Extender is a fantastic service that handles all the magic behind getting rid of the dreaded drive letters when you are adding additional storage to the Home Server.

This means you can use drives of different sizes both external and internal while the Drive Extender service will just add them to the total drive pool. Also if you remove a drive from the Home Server or one of them fails, WHS will move the data to another drive.

This "redundancy" happens at the shared folder level and you can turn this on or off for individual shares.
With Shared folder duplication what happens is this. Say for example you save a new photo to "Photo" share on your Windows Home Server.

At this point the Drive extender system filter creates a reparse point for the new file and determines onto which disk to store the new file. Within a couple of minutes the drive extender service will create a duplicate copy of the file and update the reparse point with the second location.

Remote Access

This is the coolest feature of Windows Home server. With Home Server you are able to access all your computers both inside and out of your home.

Using the web interface you can log in to acces your shared folders on your Home server, Remote Access the Home Server console and even get a Remote Desktop connection to all the PC's in your home network just like you were sitting in front of your own PC when you are actually far away from home.

Of course to get all of this working prperly requires some configuring. I'll get back at this in the "My Experience" section.


My Experience with Windows Home Server

So now that you are properly introduced to the main functions of WHS and are starting to get an idea what it is exactly, I'll share my experience with it.

My Home server:

I assembled some old computer parts I had lying around and bought some harddisks and come up with this system:

  • 3GHz Pentium 4 with silent cooler
  • MSI Motherboard
  • 1 GB DDR
  • 2 x 500 GB Sata
  • DVD RW

I've put this hardware in an old tower case with a silent power supply.

Here are Microsoft’s stated minimum requirements for WHS:

  • 1GHz Pentium 3 or higher
  • 512MB of RAM
  • 70GB of storage space
  • 100 Mbps Ethernet card

 

WHS comes in three discs. They are:

  • Windows Home Server Installation DVD – use this DVD to install Windows Home Server on a computer
  • Windows Home Server Connector Software CD – use this CD to install the Windows Home Server Connector Software
  • Windows Home Server Home Computer Restore CD – use this CD to restore a home computer from a backup located on a Windows Home Server


After installing with the Home Server Installation DVD i was ready to start configuring it.

There is a great tutorial on installing WHS on your server here : http://www.krunker.com/2007/06/26/part-1-installing-windows-home-server-rc/

Part 2 of this tutorial shows you how to setup your software : http://www.krunker.com/2007/07/22/part-2-windows-home-server-connector/

It's all pretty straight forward, but I encountered one major problem. I could not get the remote access to work.

WHS uses port 80 and SSL port 443 for serving the Windows Home Server web interface.
But my ISP Telenet blocks all ports under 1024.. so I had to change them to something higher.

There is a fantastic tutorial on how to do this here: http://www.myhomeserver.com/?page_id=23

After following this tutorial, my web server was up and running and I could remote access EVERYTHING at EVERY TIME from ANYWHERE Laughing and my computers were safely backed up daily so you could say I was already

very happy with it.

I have to round up this post for today, but it will be continued with topics like add-ins and other functions.

 

Resources

Windows Home Server Site
Stay at Home Servers
Windows Home Server Blog
MS Windows Home
Server.com
– Great blog and Add-in site
We Got
Served
UK Home Server site. Lots of add-ins here

good linux mkdir usage

Most people only know mkdir the simple way. The simple way being
[code]mkdir-simple[/code]
I will give you some tips howto use mkdir, the “advanced” way.
All of the above commands could be done in a single command.
[code]mkdir-advanced[/code]
It is alot easier to use the -p option with mkdir, and make all subdirectories with a single command. Even after you read this post, you will catch yourself using the ‘cd’ way…
try to avoid that, it will save you alot of time.

Symfony Plugin Symlinks

First a little backstage information: our programmers are developing under the Linux distribution Ubuntu, and our graphical expert uses Windows for Photoshop purposes. Because we work most of the time with multiple users on one project, we use the version control system Subversion, which offers clients for different operating systems…so far, so good.

When installing plugins in your Symfony application, the installation process sometimes places a symbolic link in the public web directory, to the plugin web directory. In Linux those symlinks work just fine, but when a collegue checks out the code in Windows, those symlinks are degrated to ordinary files without extensions. Windows does not know what to do with them, and your Symfony plugin actions and web files are not catchable by the application. Result: ajax calls are not working, extra css files are not correctly included,…

You have two options to resolve this problem:

  • first, you can install the plugin again under Windows, but that’s doing the same thing twice.
  • Second solution: copy the plugin web directory manually to your applications web dir. Clear the cache with “symfony cc” and refresh your page. The webpage should have all it’s ajax functionalities and css files.

Now the webdesigner can start to work…