Linux Mint: Debian’s Favorite Grandchild

Linux Mint (Gloria release), at the time of writing via distro watch, has arguably become Debian’s favorite grandchild.  I can’t say that I use it, but I do recommend it.  I just installed it for a friend of mine.  I’ve installed it before and evaluated it, but I liked Ubuntu’s package manager better.  Just a personal preference, just like my preference towards Ubuntu’s desktop.

That being said, I will tell you what I do like about Linux Mint and why I recommend it to Windows’ converts.  Aside from its price tag (free as in speech, of course), its desktop interface is super easy to use.  Those who are familiar with modern desktops should be more comfortable with the environment.  It combines ease of use with a lightweight feel, free of heavy widgets, and any subsidizing promotional applications distributed with certain versions.

For common tasks, application management and organization seem to be more straight forward than Ubuntu.  The desktop seems “friendlier” as well,  with a hint of familiarity.  While virtual desktops is not inherently obvious, it is easy to invoke.  With one of my favorite key strokes, alt-ctrl left or right arrow, I can switch pretty easily from one desktop to another.   Compiz looks great on it, but didn’t install it for my friend.

There are other things that make Linux Mint pretty cool.  Like the integration of media codecs right out of the box.  Or the installation interface, which is based on Ubuntu’s installation interface but can be easier to use.  In conclusion, I still probably won’t use it personally, but I would recommend it to converts looking for a better experience than Windows.

References:

Java/Ubuntu/JBoss/Oracle XE Part II: Installation

This is the second installment of part I of the previous blog.  It will deal with the implementation portion.  If you have not already done so, please read the previous post.

Background:

This stack is a great choice for corporate environments or for someone who wants to learn Oracle and the full J2EE stack.  Make sure that your Ubuntu Server is the 32 bit version.

Quick Downloads:

Install the JDK:

You have two choices for your jdk.  There’s an open source JDK, aptly named OpenJDK, a free-as-in-speech version of the jdk.  Most mid to large projects use the free-as-in-beer version.  Plus with Sun being pwned (sic) by Oracle, it makes sense.  That’s what I recommend for this exercise.  You can install Sun’s JDK via the command line, but I don’t like that route.  I only install the JDK via the command line if it’s the OpenJDK version.

  • Download the JDK here.  DO NOT CHOOSE any of the bundles.
  • Do choose Java SE Development Kit (pick the latest update).
  • Pick the Linux distribution (32 bit version).
  • It will be a .bin file and is an executable.
  • Run it from the command line.  You’ll have to agree to an SLA.  The result will be a folder.
  • Rename the folder to java.
  • Move the folder to your /opt folder.
  • Alter your .bash_profile, .bashrc or /etc/bash.bashrc file to include the following:
  • JAVA_HOME=/opt/java
  • PATH=$PATH:$JAVA_HOME/bin

Install JBoss:

  • Make sure you have unzip installed.  If not, type:   sudo apt-get install unzip.
  • Download JBoss here or from the sourceforge site.
  • It’s going to be a zip file.  Unzip it.  It will extract as a folder.
  • Rename the folder to jboss.
  • Move the jboss folder to /opt.

Install Oracle XE:

Refer to my previous blog on installing Oracle XE on Ubuntu Server (Jaunty), 32 bit version.

Conclusion:

There you have it.  A full implementation of the JBoss/Oracle XE stack.  Stay tuned for an implementation of Weblogic/Oracle XE stack.

References:

Oracle XE installation on Ubuntu Jaunty

These are my notes from installing Oracle Express Edition on my Ubuntu Server (Jaunty).  I am writing this partly because I will write a sequel to my other blog based on a Java/Ubuntu/JBoss/Oracle XE environment.  This sequel will be way too long if I include this in the same blog.  So here it is as a separate entry.

Background:

For your smaller projects, the Oracle database, even the Express Edition, probably isn’t your best choice.  Why?  Well, for one, Oracle is a beast.  Volumes of books have been written on the administrative portion alone.  The hardware requirements are pretty thick (Express Edition recommends half a gig of RAM, but I say at least a Gig, 1 will give your server more flexibility). Although queries are fairly easy to write (and I like the Oracle syntax over ANSII), writing packages and stored procs can be daunting.

Another thing you want to take seriously are the hardware requirements itself.  I wanted to install it in a 64 bit OS with OXE 32 bit binaries.  The 10g version does not support this.  Why?  Because Oracle does not want you to use this edition for production purposes.  It enforces this by limiting you to single core, 1 Gig of RAM and 4 Gigs of data.  I can see where they are coming from, but I think it’s kind of silly.

Lastly, I found this out the hard way, you’ll need a desk top so that you can finish the rest of the configuration.  I installed this on a 64 bit virtualized server host, so I didn’t want to use more memory than needed.  After hours of google-fu, I ended up deleting the host, reinstalling Ubuntu Server (Jaunty) as a 32 bit edition, upgraded to 2 gigs of RAM, with xfce as the desktop.  I lowered the number of processors to 1 since I didn’t need more due to Oracle XE’s 1 core limitiation.

Requirements:

  • Single core machine
  • Max of 1 Gig of RAM, but you can have more.  Oracle won’t use it.
  • 32 bit version of Ubuntu Server Edition
  • Comfortability with command line based terminal
  • root access

Installation:

So the installation process is pretty straight forward.  The notes below represents basically the documentation.  So I’ll make this as concise as possible.  For a more in depth documentation, please click here.

  • Download the Express Edition here.  You may have to sign up for a user account.
  • Choose the Western European character set.  For Ubuntu downloads, choose oracle-xe_10.2.0.1-1.0_i386.deb.
  • su as root.  If you don’t know how to do that, click here.
  • Go to the folder in which you downloaded the binary.  Type:
  • dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb
  • Configure by typing:
  • /etc/init.d/oracle-xe configure
  • Go with defaults for http port, the listener and auto start
  • Pick a strong password (chars, CAPS, nums).  REMEMBER THIS PASSWORD!!!

Set your env vars:

  • in your terminal,  do the following:
  • type:   cd /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
  • make sure you have permission to execute  scripts on file oracle_env.sh
  • type:   ./oracle_env.sh

Alter bash.bashrc or .bash_profile or .bashrc to set your env automatically.  I prefer editing the bash.bashrc because I like my environments initialized at start up.

  • append to end of file with vi or nano:   /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

OK, so hopefully you installed Oracle XE on Ubuntu Server (instead of Desktop).  So you’ll need a desktop.  In your terminal, type the following:

  • sudo apt-get update
  • sudo apt-get install xubuntu-desktop
  • you may have to restart

A couple useful commands:

  • start:   /etc/init.d/oracle-xe start
  • stop:   /etc/init.d/oracle-xe stop

Make sure that OXE is started.  If not, type the start command in your terminal above.

On your desktop, pull up your favorite browser.  In the address bar, type:

  • http://localhost:8080/apex

You’ll have to login with your SYS or SYSTEM username and the password you defined above.

You’ll have to go to Administration–>Manage HTTP Access.  Choose:

  • Available from local server and remote clients
  • Click Apply Changes

Now you can do CRUD actions and write queries from remote computers.

You’re basically done.  You can install the oracle client, found here.  If you like TOAD (Windows), you can get it here.

References:

On Virtualization

So we’re finally to the point in technology where virtualization is mainstream. I’m going to suggest that most of you reading this blog knows what virtualization is. For those who do not, click on this.  I first came in contact with vmware back at a project in 2003/2004.  The development manager set up a virtual server to host our production application servers for this one java based webapp.  At the time, the notion of virtualization was pretty cool but the hardware requirements and the cost of the product didn’t exactly appeal to my price point.

Now, virtualization is cheap.  As in dirt cheap.  The options are great on the host, guest and hardware requirement side.  On the host software, administrators have the choice among VMWare’s vmware server, Sun’s Virtual Box and xen.  Of these three, the hypervisors I’ve evaluated were vmware server and VirtualBox.  Both have their strength and weaknesses.  Both are production ready as well as mature.  Most importantly, both are free (some versions of the respective product are free as in speech).

Rather than buying one server, for every tech stack I want to deploy, experiment with, develop on, why not utilize one server to host multiple apps.  Sure, you can download JBoss or Apache Tomcat (in the Java world) and host multiple applications in one server that way, but why not utilize one server to separate or host your apps at the server level?  Well that’s what I did and the notes below are from my experience with the configuration of both Sun’s Virtual Box and VMWare Server.  I did not experiment with Xen’s hypervisor.

Sun’s Virtual Box

The first hypervisor I experimented with was Sun’s Virtual Box.  The official documentation and the third party documentation was pretty good.  I was able to read it over just once and install it on one of my Ubuntu desktops and set up two guests rather easily.  The networking was probably the most time consuming (google kung fu resolved my issues in a timely manner).  What I liked most about Virtual Box was its interface on the desktop.   Configuration was also breazy.  I liked the option to create an expanding storage device or create one big allocation at once.  What I wanted to do was install it on a server without a desktop.  I think I will do that in the future.

VMWare Server

A couple weeks later, I bought a server off of desktop components.  It was an AMD, Phenom II quadcore with 1 TB or storage and 8 gigs or RAM.  I added it to my network using basic network configuration and installed proceeded to install the the host remotely.  The experience was slightly more challenging than Sun’s Virtual Box, but it was worth it.  The host didn’t have a desktop so all the installation was done via the command line.

Right away, I was able to access the web interface via port 8222 on the host (which redirected me to an https port on 8333).  This web interface (which didn’t work well on Opera 9, but works great on Firefox 3) allowed me to create hosts rather easily.  You can edit/delete hosts equally as easy via this web interface.  The only thing I have to check out is the number of process it allocates to a host.  On my quad core, I can assign only 2 processors per host.  Is this correct with the version of vmware server I downloaded?  I made sure that virtualization in my bios is set correctly.  I’ll have to go through the documentation again and verify.

On the administration front, the web interface seemed sufficient.  I installed the vmware addon for Firefox and it allowed me to create a link on my desktop that is a front end to a specific host.  I installed a host as a desktop and this addon seemed more than sufficient as well as responsive.  The desktops that I tested were gnome and xfce on Ubuntu.  At the time of writing, I have a six guests in this host.  2 lamp stacks, 2 java stacks (one is tomcat6 and the other is used for the Alfresco CRM), 1 is my desktop and the last is my Oracle XE server.

My only complaint is that sometimes I have to restart the server.  This is because the web interface sometimes doesn’t work.  I haven’t explored the solution but an acceptable (at the development level) work around is just to restart the server.

Virtual Appliances

My next evaluation will be how virtual appliances work on both the Virtual Box and VMWare Server host.  There are a ton of virtual appliance sites out there, included in the references below.  I think it would be cool to have these virtual appliances as guests “templates”.  Stay tuned for the review or recipe on virtual appliances.  I’ll you through how to create and configure a virtual appliance in the context of server administration.

References:

  • http://en.wikipedia.org/wiki/Virtualization
  • http://www.vmware.com/products/server/
  • http://www.virtualbox.org/
  • http://en.wikipedia.org/wiki/Virtual_appliance
  • http://www.vmware.com/appliances/directory/
  • http://virtualappliances.net/

Ubuntu Jaunty Lamp Recipe using tasksel

These are my notes for installing the lamp stack on Ubuntu server, Jaunty.

Ingredients:

  • 64 bit AMD phenom II quad core machine
  • Ubuntu v. 9.04 (Jaunty Jackalope)
  • ability to invoke the tasksel application via the command line

1. Set up your environment:
This will update/upgrade your environment w. the latest libraries, restart server if prompted

  • sudo apt-get update
  • sudo apt-get upgrade

2. Use tasksel to install the stack
Note: tasksel is probably the easiest way to install the stack, in the future, I may publish an a la carte version of this recipe

  • sudo tasksel install lamp-server
  • tasksel will make you choose a password

3. Configure the extensions dir

  • find the mysql.so file (I did it via cd / then sudo find | grep mysql.so)
  • write this folder down
  • sudo vi /etc/php5/apache2/php.ini
  • look for the extension_dir and put the location of the mysql.so file there

4. Configure my.cnf

  • change line: bind-address = localhost
  • to: bind-address = whatever_your_ip_address_is

5. Install phpmyadmin (optional)
Note: phpmyadmin is a useful tool for configuring/debugging your lamp stack. I don’t use it personally, but a lot of developers do.

  • sudo apt-get install phpmyadmin
  • phpmyadmin will make you choose a password

6. Test phpmyadmin

  • goto: http://WHAT_EVER_YOUR_SERVER_NAME_IS/phpmyadmin

7. Changes to the DocumentRoot (optional)

  • Find the line that is DocumentRoot, it should be defaulted to /var/www.  Change it whatever you want.  The DocumentRoot setting can be found below:
  • sudo pico /etc/apache2/sites-available/default

That’s all there’s really to it.  My next revision to this recipe will include finding the index.html/index.php and modifying it to complete the installation.

References:

  • https://help.ubuntu.com/community/ApacheMySQLPHP#Installing%20Apache%202

Abandon Xampp

So I’m a java developer who has seen the php light.  All excited, I created a virtual Ubuntu server (9.10 Juanty) dedicated to the linux, apache, php and mysql stack.  With minimal research, I downloaded xampp and installed it on my new Ubuntu server.  With minimal efforts and problems, I was ready for a “hello world” page.

However, as I did more research, I noticed that the xammp installation page mentioned that the initial configuration of xampp is “not meant for production, but only for developers in a development environment.”  Then it lists certain items that pose security concerns.  All of these concerns are easy to fix.

This is when I realized that if I were going to enable additional configuration for xampp security, I might as well build a true lamp environment, free from the security liberations of xampp.  The configuration wasn’t too bad.  Essentially, the installation calls for the correct packages, changes to the my.cnf and apache.conf files, validation of php-apache integration, a couple mysql admin commands and we’re set up for business.

Why I like this setup better is because apache and mysql is configured to most admin standards.  For instance, restarting both mysql and apache is done via  /etc/init.d instead of having to go through /opt/xammp and traverse through shell scripts that’s essentially doing the same thing.  I think that the migration path of any portion of the stack can be done more cleanly via  an la carte method where you can control the dependencies better via your package manager (synaptic is usually good about telling me when there’s a conflict in packages, if I have to go to a lower level, I can use dpkg if I’m uncertain about dependencies).  I’m sure one can just as easily migrate their xampp stack a la carte, but something doesn’t “feel” right about that migration path.

My development environment mimics xampp while my staging environment is a little more secure (strong passwords, disabled ports, services not necessarily exposed to the outside world).  In conclusion, I’m not an xampp hater, but was rather satisfied with how easy it was to setup a “true” lamp environment.

Stay tuned for my next entry: the recipe for installing the lamp stack on Ubuntu’s Jaunty.  I’m sure it’s been documented a million of times, but it may still be worth the read.

Follow

Get every new post delivered to your Inbox.