Wednesday, June 27, 2012

Creating Rooms and Room List in Exchange2010


Few days back when I wanted to create some rooms and room lists in Outlook I was struggling. I tried gathering information from the net and finally managed to find the best solution. So this post is for all the folks who want to create rooms and room List in Exchange 2010.

Almost all of us depend on Microsoft Outlook to manage our official mails efficiently. Outlook has a lot of useful features such as organizing mails, scheduling meeting invites, enabling out of office setting, creating contacts/tasks, and many more. Without Outlook most of us would have been in total mess managing the surplus mails.

While scheduling a meeting, we look out for the availability of the attendees and the rooms. Have any of us wondered how are these rooms managed. Well it is very simple. There are numerous room lists in an organisation and each room list has numerous rooms. The question then arises how to create a room Lists and rooms, how to put a set of rooms under a room list, etc etc. This answer is also pretty simple.

Creating new room list:

  • Launch the "Exchange Management Shell".
  • To create a new room list, type the following in the Exchange management shell:
New-DistributionGroup -Name "Building 1 Conference Rooms” -RoomList
  • The room list named "Building 1 Conference Rooms" is created. 
Creating new rooms:
  • Launch the "Exchange Management Console".
  • Select the mailbox option and click on "New Mailbox" option. 
  • Select the option "Room Mailbox". Click on "Next"
  • Select the option "New user". Click on "Next".
  • Specify the First name(for eg room1) and the relevant details. Click on "Next".
  • After clicking on "Finish", the room is created. 
Putting rooms under a room list:

After creating rooms they are generally put under a roomlist. So to put rooms under a roomList:
  • Open the "Active Directory and Users".
  • Find the particular room list. 
  • Right click on the required room list and select "Properties"
  • Option to add members will be available. The required rooms can be added to the room list.
The rooms and room lists are successfully created. They can be used to schedule meetings. 



Monday, April 16, 2012

Co-existence of ColdFusion9 and ColdFusion10 using Apache web server

With ColdFusion10 Beta already out, many of us will be wondering if there is any way ColdFusion9 and ColdFusion10 can co-exist by using any of the Web Servers available. The answer is yes, it is definitely possible.  The next question which will arise is "how can it be achieved?". Well.. It can be achieved very easily by performing the steps listed below:
  1.  Firstly, Apache needs to be installed. It can be downloaded from the link http://httpd.apache.org/
  2. After Installing Apache, a virtual host setup needs to be done. For creating Virtual Hosts in Apache, refer to my previous blog entry on "Creating Virtual Hosts in Apache" or directly click on the link  http://kmaiya.blogspot.in/2011/10/creating-virtual-hosts-in-apache.html
  3. For the co-existence, we can have 2 virtual hosts set up each running on port 81 and 82. 
  4. Configure ColdFusion9 connector to Apache by launching the wsconfig UI which is located in C:\ColdFusion9\runtime\bin directory. 
  5. After configuring the connector, open the Apache's httpd.conf file which is located in the conf directory. Search for the below text in the file:
     # JRun Settings
     LoadModule jrun_module "C:/ColdFusion9/runtime/lib/wsconfig/1/mod_jrun22.so"
     
     JRunConfig Verbose false
     JRunConfig Apialloc false
     JRunConfig Ignoresuffixmap false
     JRunConfig Serverstore "C:/ColdFusion9/runtime/lib/wsconfig/1/jrunserver.store"
     JRunConfig Bootstrap 127.0.0.1:51011
     #JRunConfig Errorurl url 
     #JRunConfig ProxyRetryInterval 600 
     #JRunConfig ConnectTimeout 15 
     #JRunConfig RecvTimeout 300 
     #JRunConfig SendTimeout 15 
     AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
        
    5.  Cut and paste the above section of code inside one of the virtual host block(host running on port 81) defined in httpd.conf. The final Virtual host block :
<VirtualHost *:81>
DocumentRoot "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs1"
ServerAdmin www.example1.com
 # JRun Settings
LoadModule jrun_module "C:/ColdFusion9/runtime/lib/wsconfig/1/mod_jrun22.so"
<IfModule mod_jrun22.c>
    JRunConfig Verbose false
    JRunConfig Apialloc false
    JRunConfig Ignoresuffixmap false
    JRunConfig Serverstore "C:/ColdFusion9/runtime/lib/wsconfig/1/jrunserver.store"
    JRunConfig Bootstrap 127.0.0.1:51011
    #JRunConfig Errorurl url <optionally redirect to this URL on errors>
    #JRunConfig ProxyRetryInterval 600 <number of seconds to wait before trying to reconnect to unreachable clustered server>
    #JRunConfig ConnectTimeout 15 <number of seconds to wait on a socket connect to a jrun server>
    #JRunConfig RecvTimeout 300 <number of seconds to wait on a socket receive to a jrun server>
    #JRunConfig SendTimeout 15 <number of seconds to wait on a socket send to a jrun server>
    AddHandler jrun-handler .jsp .jws .cfm .cfml .cfc .cfr .cfswf
</IfModule>
</VirtualHost>

       6.  Restart Apache.
       7. Configure ColdFusion10 connector to Apache by launching the wsconfig UI which is located in  C:\ColdFusion10\cfusion\runtime\bin directory. Open the httpd.conf file located in the conf directory of Apache and go to the end of the file. Copy the following line "JkMountFile "C:\ColdFusion10\config\wsconfig\2\uriworkermap.properties"" and paste it in the Virtual host block(virtual host running on port 82).
       8. Open mod_jk.conf file present in the conf directory of Apache and cut the below lines:

JkMountFile "C:\ColdFusion10\config\wsconfig\2\uriworkermap.properties"
    # Select the timestamp log format
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
    AddHandler jakarta-servlet .cfm .cfml .cfc .cfr .cfswf
    Alias /CFIDE "C:\ColdFusion10\cfusion\wwwroot\CFIDE"
    <Directory "C:\ColdFusion10\cfusion\wwwroot\CFIDE">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>

       9. Paste it inside the other virtual host block(virtual host running on port 82) defined in httpd.conf file. The final Virtual host block:

   <VirtualHost *:82>
   DocumentRoot "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs2"
   ServerAdmin www.example2.com

   # Other directives here

   JkMountFile "C:\ColdFusion10\config\wsconfig\2\uriworkermap.properties"
   # Select the timestamp log format
   JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
   AddHandler jakarta-servlet .cfm .cfml .cfc .cfr .cfswf
   Alias /CFIDE "C:\ColdFusion10\cfusion\wwwroot\CFIDE"
   <Directory "C:\ColdFusion10\cfusion\wwwroot\CFIDE">
   Options Indexes FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all
   </Directory>

  </VirtualHost>

       10. Restart Apache.
       11. Launch the ColdFusion9 administrator using:
              http://<server_name>:81/CFIDE/administartor/index.cfm
             Launch the ColdFusion10 administartor using:
              http://<server_name>:82/CFIDE/administartor/index.cfm
             where, <server_name> : localhost/IP address/uniquely defined server name.

Thus, by performing the above mentioned steps, CF9 and CF10 can co-exist together. This is very helpful as it saves the time required for multiple configuring/un-configuring ColdFusion connector to Apache. Any application which needs to be run on ColdFusion9 and ColdFusion10 simultaneously can be done easily.
           

Sunday, February 19, 2012

Caching in ColdFusion - Application-level caching


In ColdFusion 9, caching was done at the server level. All the cache properties like timeToLive, timeToIdle, were defined at the server-level in ehcache.xml present in C:\ColdFusion9\lib\ directory.
   
Wouldn’t it be useful to have caching at the application level? Each application will have different settings and configuration. It will be very useful if objects or templates of a particular application is maintained in the application-level cache rather than server-level cache.  The objects can be cached for a definite period of time as required by the application. Maintaining these objects are also easier. This can also improve the performance and reliability of the application server greatly.

Therefore, in ColdFusion 10 we have provided support for application-level caching. This feature will allow developers to have application specific caching configuration by having ehcache.xml settings specified at application level.  Developers will be able to specify path to ehcache.xml in Application.cfc. All the cache functions like cacheGet, cachePut etc. will use this Application specific cache configuration. Functions like cacheGetAllIds() will return all cache Ids for an application if Application configuration is applicable, else it will return all Ids defined at server level.

Using this application specific caching is extremely simple in ColdFusion. With a single line of code in Application.cfc which contains the path to the application specific ehcache.xml, application level caching can be achieved. Simple right? Newbies to Caching in ColdFusion can also get up to speed using application level caching. To make the concept of application specific caching more clear, I will illustrate a small example which puts a struct object into Application specific cache. The “timeToLive” is 5 seconds which is defined in ehcache.xml. So after 5 seconds the object will be removed from the cache. The directory structure of this example is:

Appsecific_cache
  •                 Application.cfc
  •                 Appspecific.cfm
  •                 Ehcache.xml
Where Appspecific_cache is the folder which contains the respective cfm and cfc.

Application.cfc:
<cfcomponent>
 <cfscript>
  this.name = "appSpecificCacheTest";
                //Specifying the path to ehcache.xml
  this.cache.configfile = "ehcache.xml";
        </cfscript>
</cfcomponent>
ehcache.xml
<?xml version="1.0" encoding="UTF-8"?>

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:noNamespaceSchemaLocation="ehcache.xsd">
    
    <diskStore path="java.io.tmpdir"/>
    
    <cacheManagerEventListenerFactory class="" properties=""/>
    <defaultCache
     maxElementsInMemory="5"
     eternal="false"
     timeToIdleSeconds="30"
     timeToLiveSeconds="5"
     overflowToDisk="true"
     diskSpoolBufferSizeMB="30"
     maxElementsOnDisk="10"
     diskPersistent="false"
     diskExpiryThreadIntervalSeconds="3600"
     memoryStoreEvictionPolicy="LRU"
     clearOnFlush="true"
    />
    
    
    <cache name="app1cache"
     maxElementsInMemory="5"
     eternal="false"
     timeToIdleSeconds="60"
     timeToLiveSeconds="5"
     overflowToDisk="false"
     diskSpoolBufferSizeMB="30"
     maxElementsOnDisk="10"
     diskPersistent="false"
     diskExpiryThreadIntervalSeconds="3600"
     memoryStoreEvictionPolicy="LRU"
     clearOnFlush="true"/>
    
</ehcache>

Appspecific.cfm:

<!--- remove object from Application Specific cache --->
        <cfif ArrayLen(cacheGetAllIds()) gt 0>
 <cfset cacheRemove(ArrayToList(cacheGetAllIds()))>
 </cfif>
  
 <!--- Creating new struct object --->
        <cfset obj1 = structNew()>
        <cfset obj1.name = "xyz">

        <cfoutput>Starting to write to cache..</cfoutput>
        <cfset cachePut("obj1",obj1)>
        <br/>
        <cfoutput>Done!!</cfoutput>
        
        <cfoutput>Trying to fetch cached item...</cfoutput>
        <cfset obj = cacheGet("obj1")>
 <br/>
 <cfdump var="#obj#">
   
  <!--- Giving a sleep of 15 seconds which is greater than timeToLive --->
 <cfscript>
           sleep(15000);          
        </cfscript>
        
        <cfoutput>Trying to fetch cached item after 15 seconds... <br/></cfoutput>
        <cfset obj = cacheGet("obj1")>
 <cfdump var="#obj#">


After executing Appspecific.cfm, we can see that initially the object is present in the cache. After 5 seconds the object is removed from cache because timeToLive is 5 seconds.
This is just a very simple example to demonstrate application specific caching.  The user can change the settings of the cache by modifying the ehcache.xml according to their convenience. Many more such operations can be performed. 
More to caching in my next post..Till then enjoy Application-level caching. :)









Wednesday, February 8, 2012

Solving Space issues in Solaris

Most of us have encountered couple of space issues with Solaris. But sometimes it so happens that there will be space available in the machine but still one cannot install the required software. The below message is shown:

"There is not enough space to install the software. It requires 1,000,223 bytes of space but your machine has just 308,777 bytes free.Please free 691,446 bytes of memory ".

After seeing this message, the most obvious thing which all of us would do is find how much space is available by  using df -eh command. Surprisingly there will be a lot of space on the machine but still the same message is thrown. Thoughts and questions arise as to why?what?how? The amateurs will find it extremely difficult to proceed further.

In the above situation the solution is very simple. This simply happens because the "tmp" directory under root  has very less space. This "tmp" directory stores temporary files during installation by default. So one should manually set the temporary directory to any directory which has space. This is done by the following command:

#export IATEMPDIR=<directory which has space>

For example, If the "tmp" directory under /opt has sufficient space, then the command should be:

#export IATEMPDIR=/opt/tmp/

This can also be:
#IATEMPDIR=/opt/tmp/
#export IATEMPDIR


By doing the above, the temporary directory where the install files are kept is changed to a new directory which has sufficient space. The software will install properly with no issues now.
Hope this post will be helpful for folks who are stuck up with this issue.


Tuesday, December 13, 2011

Changing the Apache Installation directory in Linux

I am sure there are numerous posts online on how to install Apache in Linux Systems. Almost every post has the detailed steps listed out on how to go about. The basic steps are ./configure, make and make install. But what if there is already a different version of Apache installed in the default location. Then your installation goes for a Toss. Next the question arises "How to install Apache in a different location?". I was in a similar situation sometime ago. I searched online for answers. Almost all posts were inclined towards installation of Apache on Linux but none of them were concentrated on how one can change default installation directory of Apache. I opened the Apache Documentation and then found the solution. So I thought I will write a simple post on how to change the default installation directory so that it will save the user's time which is required to hunt down the solution in Apache documentation.

Well.. this is extremely simple. After downloading the tar.gz file from http://httpd.apache.org/download.cgi#apache22 location, unzip the file using tar -xvf <filename>.tar.gz command. Go inside the unzipped directory and type ./configure --prefix=<directory where apache should be installed>. For example, if you want to install Apache in the etc folder then the command will be ./configure --prefix=/etc/apache2 where Apache will be installed in the above location instead of the usual one. The remaining steps are the same. More details can be found by using the help command ie: ./configure --help.

Hope this post was helpful for some newbies who have started playing around with Apache.










Thursday, November 24, 2011

Measuring Performance in ColdFusion

   Performance is one of the most important criteria for any product or application. If the performance of the Application is low then it is not going to be useful. In this blog post I will discuss the different metrics involved in measuring performance, how to write a test case which will measure the performance accurately and the steps taken to measure ColdFusion performance.

Metrics involved in measuring Performance:

In ColdFusion we mainly concentrate on LOAD testing. There are three main parameters when it comes to LOAD testing. They are:

     1. Performance
     2. Stress
     3. Reliability

When we measure performance then we consider "TIME" taken to execute a test case as the most important factor. In other words the Average Response Time(ART) must be less with a greater throughput(no of requests processed per second).

When we measure Stress, then we are no longer interested in measuring the time taken except that it must be constant. The factors which are of at most importance are:
    a. There should be no exceptions/data loss or crash
    b. The tests should be run with a large number of users.
    c. Here we measure the maximum capacity of the product or tool. In other words, we measure the   maximum limit of the tool. For example, if we are interested in measuring the stress of ColdFusion then we increase the number of users till the point ColdFusion server hangs or stops responding. This is done so that the maximum limit of the product is known.

When we measure Reliability, then we run the tests for a longer period of time with constant users. Here, we are more concerned to see if the throughput is constant and no memory leaks are happening. It is generally run for 2 days.


Steps taken before writing a performance test case:


To write a test case for measuring performance we must adhere to the below rules. They are:
1. The CPU Usage for executing a test case should be around 60% for 10 Virtual users.
2. The xmx and xms value should be high so that the major and minor collections can be avoided. It should preferably be 1024.
3. The ART(Average Response Time) should be around 70-100 milli seconds for a single user or else the Jmeter results will not be reliable.


h3. Steps to be performed before running performance tests:


1. JRE should be the same(ie 64-bit/32-bit) on both machines(the two version which have to be compared). The preferred should be Server JDK since it is faster. The JRE used can be seen in the Administrator under "Settings Summary".
2. The different Admin Settings are:
     a. In Request Tuning -> Maximum number of simultaneous Template requests should be 50 with the remaining set to 1
     b. In caching -> Trusted Cache should be ticked/enabled.
     c. In Debugging & Logging -> Debug Output Settings: the debugging should be turned off.
     d. Ensure that no monitoring services are running
3. In the jvm.config in java.args change the xmx and xms value to 1024. Check for -server in the java args. The -Xbatch should be removed. The -Djava.security.manager should be removed. The disableJSafe option should be set to true.
4. Restart the server.
5. Run the test case few times on the browser for Initial warmup.
6. Launch Jmeter. Specify the required details such as no of users, server, path to test case etc.
7. Run the test case through Jmeter. Stop after 10 seconds.
8. Rerun the test case again for 5 minutes.
9. Record the throughput and ART. Repeat this process 3 times for getting a reasonable consistent reading.




 




 

Sunday, October 2, 2011

Creating Virtual Hosts in Apache

I am sure most of what I am writing is available on the Apache Documentation but posting this so that it will be helpful for Users to configure Simple Virtual Hosts easily and faster. 

To start with "What is a VIRTUAL HOST"??
It is a method of Hosting multiple domain names on a server using a Single IP address. This allows sharing of resources of one server such as memory, processor cycles etc which lead to efficient utilization of the resources increasing the efficiency.

Now all of us know Apache is the HTTP Web Server which stores and maintains large number of Websites, It is designed to achieve a very high performance. To configure Virtual Host in Apache is very simple. It involves performing a few steps:


1.Firstly, Install the new Apache Web Server from the http://httpd.apache.org/ site. The downloads for all the OS are available.

2.After installation the Apache will be present in the following directory by default in case of Windows:  "C:\Program Files\Apache Software Foundation\Apache2.X" or "C:\Program Files (x86)\Apache Software Foundation\Apache2.X" in case if 64-bit machines.The httpd.conf file is present under the "conf" folder.
To create Virtual hosts define the following entries in the httpd.conf file which is present under "C:\Program Files\Apache Software Foundation\Apache2.X\conf" directory.

3.Open the file.In the beginning of the file there will be an entry to Listen on a particular port. By default the port is 80.
To create Virtual Hosts which run on port 81 and 82, include the lines after the Listen 80 line ie:            
    Listen 80 
    Listen 81                
    Listen 82
   .  
 
4.Now go to the bottom of the file and search for the entry:
         # Virtual hosts
         #Include conf/extra/httpd-vhosts.conf
       
5.Add the following under the entry:
          NameVirtualHost *:81
          NameVirtualHost *:82


         <VirtualHost *:81>
         DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs1"
         ServerName www.example1.com


         # Other directives here


         </VirtualHost>


         <VirtualHost *:82>
        DocumentRoot "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs2"
        ServerName www.example2.org


        # Other directives here


       </VirtualHost>
    Note: The directory htdocs1 and htdocs2 should be created.
 6.Edit the hosts file located under the System32/drivers/etc/ directory. Add the two entries:
           <ip_address of the machine> www.example1.com         
           <ip_address of the machine> www.example2.com

 7.Save the file and close it. restart the Apache Web server either from Services or console.
 Access the link : http://www.example1.com:81/. It should redirect the control to the htdocs1 directory.Place few files in this directory. It must be served.
 Similary, accessing http://www.example2.com:82/ should be redirected to htdocs2 directory. To access the htdocs folder http://localhost:80/ will do.

Thus, We have setup a dedicated Virtual Host setup in Apache.