Thursday, February 3, 2011

Setting up a Joomla Web Server using Virtualbox, TurnkeyLinux and DynDNS | Packt Publishing Technical & IT Book Store

This article is based on the Joomla! CMS and how to make use of virtualization software to set up a fully functional web server completely isolated from other applications on your PC.

Posted via email from alromero's posterous

Monday, June 28, 2010

Build your own Application to access Twitter using Java and NetBeans: Part 4

http://www.packtpub.com/article/build-custom-application-twitter-java-netbeans-4

In this final part of my article series, you’ll learn how to convert the URLs from your friends’ timeline into clickable hyperlinks…

Posted via email from alromero's posterous

Monday, June 21, 2010

VirtualBox 3.1 Beginners Guide : Review from Ubuntu Tutorials

I am a big fan of VirtualBox as a desktop virtualization technology. I have it installed on my machine and I’m constantly using it to try out new distributions and learn new technologies. It really is a great tool! I have seen it grow from a new project into the fully featured, efficient virtualization competitor that it is today.

I was recently sent a copy of the newly released “VirtualBox 3.1 Beginner’s Guide“, which outlines deploying and managing a cost-effective virtual environment using VirtualBox. I want to thank Packt Publishing for sharing a copy with me, and I’d like to share my review of the book here. I hope some of you will take the time to check out the Packt Publishing website as a resource for technical books.

VirtualBox 3.1 Beginners Guide

The first thing I have to say about this book is that it is very detail oriented.  It truly is a beginners guide. I’m positive I could give this book to my father and he’d be able to install, configure and run VirtualBox on Windows or Linux. It outlines, in step-by-step detail, everything you’d like to know about VirtualBox. Even though I consider myself a Virtualbox veteran, I followed along with some of the tutorials and was impressed that no detail was left out.

One of the things that really stands out about this title is that it includes a huge number of screenshots. The number of screenshots in the book provide any beginner with the visual roadmap they need to complete the task at hand. It covers installing VirtualBox on both a Windows and Ubuntu host, as well as installing and configuring the reverse as guests. If you’ve never installed VirtualBox before, you’ll have an installation up and running in just a few minutes.

Beyond installation and configuration, this book goes into detail regarding the command line options (I learned quite a bit from this chapter!) as well. VirtualBox provides a full set of command line tools for starting, stopping, configuring, cloning and creating virtual machines. This makes it a perfectly reasonable candidate for a headless server virtualization solution!

This book covers guest additions, disk and image creation and management, all networking options and how they differ, using and creating virtual appliances, using snapshots and even remote management. It really is a good resource for getting started with Virtualization. I’m glad to have a copy of this book in my collection.

The sections that were the most useful for me were the networking and command line chapters. I was not familiar with any of the command line tools, and the networking was a little blurry for me. Before getting a copy of this book I was unfamiliar with virtualized networking beyond NAT and Bridged. This book went into enough networking detail that I’m very comfortable with each of the networking options and in what situations each might apply. This will really boost my efficiency and productivity with VirtualBox.

For anyone wanting to learn more about virtualization or doing research into cost-effective virtual environment solutions, I would highly recommend VirtualBox 3.1 Beginner’s Guide.

If this article has been helpful, please consider linking to it.

Posted via web from alromero's posterous

Friday, June 4, 2010

Problem with MySQL and Tomcat Turnkey Appliances connection solved

After two frustrating days of testing, testing and guess what? More testing! Er… sorry for being a little bit rude, but I haven’t slept well in two days…  Let me start again… After two frustrating days of testing & debugging, I finally solved the communication problem between my MySQL and my Tomcat Turnkey Appliances.

The following error kept showing up at my Mozilla Firefox screen:

Error 1: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure Last packet sent to the server was 0 ms ago.)

The problem is that the Tomcat Turnkey Appliance includes Tomcat 5.5 and it comes along with a lot of security restrictions. So I had to add the following line to the $TOMCAT-CONFIG/policy.d/04webapps.policy file:

permission java.net.SocketPermission "127.0.0.1:3306", "connect";

And all this thanks to kalkulator-kredytowy´s answer at http://stackoverflow.com/questions/2172570/tomcat6-cant-connect-to-mysql-the-driver-has-not-received-any-packets-from-the

Posted via email from alromero's posterous

Missing logs - Tomcat 5.5 + Ubuntu 8.04 - Server Fault

Summary

Freshly-installed (via apt-get) Tomcat on a freshly-installed Ubuntu 8.04 LTS 64-bit works, but doesn't (seem to) log anything. See also "What I've Tried" and "Closing In On It" below.

More Detail

Because the package maintainers have done a HUGE amount of the work, getting basic things working has been a fairly straightfoward matter of running apt-get and pointing Tomcat at the right JDK. And it works. But it doesn't appear to log anything.

As far as I can tell, the logging infrastructure is controlled via logging.properties files (since this is Tomcat 5.5, not Tomcat 5.0), including a central one (which you can override per web app) at /etc/tomcat55/logging.properties (/etc/tomcat55 is symlinked as /var/lib/tomcat55/conf). I'm not overriding it, and I can't see why I'm not seeing something. Here's the file:

 1 1 # Licensed to the Apache Software Foundation (ASF) under one or more   2  2 # contributor license agreements.  See the NOTICE file distributed with   3  3 # this work for additional information regarding copyright ownership.   4  4 # The ASF licenses this file to You under the Apache License, Version 2.0   5  5 # (the "License"); you may not use this file except in compliance with   6  6 # the License.  You may obtain a copy of the License at   7  7 #   8  8 #     http://www.apache.org/licenses/LICENSE-2.0   9  9 #  10 10 # Unless required by applicable law or agreed to in writing, software  11 11 # distributed under the License is distributed on an "AS IS" BASIS,  12 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  13 13 # See the License for the specific language governing permissions and  14 14 # limitations under the License.  15 15   16 16 handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3manager.org.apache.juli.FileHandler, 4admin.org.apache.juli.FileHandler, 5host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler  17 17   18 18 .handlers = 1catalina.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler  19 19   20 20 ############################################################  21 21 # Handler specific properties.  22 22 # Describes specific configuration info for Handlers.  23 23 ############################################################  24 24   25 25 1catalina.org.apache.juli.FileHandler.level = FINE  26 26 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  27 27 1catalina.org.apache.juli.FileHandler.prefix = catalina.  28 28   29 29 2localhost.org.apache.juli.FileHandler.level = FINE  30 30 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  31 31 2localhost.org.apache.juli.FileHandler.prefix = localhost.  32 32   33 33 3manager.org.apache.juli.FileHandler.level = FINE  34 34 3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  35 35 3manager.org.apache.juli.FileHandler.prefix = manager.  36 36   37 37 4admin.org.apache.juli.FileHandler.level = FINE  38 38 4admin.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  39 39 4admin.org.apache.juli.FileHandler.prefix = admin.  40 40   41 41 5host-manager.org.apache.juli.FileHandler.level = FINE  42 42 5host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs  43 43 5host-manager.org.apache.juli.FileHandler.prefix = host-manager.  44 44   45 45 java.util.logging.ConsoleHandler.level = FINE  46 46 java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter  47 47   48 48   49 49 ############################################################  50 50 # Facility specific properties.  51 51 # Provides extra control for each logger.  52 52 ############################################################  53 53   54 54 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = DEBUG  55 55 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers = 2localhost.org.apache.juli.FileHandler  56 56   57 57 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO  58 58 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers = 3manager.org.apache.juli.FileHandler  59 59   60 60 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].level = INFO  61 61 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/admin].handlers = 4admin.org.apache.juli.FileHandler  62 62   63 63 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO  64 64 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers = 5host-manager.org.apache.juli.FileHandler  65 65   66 66 # For example, set the com.xyz.foo logger to only log SEVERE  67 67 # messages:  68 68 #org.apache.catalina.startup.ContextConfig.level = DEBUG  69 69 #org.apache.catalina.startup.HostConfig.level = DEBUG  70 70 #org.apache.catalina.session.ManagerBase.level = DEBUG 

The only change I've made is:

1 1 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = DEBUG 

...which was set to INFO like all the others, but I wanted to get it to log something, so I upped it to DEBUG. Naturally I've restarted Tomcat.

I can compile and view a JSP, so again Tomcat is working, but /var/lib/tomcat5.5/logs is stubbornly empty. Even if I force an error by having an invalid JSP or some such, I'm getting nothing.

What I've Tried

  • I've been through the steps listed in the Tomcat FAQ for ensuring that the distro hasn't messed things up (they hadn't).
  • I've gone looking for a logs directory elsewhere in case it's not /var/lib/tomcat5.5/logs (although that was created by the install).
  • Naturally I've restarted Tomcat after making any changes.

One thing I haven't done is to chown everything to be owned by the tomcat55 user that the install created. logs is owned by tomcat55, but a number of the other directories and files are owned by root, though they're world-readable. I haven't done this because (hangs head) I can't quite figure out how to fully back-up the existing tree so I can readily undo the change. The blasted tree has absolute symlinks interweaving /etc/tomcat55, /var/lib/tomcat55, and /usr/share/tomcat55 that I know of. I could tar up each of those, but I don't know for certain I'm not missing something.

EDIT:

Closing In On It

Okay, so I've found that it's writing console-style stuff to /var/log/daemon.log. Whew! At least that gives me a place to start. And it's issuing complaints like:

1 1 jsvc.exec[18819]: Can't load log handler "2localhost.org.apache.juli.FileHandler"  2 2 jsvc.exec[18819]: java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler 

And I'm not surprised, 2localhost.org.apache.juli.FileHandler isn't a valid class name (packages can't start with digits!). So I'm suspecting that the default logging.properties file is...not good. Will report back.

Geez.... It's a good thing I found this excellent information on Tomcat 5.5, because I couldn't find out why there were no logs!

Posted via web from alromero's posterous

Wednesday, June 2, 2010

Install Webmin on Ubuntu Server or Desktop 9.10 Karmic Koala - Andrei DANEASA

I am a big fan of Ubuntu Server. It’s exactly what you need for a server, no fancy UI, just services.
Dealing with all the text configuration files can be a time consuming task and there is something that can help a lot. It’s called Webmin and it is a web interface for configuring your linux box.
Webmin demo

You need to install first some perl-related libraries required by webmin:

sudo apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl libmd5-perl


The you need to download the latest webmin archive (this might change in time). I am downloading the Debian package:

(thanks @macrocode)

Install the Debian package with dpkg, not Aptitude:

sudo dpkg -i webmin_1.490_all.deb

* Your downloaded version may differ. Just use the deb package you’ve just downloaded.

Enjoy your Webmin installation at https://[serverIP]:10000 .
What I am normally doing is forwarding the port 10000 out of my router and access my webmin from anywhere on the internet. You can forward it to another port and to be user-friendly and easy-to-remember you can use DynDNS to pick a nice name.

Webmin on Ubuntu 9.10 Karmic Koala

Enjoy!

Related posts:

  • Install Webmin on Ubuntu Server 9.04 Jaunty Jackalope
  • Ubuntu 9.10 Karmic Koala released
  • Install Oracle 10g XE on Ubuntu Server 9.04 Jaunty Jackalope
  • Ubuntu server upgrade to 9.04
  • Install subversion for VPS (cPanel) under CentOS
  • Tags: , , ,

    This entry was posted on Thursday, October 29th, 2009 at 6:30 pm and is filed under Linux.You can follow any responses to this entry through the RSS 2.0 feed.You can leave a response, or trackback from your own site.

    Excellent article that shows a pretty quick installation process for webmin. I used it in my recently created Ubuntu 9.10 Text-only server. Worked flawlessly.

    Posted via web from alromero's posterous

    Monday, May 24, 2010

    Book Review: Virtualbox 3.1 Beginners Guide | Damien Saunders

    advert

    Book Review: Virtualbox 3.1 Beginners Guide

    24. May, 2010 0 Comments

    Hi thanks for coming back ... got a question or a comment? or just say hello! Got a question? then say hello @damiensaunders

    As far as book reviews go, from personal experience they are much harder to write then a review of a music album or live gig. So when reading VirtualBox 3.1 Beginners Guide by Alfonso V. Romero (Packt Publishing) I was surprised at how easy the book was to read and how an experienced VirtualBox user can dip in and find something new.

    VirtualBox is one of my favourite system virtualisation apps that I use on my Mac and my Windows machines. I’ve written about Virtualbox quite a bit and my own guide to install Windows on a Mac is one of my most popular posts.

    I would have considered this book more for people starting out with VirtualBox, but the last few chapters and appendix are really for advanced users, quite serious chapters for Linux users or web developers looking at options for virtual appliances.

    I can only have kind words for this book – the majority of which anyone would be able to follow. The Guide seems to be more useful for people running Linux and wanting to install Windows. Niftily, the book tries to overcome this with specific sections on how to install VirtualBox for Windows. Any reader will feel happy that the how to install Windows guest section relates to both XP and Win7, I hope there is a future revision of the book to include Mac OSx users.

    The book does what it says, revealing the ‘robust capabilities’ of VirtualBox – at the end of the book, I was left unsure why I would want to download and use VirtualBox – but there again, if you’re reading this, the probably you are already using VirtualBox so you can go buy the book without worrying about this.

    VirtualBox 3.1 Beginners Guide and the format of this book has a nice approach, there are many headings like ‘What just happened’ for short reviews and every section has a pop quiz that won’t keep you awake at night. These reviews and questions help keep you engaged even when you’re reading this book away from a computer screen.

    VirtualBox 3.1 Beginners Guide from Packt Publishing is available now.

    Packt Publishing provided a copy of this book for review. Thanks.

    Related posts:

    1. Virtualbox has a new how to book
    2. 15 minute guide to Virtualbox Windows 7 RC1 and your Mac
    3. Upgrading to Virtualbox 3.0 and Mac OSx hosts
    4. How to install Virtualbox on a Mac
    5. HOW-TO install Ubuntu using Virtualbox on a Mac

    Cool! Another review of my VirtualBox book!

    Posted via web from alromero's posterous