Wednesday, December 15, 2010

Windows Server Administrator should know about these commands

As an administrator, you should familiarize yourself with the following commandline
utilities:
ARP Displays and manages the IP-to-Physical address mappings used by
   Windows Server 2003 to send data on the TCP/IP network.
AT Schedules programs to run automatically.
DNSCMD Displays and manages the configuration of DNS services.
FTP Starts the built-in FTP client.
HOSTNAME Displays the computer name of the local system.
IPCONFIG Displays the TCP/IP properties for network adapters installed on
   the system. You can also use it to renew and release DHCP information.
NBTSTAT Displays statistics and current connections for NetBIOS over TCP/IP.
NET Displays a family of useful networking commands.
NETSH Displays and manages the network configuration of local and remote
   computers.
NETSTAT Displays current TCP/IP connections and protocol statistics.
NSLOOKUP Checks the status of a host or IP address when used with DNS.
PATHPING Traces network paths and displays packet loss information.
PING Tests the connection to a remote host.
ROUTE Manages the routing tables on the system.
TRACERT During testing, determines the network path taken to a remote
   host.
To learn how to use these command-line tools, type the name at a command
prompt followed by /?. Windows Server 2003 then provides an overview of how
the command is used (in most cases).

Thursday, November 25, 2010

Integration of IIS and Apache Tomcat

1. Download the Tomcat IIS Connector (Jk2 binaries)

2.  There will be three directories namely bin, conf and doc. The bin folder has the isapi_redirector2.dll and an installation javascript file install4iis.js. I call the directory where you unzipped the IIS connector zip file as .
3. From IIS perspective I assume that the default web site is running and you need to redirect all URIs related to Servlets and jsps for Tomcat to execute them i.e URIs of the form
These are the steps to be executed from Tomcat and IIS.
From Tomcat:
I assume that you installed Tomcat properly and have a running version of Tomcat at port 8080 with jk2 at 8009. Since these are the default settings in Tomcat 5, there is virtually no need to do anything from Tomcat side once you have a running version of Tomcat.
From IIS:
1. Since the default web site is running, invoking the install4iis.js
(/bin directory)will be straightforward.
2. Configuring the jakarta filter:
To do this one should create a new virtual directory from the IIS management console.
1.Goto Settings -> Control Panel -> Administrative tools -> Internet Information Services
2.Expand the Local Computer icon.
3.Expand Web sites folder and Default Website.
4.Under the Default Web site create a new virtual directory.
1.Right click Default Web site -> Click New -> Virtual Directory -> Next
2.In the (Alias) Text field enter the name as jakarta and Click next
3.Enter /bin as the directory path and Click Next
4.Select read, run scripts and execute access permissions, Click Next and Finish.
5. Configure workers2.properties file:
This file is used to configure the connector properties, the URI pattern to be filtered, and details of the IP address and the port where the Tomcat connector is listening, etc.To map URIs of the form /Servlets-examples and /jsp-examples for Tomcat, the following settings need to be specified in the workers2.properties file.

Create a file workers2.properties in /conf directory with the following settings.
# Example socket channel, override port and host.
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1
# define the worker
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009
# Map the default Tomcat directory to the Web server uri space
[uri:/jsp-examples/*]
group=ajp13:localhost:8009
[uri:/servlets-examples/*]
group=ajp13:localhost:8009
6.Now you are set to execute the IIS Tomcat connector installation script install4iis.js. Either double click install4iis.js or execute it in command line as windows script using
Wscript //E:Jscript install4iis.js
The installation process using install4iis.js will take 10 – 15 steps. Click Ok for all messages in the message box one
after another and finally check for the message
Filter [jakarta] set. Click Ok to complete the installation.
Note: By Default the install4iis.js configures the filter (jakarta, the virtualdirectory configured above) for the Default
Web Site. If you want to configure the filter for other sites, you need to use the appropriate command line options.
For more help,
type Wscript //E:Jscript install4iis.js –h.
7.Restart IIS (In IIS Management console, right click Local Computer -> All tasks -> Restart IIS).
8.To check the configuration of the filter, in the IIS Management console, expand Local Computer -> Web Sites and Right click Default Web Sites and Click Properties and ISAPI Filters tab. There you should see the green status of the jakarta filter indicating that the filter is loaded.
Once the above procedures are completed correctly, then typing
http://127.0.0.1/servlets-examples in browser will fetch the Tomcat page http://127.0.0.1:8080/servlets-examples and http://127.0.0.1/jsp-exampleswill fetchhttp://127.0.0.1:8080/jsp-examples page. Try executing the sample Servlets and jsp examples through IIS Connector and check the results.