Ozzie.eu

Love to code, although it bugs me.

Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Top posts of 2012

Weblogic Server Unexpectedly Shuts Down

stopRunning an Oracle SOA Weblogic deployment on a development Linux server, our team was confronted with an unexpected forced shutdown problem with no apparent trigger. At first, I even thought it could be one of the developers that got access to the machine and was shutting it down for some reason. After a quick look at the command and log history, it was evident that it was an automatic behavior of some sort. And it was triggered by the logoff or session timeout of the remote shell used to issue the command to start the server.
Doing some research on the Web I got to this official Oracle documentation where it’s stated that the JVM listens to the following inputs from the host operating system:
  • CTRL_C_EVENT
  • CTRL_CLOSE_EVENT
  • CTRL_LOGOFF_EVENT
  • CTRL_SHUTDOWN_EVENT
In J2SE 1.3.0, the Shutdown Hooks facility was added to allow orderly shutdown of a Java application. The intent was to allow user cleanup code (such as closing database connections) to run at shutdown, even if the JVM terminates abruptly. More important to our subject at hand, the JVM watches for console control events to implement shutdown hooks for abnormal JVM termination.
The solution to prevent the Weblogic server from shutting down is to reduce the use of operating system signals by the JVM. This is done by adding the “-Xrs” option to the JAVA_OPTIONS variable on your script to start the Weblogic server.
In our case, using Weblogic 10.3 on a RHEL server, we modified the domain script “startWebLogic.sh” to include the “-Xrs” option:
JAVA_OPTIONS = “${JAVA_OPTIONS} –Xrs”
Afterwards, we stopped the Weblogic domain, restarted it and it stopped forcing the shutdown, even after the user logoff.

Google Drive on Ubuntu Linux

Google is a major user and sponsor of open source projects. However on their Google Drive product they surprisingly lack a linux client to synchronize to and from the cloud.

imageLast year, two of the most popular and widely adopted distros of linux (according to Distrowatch) are Ubuntu/Debian based. From these users, all that have Google accounts and are active users of the former Google Docs suite, found themselves left behind in favor of commercial OS users: Windows and Mac. Google’s product manager Teresa W. stated that “Hi everyone - Google Drive for Linux is still in the works. Thanks for following up with us!”. Personally, and having passed 5 months since the lauch, I really begin to doubt this. Well, having gone over this brief rant, let’s get down to business.

imageYou have a really cool Linux client for Google Drive called InSync. It’s installation is pretty straightforward and it’ easy enough to use. Bu it bring two catches with it:

  • It’s still in beta stage;
  • It’s only free while in beta stage:

Personally I don’t intend to use free software, maybe paying for extra storage space on Google Drive and then some day go spend money on a third-party client software.

The solution I found was SMEStorage. I don’t know how this guys have been staying so low profile because they have a really cool service. On the free account mode, you get 5GB free space and access to another 3 cloud storage providers, mapped to the same account. The only catch is that you get a 2GB upload/download monthly limit, which is fine if you’re like me and use your Google Drive for documents, leaving the “heavy stuff” for Dropbox.

The first step is to register for SMEStorage. You can go to the register page here.

Afterwards, on your dashboard, you add a new cloud provider:

image

From the list, choose the Google Drive Cloud Provider:

image

Authorize SMEStorage to access your Google Drive information and files:

image

When your done, you can choose to synchronize the Google Drive information with SMEStorage:

image

What this does is not to import the files but to read and catalog the metadata from the files, so you can view them on the file explorer. By doing  so, it prevents this synchronization process and file browsing to be charged on your monthly free limit.

Passing on to the Ubuntu specific installation, you can get the Linux free Cloud Tools from here. Download the file and save it to your home folder:

image

Open the package with the Ubuntu software center tool and choose “Install”.

image

When it successfully completes, you should have three new tools on your machine. Open the dash and type “smes”:

image

For the remaining steps, I chose to go through the Sync Center setup, which is the one I’ll use, since it performs a local copy of the synced files.When opening the program for the first time it open the properties window, to configure the connection:

image

After putting in the credentials and choosing your desired sync schedule, you map between your cloud providers and your chosen local folders:

image

After mapping the folders and pressing “OK”, you can choose to perform a sync down operation which will download all your files from the cloud to the chosen folder, recursively creating subfolders.All goes well, you’ll be presented with a dialog like this:

image

Hope this helps some of the Google Drive and Ubuntu users who are still looking for a solution.

Ubuntu: installing Joomla development environment

In spite of working mainly with a commercial ECM plataform, sometimes a new corporate site for a small division or department would be better suited with one of the many open source CMS systems available.
For this purpose I chose Joomla and took the time to leave here a pretty straightforward version to set it up on a Ubuntu machine. Having said that, the following technologies will be installed:
  • Apache Web server: to serve the web pages to the client browsers;
  • PHP: to generate the dynamic content pages and functionalities;
  • MySQL: to store all the Joomla related data, such as content and user accounts;
  • PHPMyAdmin: A tool written in PHP intended to handle the administration of MySQL over the Web.
  • Joomla: a free and open source content management framework (CMF) for publishing content on the Web.
 First step was to open a command shell on the target machine. On the prompt, type the following command:
sudo apt-get install apache2 php5 mysql-server phpmyadmin

You will be prompted for your password. After a successful execution this takes care of installing the Web server, PHP. database server and PHPMYAdmin management console. On the installation process you will be asked to provide a password for the MySQL administrator account, as well as PHPMyAdmin.
The second step, still on the command shell, is to map the PHPMyAdmin alias on Apache mapping it to the corresponding installation folder. To do this, issue the following commands:
  1. sudo chmod 777 /etc/apache2/apache2.conf 
  2. sudo gedit /etc/apache2/apache2.conf &
At the end of the apache2.conf file, add the following line:
Alias /phpmyadmin /usr/share/phpmyadmin

Save the file and exit the editor. For Apache to read the new configuration, you must restart the service with the following command:
sudo /etc/init.d/apache2 restart


The third step is, of course, to install Joomla. To do so:
  1. Donwload the files from the Joomla official site;
  2. Unzip them and copy them to the Apache documents root (/var/www)
  3. Browse the folder on your web browser (ex: http://localhost/joomla/)
A warning similar to this should appear. This is because the file configuration.php doesn't exist:

To solve this issue, type in the following commands:
  1. touch configuration.php  
  2. sudo chmod 777 ./configuration.php
Return to the browser, run the check again and it should be all clear. Run the installation wizard to the end. The final step will be to remove all the installation files:
rm -rf ./installation


You're all done!