Jetty – Java-based HTTP server

Jetty is a 100% pure Java-based HTTP server and servlet container (application server). Jetty is a free and open source project under the Apache 2.0 License. Jetty is used by several other popular projects including the Geronimo application server and by the Google Web Toolkit plug-in for Eclipse.
Jetty deployment focuses on creating a simple, efficient, embeddable and pluggable web server. Jetty’s small size makes it suitable for providing web services in an embedded Java application.

In January 2009, Webtide announced that Jetty would be moving to Eclipse Foundation. The Jetty project has been created, and the initial Jetty 7 code (with a refactored org.eclipse.jetty package) was checked into Jetty Subversion at Eclipse.
The Java support in Google App Engine is built on Jetty.

Jetty provides an HTTP server, HTTP client, and javax.servlet container. These components are open source and available for commercial use and distribution.
Jetty is used in a wide variety of projects and products. Jetty can be embedded in devices, tools, frameworks, application servers, and clusters. See the Jetty Powered page for more uses of Jetty.

The core Jetty project is hosted by the Eclipse Foundation. The codehaus provides Jetty accessories , integrations, and extensions, as well as hosting older versions of Jetty. See the About page for information about the project structure.

Features Jetty

  • Full-featured and standards-based
  • Open source and commercially usable
  • Flexible and extensible
  • Small footprint
  • Embeddable
  • Asynchronous
  • Enterprise scalable
  • Dual licensed under Apache and Eclipse



Tagged : / /

Top 5 Log Monitoring Tools | List of Log Monitoring Tools | scmGalaxy

These days there are various kinds of tools used by professionals in Software industry. From CI tools to Virtualization, to Issues, bug tracking tools to various others tools, the lists goes on and on. Thus, it’s really a tough task for them to select best tools as per their needs. So, today I am going to help System Administrators and operations by providing them the lists of top log monitoring tools.
But before that lets see, what is log monitoring ?
Log monitoring is a process of monitoring and understanding the state of the system, server, network, security devices and different applications and how they are working. Actually when these servers and different applications runs, they generate log files and events like Errors, problems, and more information is constantly logged and saved for analysis as text or binary files in the system. System admin keep reviewing these log files on daily basis so they can understand the condition and functioning of systems and different applications. But reviewing all those log files on daily basis is not an easy task, to do this laborious task log monitor needs to be set on those logs which automatically
monitor, review, analyze and generate reports as per the instructions set by System Admin.
As you saw how helpful this is for system admin but to find a good tool for this process is not an easy task. So, without wasting any time let’s check out the top 5 monitoring tools.
1. Logstash
  • Extended functionality via plugins.
  • Free and open source.
  • Filters are code.
  • Great integration with other Elastic products.

2. Fluentd
  • Handles up to 50,000 messages per second at peak time
  • Data filtering and alerting
  • Apache 2.0 License project
  • Simplify and scale data pipeline management with tags
  • More than 200 community-contributed plugins
  • Real-time monitoring and alerts system
  • Store data in multiple systems
  • Collect and correlate web server access logs and application error logs


3. Loggly

  • Text-based logs from any source
  • Custom source groups
  • Point-and-click trending graphs
  • Automated filters and event parsing
  • Full-system RESTful API to integrate with other applications
  • Unlimited saved searches and users
  • Adaptable interface with multiple views, pages and workspaces
  • Unlimited custom dashboards based on any search
  • Built-in customizable alerts with triggers

4. Graylog2
  • Leverages Java, Scala and ElasticSearch technologies
  • Central syslog monitoring
  • Interactive API browser
  • Application debugging
  • Exception monitoring
  • API analytics
  • Intuitive search interface
  • Comprehensive dashboard

5. Splunk
  • Works with Hadoop & NoSQL
  • Setup standard searches as real-time alerts
  • Trigger automatic responses
  • Scale from a single server to multiple data centers
  • Deployable to on premise sites, hybrid-cloud, and/or private and public cloud based infrastructures
  • Securely make data available
  • Supports various use cases including log consolidation/retention, security, compliance reporting, and more
  • Perform ad hoc queries
So, this is the list my top log monitoring tools, I hope you find this useful and if not than feel free to share your thoughts in comment section below.
Tagged : / / / / / / / / / / / / / / /

How to Setup SVN Server with Apache2 in Ubantu?


This tutorial is to setup the SVNServer from base using Apache2 in Ubantu only.

> sudo apt-get update

> sudo apt-get install subversion apache2 libapache2-svn apache2-utils

> sudo addgroup subversion

> sudo mkdir /home/svn

> sudo chown -R www-data:subversion /home/svn

> sudo chmod -R g+ws /home/svn

> sudo svnadmin create /home/svn/myWebsite

sudo vim /etc/apache2/mods-available/dav_svn.conf

& add the following entry at the end of file.

<Location /svn/myWebsite> DAV svn SVNPath /home/svn/myWebsite AuthType Basic AuthName "myWebsite subversion Repository" AuthUserFile /etc/subversion/passwd <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> </Location>

sudo htpasswd -c /etc/subversion/passwd rajesh

sudo chown -R www-data:subversion /home/svn/myWebsite

sudo chmod -R g+rws /home/svn/myWebsite

sudo /etc/init.d/apache2 restart

sudo htpasswd /etc/subversion/passwd user1

sudo /etc/init.d/apache2 restart


Now you can access the SVN Server using….

If you are still not able to open the url, that means you have IPtables services running and stopping you to access the server. For testing, you can stop the sudo ufw stop

Tagged : / / / / / / / / / / / / / /

Server configuration monitoring and diagnostics


ScriptRock’s GuardRail

As DevOps gets more agile, infrastructure needs unit tests too. Enterprise startup ScriptRock offers cloud-hosted testing configuration tools to get you started.

Tagged : / / / / / /




Step to setting subversion server for administrator:-
1. Check to see if subversion is installed:-
# rpm -q subversion
#svn –version
svn, version 1.5.2 (r32768)
compiled Oct 4 2008, 02:48:59
If you see “package subversion not installed” you will need to install subversion before
proceeding. Otherwise you should see something similar to “ subversion-1.4.4-1.fc7”
2. Login in as root:-
3. Create a directory to hold all your repositories:-
#mkdir /home/svnserver/svn
4. Create a repository. In this example we will create a repository called “repositories”:-
# svnadmin create /home/svnserver/svn
5. list the repository files and directory :-
conf db format hooks locks README.txt
6. Create a SVN user
6.1 vi /home/svnserver/svn/conf/svnserve.conf
In that file add these three lines:
Note:- Do not leave space before this three lines.
6.2 Create a password file.
vi /home/svnserver/svn/conf/passwd
In that file add a line for your user:
# add users in the format : user = password
user = mypassword
7. Create a directory to hold all your project in repositories:-
# mkdir /home/svnserver/svn/myproject
8. Try importing source code into the repository. Change to a directory containing the files you want to
check in.
# svn -m “Intailly importing” import /home/svnproject/source/myproject file:///home/svnserver/svn/myproject
9. Start the SVN Server as Daemon:-
#svnserve -d
10. Try checking it out of the repository:- (Check out)
home/user/source# svn co svn://
11. Try checking it in of the repository:- ( Check in)
#svn ci -m “log message” /home/user/source/myproject/

Introduction of CGI | What is Common Gateway Interface (CGI)?


Any Server will (mostly) do   

  • CGI will not work without a server
  • Your Server must allow CGI
  • Your CGI application must be written in a language supported by your server
  • You can use probably your existing web server
  • If you need to test on your local computer, you may install WAMP/XAMPP
  • Each Server has a particular requirements about running  CGI Applications

Experience in relevant programming language

  • Perl
  • Php
  • Unix Shell
  • c/c++

What is CGI
Common Interface Gateway

  • How web browsers submit forms and interact with programs on the server
  • Used for simple interaction applications
  • Can be used with any programming language
  • Often called “CGI Scripts”
  • Can be written in any language
  • Run in the server, not in a web browser
  • Must follow server requirements for running applocations


  • CGI will not work without a web server
  • Your Server must allow CGI
  • Your CGI application must be written in a language supported by your server
  • You can use  your existing web server
  • If you need to test on your local computer, you may install WAMP/XAMPP

Some Guidelines for Unix/Apapche users

  1. Permission – 755 ( aka rwxr-xr-x)
  2. Filename associates
  3. .cgi, .pl, .php …etc
  4. .httaccess
  5. Options+ExecCGI
  6. AddHandle cgi-scripts .cgi
  7. SetHander cgi-script
  8. Access to server log

Some Guidelines for Windows Servers
Many Windows servers do not support perl or PHP
May require ASP or C#
Usually require specific filename extension
.pl for perl
.php for php
.asp or .aspx for ASP
Access to error log
Check with your server web site or support staff

How CGI works

  1. Browser Communicates with server over HTTP
  2. Browser sends a request to the server consisting of header and optional body
  3. Server sends information to the CGI application
  4. Environment variables
  5. Body may be sent in the STDIN stream
  6. Server sends a response consisting of a header and a body
Tagged : / / / / / / / / / / /

Oracle RAC Cheat Sheet | Oracle RAC Guide | Oracle RAC Reference


Check CRS Status

[root@racnode1 ~]#crsctl check crs
Check Clusterware Resources
[root@racnode1 ~]# crs_stat -t -v
Stopping the Oracle Clusterware Stack on the Local Server
[root@racnode1 ~]# /u01/app/11.2.0/grid/bin/crsctl stop cluster
CRS-2673: Attempting to stop 'ora.crsd' on 'racnode1'
Stop Oracle Clusterware stack on all servers in the cluster
[root@racnode1 ~]# crsctl stop cluster -all
Starting the Oracle Clusterware Stack on the Local Server
[root@racnode1 ~]# /u01/app/11.2.0/grid/bin/crsctl start cluster
CRS-2673: Attempting to start 'ora.crsd' on 'racnode1'
Start Oracle Clusterware stack on all servers in the cluster
[root@racnode1 ~]# crsctl start cluster -all
Check Cluster Nodes
[oracle@racnode1 ~]$olsnodes -n
Confirming Oracle ASM Function for Oracle Clusterware Files

If you installed the OCR and voting disk files on Oracle ASM, then use the following command syntax as the Grid Infrastructure installation owner to confirm that your Oracle ASM installation is running:

[oracle@racnode1 ~]$srvctl status asm -a
Check Oracle Cluster Registry (OCR)
[oracle@racnode1 ~]$ocrcheck
Check Voting Disk
[oracle@racnode1 ~]$crsctl query css votedisk
Check Status Oracle Enterprise Manager
[oracle@racnode1 ~]$emctl status dbconsole
Start Oracle Enterprise Manager
[oracle@racnode1 ~]$emctl start dbconsole
Stop Oracle Enterprise Manager
[oracle@racnode1 ~]$emctl stop dbconsole
All Oracle Instances – (Database Status)
[oracle@racnode1 ~]$ srvctl status database -d racdb
Single Oracle Instance – (Status of Specific Instance)
[oracle@racnode1 ~]$ srvctl status instance -d racdb -i racdb1
Start/Stop All Instances with SRVCTL
[oracle@racnode1 ~]$ srvctl stop database -d racdb
[oracle@racnode1 ~]$ srvctl start database -d racdb
Node Applications – (Status)
[oracle@racnode1 ~]$ srvctl status nodeapps
Node Applications – (Configuration)
[oracle@racnode1 ~]$ srvctl config nodeapps
List all Configured Databases
[oracle@racnode1 ~]$ srvctl config database
Database – (Configuration)
[oracle@racnode1 ~]$ srvctl config database -d racdb -a
ASM – (Status)
[oracle@racnode1 ~]$ srvctl status asm
ASM – (Configuration)
[oracle@racnode1 ~]$srvctl config asm -a
TNS listener – (Status)
[oracle@racnode1 ~]$ srvctl status listener
SCAN – (Status)
[oracle@racnode1 ~]$ srvctl status scan
SCAN – (Configuration)
[oracle@racnode1 ~]$ srvctl config scan
VIP – (Status of Specific Node)
[oracle@racnode1 ~]$ srvctl status vip -n racnode1
[oracle@racnode1 ~]$ srvctl status vip -n racnode2
VIP – (Configuration of Specific Node)
[oracle@racnode1 ~]$ srvctl config vip -n racnode1
[oracle@racnode1 ~]$ srvctl config vip -n racnode2
Configuration for Node Applications – (VIP, GSD, ONS, Listener)
[oracle@racnode1 ~]$ srvctl config nodeapps -a -g -s -l
Verifying Clock Synchronization across the Cluster Nodes
[oracle@racnode1 ~]$ cluvfy comp clocksync -verbose
Tagged : / / / / / / / / / /

Apache web server Installation Guide, know how to Install Apache web server on Windows 7?


After a quick detour to install Notepad++, I’m on my way to installing Magento. Before I can get into the meat of it, though, I do require a few prerequisites.

From the installation instructions, installing Magento requires:

  • Apache 1.3.x or Apache 2
  • PHP 5.2.0 and above with Safe mode off
  • MySQL 4.1.20 and above

After a brief search, I happened upon a very handy site (Yes, my current dev machine runs Windows 7). No sense reinventing the wheel, so these instructions should do nicely.

I’ve chosen the latest stable release, 2.2.17, MD5-verified and ready to install.

Always one to put the right foot forward… The first thing I’ve done is to immediately download the wrong version (src) instead of the neatly prepped installer (msi) as per the instructions. Round 1 goes to my eagerness, but after a neat revisit to the Apache download page, I’m off in the right direction.

After kicking off the Apache installer, my first instinct was to twitch at the frozen installer progress (Did the instructions forget about that ghastly Windows 7 User Account Control?), but after only a brief pause, the UAC prompt has displayed and the Apache web server installation is back on track.

None the worse for wear, time for the next step.


I’ve pretty much kaboshed most of the PHP installation instructions, mostly due to its avoidance of the handy PHP for Windows installer. Pointing the installer to the Apache web server’s cgi-bin folder seems like a good idea.

A configuration change…

; Directory in which the loadable extensions (modules) reside.
; extension_dir = “./”
; On windows:
extension_dir = “ext” ; Uncommented (removed the semicolon at the beginning of) this line

… and I’m back to the instructions. After an update to my environment variables, looks like it’s time for a reboot… and sleep.

I’ll be leaving the MySQL install (and testing Apache web server and PHP) ’til tomorrow.

Tagged : / / / / / / / / / / / / / / / / /

Apache Tomcat – Tomcat 7 Finalized – Tomcat 7 Introduction


The volunteer developers behind Apache Tomcat have released version 7.0.6 of the open-source Java servlet container.

“This is the first stable release of the Tomcat 7 branch,” developer Mark Thomas wrote in an e-mail announcing the release on various Tomcat developer mailing lists.

While not a full application server, Tomcat implements the functionality described in the Java Enterprise Edition Web profile specifications. Most notably, it supports version 3.0 of the Servlet API (application programming interface) and version 2.2 of JavaServer Pages, both part of the recently ratified JEE 6. A servlet container manages Java-based applications that can be accessed from a Web browser.

The use of Servlet 3.0 will bring a lot of new capabilities to Tomcat, noted Tomcat contributor Tim Funk, in a presentation at the ApacheCon conference in Atlanta in November.

One big area of improvement is in configuration management for Web applications. Previous versions required all Web app configuration changes to be entered in a central file called web.xml, a process that led to unwieldy web.xml files as well as security risks.

The new approach, called annotations, breaks configuration instructions into multiple files. Separate files are kept for security, for configuring new connections, for initial parameters and for handling third-party libraries.

Other benefits of Servlet 3.0 include advanced cookie management and asynchronous thread support, which should increase the number of connections Tomcat can handle.

In preparation for the release, various beta versions of Tomcat 7 have been distributed since April 2010. Version 7.0.6 fixes some longtime memory leak issues and includes a number of other bug fixes as well.

In addition to making the source code and various binaries available, the development team has packaged a version of the software that can be embedded in other applications.

Tomcat is one of almost 150 open-source projects maintained by the Apache Software Foundation.

Tagged : / / / / / / / / / / / / / / / / /

Why and how to use Jetty in mission-critical production


This article is a summary of a seminar I had on the topic. If it seems like it’s a continuation of an existing discussion that’s because, to some extent, it is. If you haven’t been discussing exchanging your app server, this article probably isn’t very interesting to you.

By putting the application server inside my application instead of the other way around, I was able to leap tall buildings in a single bound.

The embedded application server

This is how I deploy my sample application to a new test environment (or to production):

  1. mvn install
  2. scp -server/target/-1.0.onejar.jar appuser@appserver:/home/appuser/test-env1/
  3. ssh appuser@appserver “cd /home/appuser/test-env1/ && java -jar -1.0.onejar.jar&”

This require no prior installed software on the appserver (with the exception of the JVM). It requires no prior configuration. Rolling back is a matter of replacing one jar-file with another. Clustering is a matter of deploying the same application several times.

In order to make this work in a real environment, there are a many details you as a developer need to take care of. As a matter of fact, you will have to take responsibility for your operational environment. The good news is that creating a good operational environment is not more time-consuming than trying to cope with the feed and care of a big-a Application Server.

In this scheme every application comes with its own application server in the form of jetty’s jar-files embedded in the deployed jar-file.

The advantages

Why would you want to do something like this?

  • Independent application: If you’ve ever been told that you can’t use Java 1.5 because that would require an upgrade of the application server. And if we upgrade the application server, that could affect someone else adversely. So we need to start a huge undertaking to find out who could possibly be affected.
  • Developer managed libraries: Similar problems can occur with libraries. Especially those that come with the application server. For example: Oracle OC4J helpfully places a preview version of JPA 1.0 first in your classpath. If you want to use Hibernate with JPA 1.0-FINAL, it will mostly work. Until you try to use a annotation that was changed after the preview version (@Discriminator, for example). The general rule is: If an API comes with your app server, you’re better served by staying away from it. A rather bizarre state of affairs.
  • Deployment, configuration and upgrades: Each version of the application, including all its dependencies is packaged into a single jar-file that can be deployed on several application server, or several times on the same application server (with different ports). The configuration is read from a properties-file in the current working directory. On the minus side, there’s no fancy web UI where you can step through a wizard to deploy the application or change the configuration. On the plus side, there is no fancy web UI …. If you’ve used one such web UI, you know what I mean.
  • Continuous deployment: As your maven-repository will contain stand alone applications, creating a continuous deployment scheme is very easy. In my previous environment, a cron job running wget periodically was all that was needed to connect the dots. Having each server environment PULL the latest version gives a bit more flexibility if you want many test environments. (However, if you’re doing automated PUSH deployment, it’s probably just as practical for you).
  • Same code in test and production: The fact that you can start Jetty inside a plain old JUnit test means that it is ideal for taking your automated tests one step further. However, if you test with Jetty and deploy on a different Application Server, the difference will occasionally trip you. It’s not a big deal. You have to test in the server environment anyway. But why not eliminate the extra source of pain if you can?
  • Licenses: Sure, you can afford to pay a few million $ for an application server. You probably don’t have any better use for that money, anyway, right? However, if you have to pay licenses for each test-server in addition, it will probably mean that you will test less. We don’t want that.
  • Operations: In my experience, operations people don’t like to mess around with the internals of an Application Server. An executable jar file plus a script that can be run with [start|status|stop] may be a much better match.

The missing bits

Taking control of the application server takes away a lot of complex technology. This simplifies and makes a lot of stuff cheaper. It also puts you back in control of the environment. However, it forces you to think about some things that might’ve been solved for you before:

  • Monitoring: The first step of monitoring is simple: Just make sure you write to a log file that is being monitored by your operations department. The second step requires some work: Create a servlet (or a Jetty Handler) that a monitoring tool can ping to check that everything is okay. Taking control of this means that you can improve it: Check if your data sources can connect, if your file share is visible, if that service answers. Maybe add application-calibrated load reporting. Beyond that, Jetty has good JMX support, but I’ve never needed it myself.
  • Load balancing: My setup supports no load balancing or failover out of the box. However, this is normally something that the web server or routers in front of the application server anyway. You might want to look into Jetty’s options for session affinity, if you need that.
  • Security: Jetty supports JAAS, of course. Also: In all the environments I’ve been working with (CA SiteMinder, Sun OpenSSO, Oracle SSO), the SSO server sends the user name of the currently logged in user as an HTTP header. You can get far by just using that.
  • Consistency: If you deploy more than one application as an embedded application server, the file structure used by an application (if any) should be standardized. As should the commands to start and stop the application. And the location of logs. Beyond that, reuse what you like, recreate what you don’t.

Taking control of your destiny

Using an embedded application server means using the application server as a library instead of a framework. It means taking control of your “main” method. There’s a surprisingly small number of things you need to work out yourself. In exchange, you get the control to do many things that are impossible with a big-A Application Server.


Tagged : / / / / / / / / / / / / / / /