Adding web-consle and jmx-console to third party JBoss installations

After doing work with setups that were using packages like Adobe LiveCycle, which were using a neutered version of JBoss that excluded valuable features like web-console, and jmx-console, I decided to write a post on the way to enable them. The reason they do this is valid and obvious, there is no security enabled on these features and it would be easier to disable it than to set the user and password. Also, there is the issue of resources that are required to run them and with the third party java applications running in JBoss resources are already exhausted by the extensive features of the third party application.

So what do we do to enable the features and make them secure? It’s simple and easy to enable them and enable the security to protect them. Securing them is covered based on which version of JBoss you run and easily found on Google so I’m not going to waste space and cover them all, just google it.

The installations I have seen just remove the directories and files that are used for the features, so we simply need to download the version of JBoss that we are using and replace the directories and files. In my example I’m going to use jboss-5.1.0.GA which I downloaded the zip for and unzipped in a Linux VMWare instance that is running Centos 5.3 on my workstation.

Copy the directory and contents from

/jboss-5.1.0.GA/server/all/deploy/jmx-console.war

to the path in your JBoss instance

server/all

and also

server/default

Copy the directory and contents from

/jboss-5.1.0.GA/server/all/deploy/management

to the path in your JBoss instance

server/all

and also

server/default

Restart JBoss and you should have /jmx-console and /web-console working now.

Please keep in mind that these features are not secured and you should not run them in production without securing them.

Basic mysql administration from the command line

There are a multitude of GUI and web tools available to assist in managing MySQL databases but for the most part the MySQL distribution itself has very good CLI tools to manage the databases as well. From backup to restoration to running SQL queries and stored procedures. The CLI tools can do almost anything that the web and GUI tools can do and they’re really fairly simple if you have any understanding of SQL. By the end of this article you’ll have a basic understand of the major CLI tools and how they function and some of the operations you can perform with them.

The first tool in the default MySQL toolbox is mysqlshow and it does exactly what it sounds like, it shows you information about the database itself.

core$ mysqlshow -u root -p
Enter password: 
+--------------------+
|     Databases      |
+--------------------+
| information_schema |
| cacti              |
| mysql              |
+--------------------+

Alternate usage would include:

core$ mysqlshow -u root -p mysql
Enter password:
Database: mysql
+---------------------------+
|          Tables           |
+---------------------------+
| columns_priv              |
| db                        |
| func                      |
| help_category             |
| help_keyword              |
| help_relation             |
| help_topic                |
| host                      |
| proc                      |
| procs_priv                |
| tables_priv               |
| time_zone                 |
| time_zone_leap_second     |
| time_zone_name            |
| time_zone_transition      |
| time_zone_transition_type |
| user                      |
+---------------------------+

The next useful command to discuss is mysqladmin, from here you can create databases, drop databases, flush logs, get status of the daemon, get versions, and perform shutdown operations on the daemon itself.

One of the more useful commands is version, it gets the version of the server, protocol, connection type, location, uptime, and the current information about how the daemon is running. The last few lines also show what you would get if you used the status keyword instead of version.

core$ mysqladmin -u root -p version
Enter password:
mysqladmin  Ver 8.41 Distrib 5.0.51a, for debian-linux-gnu on i486
Copyright (C) 2000-2006 MySQL AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version          5.0.51a-24+lenny2
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/run/mysqld/mysqld.sock
Uptime:                 49 days 4 hours 24 min 30 sec

Threads: 11  Questions: 3622276  Slow queries: 0  Opens: 147150  Flush tables: 1  Open tables: 63  Queries per second avg: 22.852

A more simple command to just get the status of the server is ping.

core$ mysqladmin -u root -p ping
Enter password:
mysqld is alive

You can also create and drop databases through the mysqladmin program, although I don’t recommend it. There is one other great code you can use with mysql-admin and that is extended-status, it shows *everything* you could want to know about the diagnostic state of MySQL.

Another excellent tool is the mysqldump utility, it does exactly what you would imagine it does, it dumps databases out of MySQL cleanly for export to other systems or backup and restoration purposes. Here is a simple example of how to dump all the databases on the system out for restoration purposes in the event of a hardware failure.

core$ mysqldump -u root -p --all-databases > all-`date +%m%d%Y`.sql

The last tool to discuss that you must understand how to use is the mysql shell. From here you can perform queries, dump the database, modify user permissions, and just about anything you can imagine from updates and imports to drops and deletions using standard SQL and mysql shell syntax. The shell command can be used to execute single queries from the command line in this manner

core$ mysql -u root -p mysql -e "select * from user"

Or you can simply open the shell directly and perform the functions you require from there using this syntax, once inside I’ll duplicate the previous CLI version of the query.

core$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 144082
Server version: 5.0.51a-24+lenny2 (Debian)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker start up with -A

Database changed
mysql> select * from user;

Additionally you can use the mysql tool to import databases by invoking it using this syntax

core$ mysql -u root -p databasename < sqlfile.sql

or alternately for all the databases

core$ mysql -u root -p < sqlfile.sql

That covers the basic use of all the major tools you will commonly use on a daily basis when interacting with MySQL and I hope you’ve learned some tricks and feel a bit more comfortable interacting with MySQL from the command line. It’s a tremendously valuable skill that is overlooked by many people.

Pantek Incorporated Makes Weatherhead 100 List for the Second Year in a Row

Pantek Incorporated has been inducted into the prestigious Weatherhead 100, upstart category, for the second year in a row, ranking 16th on the list. Pantek provides comprehensive IT consulting and support to companies who utilize Linux and Open Source technologies. The Weatherhead 100 Upstart list recognizes local companies whose percentage of sales growth qualifies for the Weatherhead 100 and who employed 15 or fewer employees, and/or had less than $1 million in net sales in 2008.

“We are proud to be recognized for our growth over the past few years, especially with the current economic environment,” said Pantek President, Barry Zack. “We are committed to providing the best Linux and Open Source, consulting and support to the community and expect continued growth in the future.”

Since its inception in 1987, the Weatherhead 100 has been the event that showcases the fastest growing companies in Northeast Ohio. Qualifying companies must show consistent growth over the last five years. The Weatherhead 100 list–objectively determined annually and highly regarded throughout the region–is a testament to hard work, commitment, innovation, and the dream to succeed. To view the full list of winners, log on to www.weatherhead100.org.