Archive for 'Linux'

Adding JMX support to your java app

Lets start with the basics -

what is JMX?

JMX is a technology that lets you add management interfaces for Java applications

the jmx interface on your java application will let you monitor and publish graphs for:

  • heap memory
  • threads and their stack trace
  • CPU
  • classes
  • memory pools
and it will also expose the java Mbeans tree which you can browse
with the jconsole app included with any java distribution:
you can either browse and read these attributes,
and in some cases edit them and change the application status.

Enabling JMX in Tomcat

to enable JMX in tomcat,
edit the wrapper.conf file , and add these lines:
wrapper.java.additional.1=-Dcom.sun.management.jmxremote
wrapper.java.additional.2=-Dcom.sun.management.jmxremote.port=<port>
wrapper.java.additional.3=-Dcom.sun.management.jmxremote.ssl=false
wrapper.java.additional.4=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional.5=-Djava.rmi.server.hostname=<ServerName>
Things to verify before usage:
  1. the numbers after the “wrapper.java.additional.” part are in increasing order – make sure to continue from where the last config line showed, and make sure there are no gaps in the counting.
  2. change <port> to the port number you wish to expose
  3. these settings will enable password-less connection to you JMX server, if you wish to add authentication and SSL you will need to change these settings.
  4.  change <ServerName> to your server name – this setting is needed – without it the server will only allow localhost connections and wont allow remote.
  

Technorati Tags: , ,

Ajax DNS Tool

Online dns tool

I’m always searching for better tools to do my work,
and today I have found this nice DNS online testing tool made with Ajax,
It’s quite nice and fast, and its good when you do not have a Linux distro at hand,
or have a problem with whois test from a proxied server.


Read more

Technorati Tags: ,

NFS mount – When Your Shares Go Wrong

From Wikipedia:

Network File System (NFS) is a network file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed.

So basically its a network share, it allows you to share files between remote computers
in the most easy and seamless way, once it was specifically for UNIX servers,
but today NFS is supported over MS servers as well.

Like everything else in Sysadmin life,
when its working its working well, and nobody hears about it,
but what to do when its not working?
Samba debugging for example is easier from that aspect since it has extensive logs for the sysadmin,
NFS doesn’t keep logs, and NFS issues doesn’t show up in the syslog/messages file as well.

But there are tools that allow you to get extensive information about the running NFS process,
shares, statistics, users connected etc :

Description

Command

see what the machine is exporting SunOS: # exportfs
Solaris: # share
Print the list of shared file systems showmount -e server_name
Print the list of all clients mounting a directory from the questioned server showmount -a server_name
Print the directory and all the clients that are mounting it curretly – from within the nfs server dfmounts
print the nfs netwrok statistics client side: nfsstat -c
server side: nfsstat -s
To see that nfsd is responding rpcinfo -T udp crimson nfs
To see that mountd is responding rpcinfo -T udp crimson mountd
To see that lockd is responding rpcinfo -T udp crimson nlockmgr

rpcinfo -T udp crimson llockmgr

Technorati Tags: , , ,

Improving Your WebSite Performance

Why is my site slow?
Why is my Bounce Rate so high?
How to improve my site’s performance?

These are some of the questions bothering web masters and site owners all the time,
here are some tools and readme’s that will:

  • test your site
  • find bottle necks
  • measure performance from the outside
  • get tips for fixing the problem areas in your site
  • and knows list of issues every site is suffering from

so lets start with online freeware tools and external web site test tools.

Check if your Google Analytics is working well in your site

Who is watching the watchman?

first thing to check – are you getting the accurate statistics from your site?
is your Analytics account configured well?
are you even really using one?

SiteScan™ is a diagnostic tool from EpikOne that verifies if your Google Analytics (GA)
Tracking Code is installed properly on your website.

sitescan google analytics

This scan will go over each page and verify that the Google Analytics code is embedded correctly to each of your page, this can help you diagnose if your bounce rate is high because the Analytics cant see their next click,
or maybe you should really work on your site design.

How does my code looks like from the browser?

firebug

From the firebug download page:

Firebug integrates with Firefox to put a wealth of development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page..

This is the basic tool to verify your code as it seen from the browser side,
you can click a specific element on your page, and get a list on the right pane window of firebug,
of all the css code that is effecting this element, even if the code span multiple css files.

Why is my page so slow?

the yslow tool from yahoo will go through the elements of your page,
and by using a preset list of rules, it will tell you which parts of the website you should fix,
and what to fix.
yslow

The yslow firefox plugin needs the firefox firebug installed first.

If you want to learn more deeply on the reasons behind each of the testing rules yahoo though about you can read the very informative document from yahoo about “Best Practices for Speeding Up Your Web Site

Feed Validator

Get your rss feed validated

AOL webpagetest

from the AOL web page test:

Pagetest allows you to provide the URL of a webpage to be tested. The test will be conducted from the location specified and you will be provided a waterfall of your page load performance as well as a comparison against an optimization checklist.

aol pagetest waterfall

Technorati Tags: , , ,

Implementing MediaWiki

My favorite type of wiki is mediawiki,
I love the ease of use, the huge matrix of extensions available,
and the look and feel of the wiki itself.
backup, restore and upgrade support are also very important reasons to choose a specific wiki software,
and having gone through all this steps in mediawiki, I am very pleased with the ease of use.

Starting from the begining:

what is mediawiki?

MediaWiki is free server-based software which is licensed under the GNU General Public License (GPL). It’s designed to be run on a large server farm for a website that gets millions of hits per day. MediaWiki is an extremely powerful, scalable software and a feature-rich wiki implementation, that uses PHP to process and display data stored in its MySQL database.
Media wiki site

Media wiki also saves the versions of the updated files – allowing for easy reverts and versioning of edited files.

The largest sites using medaiwiki:

Mediawiki large sites list

Design matters

Wiki website doesn’t have to have the MediaWiki standard look,
you can design the look and feel either manually to suite the corporate guidelines or with existing skins.

Novelle’s wiki site:

Novell wiki site

marvel.wikia.com:

marvel

Extensions

Extensions are compilations of PHP code that add new features or enhance functionality of the main MediaWiki core. Extensions are one of the main advantages of MediaWiki. They give wiki administrators and wiki end-users the ability to adapt MediaWiki to their requirements.

The extensions can add capabilities like:

Integrate into the Organization

Using LDAP we can integrate the wiki with the main active directory.
http://www.mediawiki.org/wiki/Ldap will show you the step to add ldap support to the wiki install,
with ldap you can have single and multi domain authentication (including local database)
Retrieval of user information from LDAP:
  • Email address
  • Real name
  • Nickname
  • Language
you can configure the wiki to allow to only domain users to access the server, and you can create wikis that will be accessible only by a specific domain group/users.
You can restrict edit access only to users who have created an account AND verified their email address.
more features the mediawiki ofers:
  • A watch list – update by email when a watched page has changed.
  • By default, MediaWiki’s page URLs look like /index.php?title=Your_Page,
  • but an .htaccess file tweak can make them look like Wikipedia’s clean /wiki/Your_Page links.
  • When a user submits an edit to a page, MediaWiki writes it to the database, but without deleting the previous versions of the page, thus allowing easy reverts in case of vandalism or spamming.

First steps with editing wiki pages

http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Editing_overview

This simple editing tutorial will show you the basic step in editing a new wiki page:

  • headings
  • lists
  • links

Technorati Tags: , , ,