Archive for the Category »Technical Stuffs «

AWStats for Network Load Balanced websites

INSTALL AND CONFIGURE STATISTICS FOR LOAD BALANCED IIS SITES-

Ingredients-

* In this scenario I’m going to use the following things-

# 3 NLB nodes – 2K31 (IP- 192.168.1.129), 2K32 (IP- 192.168.1.130), 2K33 (IP- 192.168.1.131)

# A server for stats installation – 2K34 (IP- 192.168.1.132)

# Statistics – AWStats (download from http://awstats.sourceforge.net). I used AWStats 6.8 version.

# Website for testing – www.a-r-u-n.com (must be setup in all the above 3 NLB nodes)

# Stats website in 2K34. I’m going to use server’s IP itself for testing.

Preparation-

1. Install AWStats 6.8 in the server 2K34 in the following location – C:\AWStats.

2. During installation it prompts you to specify the location of apache installation. Specify ‘none’ since this one is for IIS-

—–> Running OS detected: Windows

—–> Check for web server install

awstats_configure did not find your Apache web main runtime.

Please, enter full directory path of your Apache web server or ‘none’ to skip this step if you don’t have local web server or don’t have permission to change its setup.

Example: c:\Program files\apache group\apache

Apache Web server path (‘none’ to skip):

> none

3. Next step is it will ask to create a new config file for website, specify ‘y’-

—–> Need to create a new config file ?

Do you want me to build a new AWStats config/profile

file (required if first install) [y/N] ? y

4. It then asks you to specify the name of the website for config file. Specify the website name-

—–> Define config file name to create

What is the name of your web site or profile analysis ?

Example: www.mysite.com

Example: demo

Your web site, virtual server or profile name:

> a-r-u-n.com

5. Press Enter to complete the installation of AWStats.

6. Create the data directory called ‘Data’ under the following location C:\AWStats\ and assign modify permission to the following objects – Network Service, web user(IUSR).

7. Now open the config file ‘awstats.a-r-u-n.com.conf’ located under ‘cgi-bin’ folder (in my case – C:\AWStats\wwwroot\cgi-bin).

8. Search for ‘LogFile’ section. You need to specify the path where log files are created for the website.

Note – Since this configuration is for websites hosted in Load Balanced servers the format for ‘LogFile’ differs from the usual log format. There are two options available to generate logs for websites-

a. Copy all the log files from log folders of a-r-u-n.com from all the 3 nodes to the location in local server. In this case, I copied from \\2K31\C$\Domains\a-r-u-n.com\logs\W3SVC100\*.log to C:\Logs\a-r-u-n.com\2K31\*.log for 1st node. \\2K32\C$\Domains\a-r-u-n.com\logs\W3SVC190\*.log to C:\Logs\a-r-u-n.com\2K32\*.log for 2nd node. And \\2K33\C$\Domains\a-r-u-n.com\logs\W3SVC150\*.log to C:\Logs\a-r-u-n.com\2K33\*.log for 3rd node. Now all the 3 nodes’ log files for a-r-u-n.com have been copied to the location in local server – C:\Logs\a-r-u-n.com\ in 2K34. Now we need to merge all the above 3 nodes’ log files into one file using a perl tool called logresolvemerge.pl which ships with AWStats installation. This can be found in C:\AWStats\tools\logresolvemerge.pl. To merge all the log files to a single file, perform these steps-

1. Goto command prompt and to C:\AWStats\tools\ and type the following command –

perl logresolvemerge.pl C:\Logs\a-r-u-n.com\2K31\ex*.log C:\Logs\a-r-u-n.com\2K32\ex*.log C:\Logs\a-r-u-n.com\2K33\ex*.log > C:\Logs\a-r-u-n.com\all.log

2. Now you will see all the nodes’ log files have been merged to a single log file at C:\Logs\a-r-u-n.com\all.log

3. Now specify this log file path ‘C:\Logs\a-r-u-n.com\all.log’ under the ‘LogFile’ section in ‘awstats.a-r-u-n.com.conf’. This will looks like-

LogFile=”C:/Logs/a-r-u-n.com/all.log”

b. Second option is to specify UNC share path in config file. Note down the UNC share path of all the nodes for a-r-u-n.com (\\2k31\C$\Domains, \\2k32\C$\Domains and \\2k33\C$\Domains). Create a map networked drive for the above UNC shares. Say ‘G’ drive mapped to \\2k31\C$\Domains and ‘H’ drive mapped to \\2k32\C$\Domains and ‘I’ drive mapped to \\2k33\C$\Domains respectively. Now you can access those log files directly by G:\a-r-u-n.com\logs\W3SVC100\*.log for 2K31 server and H:\a-r-u-n.com\.. for 2K32 server and so on. Now open the config file ‘awstats.a-r-u-n.com.conf’ and look for ‘LogFile’ section. Specify the following-

LogFile=”perl C:/AWStats/tools/logresolvemerge.pl G:/a-r-u-n.com/logs/W3SVC100/ex*.log H:/a-r-u-n.com/logs/W3SVC190/ex*.log I:/arun1.com/log/W3SVC150/ex*.log |”

By specifying the above format in config file of a-r-u-n.com AWStats generates stats automatically during update the process. This is most suited in the environment where the log files are too large and you need to save space. Also this is time saver.

o Note – First option is time consuming and requires human intervention for exporting each and every logs. Where as second option is easier and can be specified only in config file and stats generation is automated during rebuild process.

9. Now you need to specify the log format for your website. Simply copy the format to config file from the top of the web log file(exmmddyy.log) if you not sure about the exact LogFormat of your web sites. (Note – Websites in each nodes must have same ‘Logging options’ enabled in IIS, this can be confirmed by right clicking web site properties > Logging Properties > in General and Advanced tab make sure that particular website in all the nodes have same settings)-

#Software: Microsoft Internet Information Services 6.0

#Version: 1.0

#Date: 2010-08-31 14:39:06

#Fields: date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken

Copy the fields so that it looks like this-

LogFormat= “date time s-sitename s-computername s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs-version cs(User-Agent) cs(Cookie) cs(Referer) cs-host sc-status sc-substatus sc-win32-status sc-bytes cs-bytes time-taken”

10. Please specify DirData path in ‘DirData’ section as C:\AWStats\Data which you created in step 6 so that AWStats will store the result of stats analysis in AWStats files.

11. Now you need to update the stats in order to view it as GUI from web browser. To do this goto command prompt to the location – C:\AWStats\wwwroot\cgi-bin and key in the following command-

perl awstats.pl -config=www.a-r-u-n.com –update

You will see the result like this-

C:\AWStats\wwwroot\cgi-bin>perl awstats.pl -config=www.a-r-u-n.com -update

Create/Update database for config “./awstats.www.a-r-u-n.com.conf” by AWStats version 6.8 (build 1.910)

From data in log file “perl C:/AWStats/tools/logresolvemerge.pl G:/a-r-u-n.com/logs/W3SVC100/ex*.log H:/a-r-u-n.com/logs/W3SVC190/ex*.log I:/arun1.com/log/W3SVC150/ex*.log |”…

Phase 1 : First bypass old records, searching new record…

Searching new records from beginning of log file…

Phase 2 : Now process new records (Flush history on disk after 20000 hosts)…

Jumped lines in file: 0

Parsed lines in file: 1560

Found 43 dropped records,

Found 0 corrupted records,

Found 197 old records,

Found 1320 new qualified records.

Make sure you see new qualified records at the end. If there’s any problem or error please verify you have followed previous steps correctly.

12. Stats have been generated for your website. Now we need URL to view the generated stats. Please create a website in IIS mapped to AWStats ‘cgi-bin’ directory (ie, C:\AWStats\wwwroot\cgi-bin).

13. Call the website from browser – http://192.168.1.132/awstats.pl?config=a-r-u-n.com

14. You are almost done. To generate stats automatically on daily or hourly basis you need to automate it by using Windows Scheduled Tasks. Create a batch file under cgi-bin folder of AWStats and specify the following command – perl awstats.pl -config=www.a-r-u-n.com –update

And finally create a scheduled task to schedule the batch file every 6 hrs or 12 hours.

15. Add sugar to taste… sorry add websites. ;)

“`*“`arun
Configure Network Load Balancing for websites with dedicated ip

Configuring NLB for websites with dedicated ip addresses

# Assuming NLB is already setup and the nodes are converged fine.

Ingredients-

Following are the things I planned for my NLB (Network Load Balancing) setup in Windows Server 2003-

# 3 machines for web server(IIS installed) – Windows Server 2003

Machine names and its IP addresses-
2K31   -        192.168.1.129
2K32   -        192.168.1.130
2K33   -        192.168.1.131

# 1 machine for DNS server – Windows Server 2003

2K34   – 192.168.1.132

# Cluster IP addresses (for dedicated IP) – 192.168.1.150(for arun1.com), 192.168.1.151(for arun2.com)

#  Website name that is going to use in dedicated IP configuration – arun1.com, arun2.com

# On each web servers create the folder structures as below-

C:\Domains
C:\Domains\arun1.com
C:\Domains\arun1.com\wwwroot

C:\Domains
C:\Domains\arun2.com
C:\Domains\arun2.com\wwwroot

Create a test page “index.html” under wwwroot and copy paste the below code-

<html>
<h1><center>WELCOME TO ARUN WORLD</center></h1>
<b/>
2K31 – arun1.com – dedicated
</html>

Change the domain name arun1.com and server name ‘Hosted in 2K31’ to appropriate domain name and server’s name on each sever as this will help a bit in the later stage during testing of each nodes as which node is servicing the request.

Note – It is not intention to have separate physical machines to configure NLB. You can either configure it in Virtual servers like – Microsoft Virtual PC, VMWare Workstation or VMWare Server. This saves cost. In this scenario I’ve setup servers in my friend’s laptop with this configs-

VMWare Workstation ACE Edition 6.02
1.73 Ghz Intel Dual Core
1 GB RAM
120 GB HD

Preparation-

In Network Load Balancing Manager-

1.  Open ‘Cluster Properties’  of the cluster nlb.arun.com.

2.  In ‘Cluster IP Address’  click ‘Add’ to add new dedicated IP.  In this case I’ve added 192.168.1.150 and 192.168.1.151

3.  You will be presented with a dialog box “Confirm Change of Cluster-wide

Properties”. Click ‘Yes’ to proceed further.

In IIS Manager-

Setup 2 sites arun1.com host header pointing to the ip 192.168.1.150 and arun2.com host header pointing to the ip 192.168.1.151.

In DNS Management console-

Create forward lookup zone for 2 domains – arun1.com(192.168.1.150) and arun2.com(192.168.1.151)-

Testing-

Now open the browser and type http://arun1.com and you will see something like this-

In the above pic, it is serviced by node 1 – 2K31.

To test whether this site is servicing through other nodes please suspend or stop the 2K31 node in Cluster Manager(Please refer this URL Setup Network Load Balancing in Windows Server 2003 see under ‘Testing’ section)

Happy Load Balancing! :)

“`*“`arun

Setup Network Load Balancing in Windows Server 2003

Setup Network Load Balancing in Windows Server 2003

 Generally you will need atleast 2 machines installed with Windows Server 2003 and each machine should have atleast 1 NIC and 1 static IP address. Additionally, you will need one more machine (either Windows Server 2003 or Windows XP) needed in order to test the setup. Assuming DNS server is included to add DNS records for websites.

Ingredients-

 Following are the things I planned for my NLB (Network Load Balancing) setup in Windows Server 2003-

 # 3 machines for web server(IIS installed) – Windows Server 2003
     Machine names and its IP addresses-
    2K31   -        192.168.1.129
   
2K32   -        192.168.1.130
   
2K33   -        192.168.1.131

 # 1 machine for DNS server – Windows Server 2003
     2K34   – 192.168.1.132

# Cluster IP address – 192.168.1.100

# Cluster Name  – nlb.arun.com

# On each web servers create the folder structures as below-¦lt;br />     C:\Domains
    C:\Domains\nlb.arun.com
    C:\Domains\nlb.arun.com\wwwroot
¦lt;br /> Create a test page “index.html” under wwwroot and copy paste the below code-
 <html>
<h1><center>WELCOME TO ARUN WORLD</center></h1>
<b/>
Hosted in 2K31
</html>

 Change the server name ‘Hosted in 2K31’ to appropriate server’s name on each sever as this will help a bit in the later stage during testing of each nodes as which node is servicing the request.

 Note – It is not intention to have separate physical machines to configure NLB. You can either configure it in Virtual servers like – Microsoft Virtual PC, VMWare Workstation or VMWare Server. This saves cost. In this scenario I’ve setup servers in my friend’s laptop with this configs-

VMWare Workstation ACE Edition 6.02
1.73 Ghz Intel Dual Core
1 GB RAM
120 GB HD

 Preparation-

 Setting up Network Load Balancer-

 1. Open Network Load balancing Manager-
Start > Administrative Tools > Network Load balancing Manager
(or)
Start > Run > type ‘nlbmgr’ 

2.  Right click Network Load Balancing Manager > New Cluster
New Cluster

3.  In ‘Cluster Parameters’ wizard, in ‘Cluster IP Configuration’ specify the cluster IP address – 192.168.1.100, subnet mask and Full Internet Name as ‘nlb.arun.com’.  Ensure ‘Multicast’ option is selected along with ‘IGMP Multicast’.
Leave the ‘Allow Remote Control’ unchecked.

Note – IP address is the virtual IP address for the cluster that will be used to address the cluster. If you have single adapter then you should select ‘Multicast’ in ‘Cluster Operation Mode’. By selecting ‘Unicast’ allows NLB to take over the network card it is bound to and doesn’t allow any additional network traffic through it. You can configure single adapter in ‘Unicast’ mode but after configuration the cluster manager will not be able to communicate with the server. Generally, ‘Multicast’ is slower than ‘Unicast’ mode.

3_Cluster_Parameters

4.  On the next wizard ‘Cluster IP addresses’, leave the settings as it is and click next. (We will visit this in next topic).

 4_Cluster_IP_Addresses

5.  In ‘Port Rules’ wizard, ensure the necessary ports are added. By default NLB configures to handle all ports. In this scenario I’m going to add these ports – 80 (http traffic) and 443 (https traffic). Add the ports by hitting ‘Add’ button and input 80 as From and To in Port range. Ensure ‘Both’ (ie, both TCP and UDP) protocol is selected.

One of the important thing here is ‘Filtering Mode’ which determines affinity of requests. Affinity describes how requests are routed to a specific server. ‘None’ refers any servers can service the incoming requests. ‘Single’ refers to a specific server has to handle each and every requests from a given IP. ‘None’ is recommended as it is better in stateless applications and this results in less overhead in NLB. ‘Single’ mode should be used when there’s a state server connection, for example – SSL.

5_Add-Edit_Port-Rule

     Do the same thing for adding port 443.

6.  Next step is to add nodes to the cluster. In the ‘Connect’ wizard specify the host name which needs to be included in NLB. In this case I specified 2K31 in ‘Host’ (or you can specify IP address of the host, for this server – 192.168.1.129) and click ‘Connect’ button and ensure interface name and IP info of that node are listed. If there’s more than one NIC card select the one that is going to be configured for NLB.

 6_Connect

 7.  In ‘Host Parameters’ wizard specify the Priority. This should be unique number and it identifies each node in the cluster. Lower the number the higher the priority. Priority 1 is the master node which receives requests and routes the traffic to other nodes only when the load in this node is high. Hit ‘Finish’.

7_Host_parameters

8.  This will take 25 – 35 secs for a node to get converged. Following is the status of NLB cluster-

8_result

9.  Follow the above steps (6th and 7th) to add remaining nodes-
2K32   -        192.168.1.130
2K33   -        192.168.1.131 Review the error log in the bottom pane if there is  rror during additional node setup. Wait for few seconds and hit refresh until you see all the nodes becomes ‘Converged’ state.        

2K32_error_log

 One of the other ways to determine the status of each node in the cluster is – Goto command prompt in one of the nodes > type wlbs query

You will see something like this if all nodes are converged-

2K33_NLB_Status

 In this picture I tried in 2K33 (3rd node).

Setting up website to test NLB-

Setup website in node 1 – 2K31 – Setting up a website is easy process – Open IIS Manager from Administrative Tools and create a new website called nlb.arun.com as host header mapped to the ip address 192.168.1.100 (Cluster IP). Please setup the same site with same settings in all other nodes (2K32, 2K33).

 Setting up DNS records-

This should be carried out in DNS server 2K34 which is not a part of cluster and just acts as DNS server. In order to get a website working you need DNS record configured for that website. To do this you need to create DNS record for arun.com as shown in this picture. Create host record (A) for nlb.arun.com pointing to the cluster IP – 192.168.1.100-

2K34_DNS_Setup

 Testing-

 Now open the browser and type http://nlb.arun.com and you will see something like this-

nlb.arun.com_access

In the above pic, it is serviced by node 1 – 2K31To test whether this site is servicing through other nodes please suspend or stop the 2K31 node in Cluster Manager.

2K31_Node_Suspended

Access the site http://nlb.arun.com again after suspending node 1.

nlb.arun.com_access2_node2

Now you will see the request is serviced by 2K32 (node 2). This confirms request is routed to another node when the first node is unreachable. Now resume/start the node which you stopped in previous stage.

Happy Load Balancing! :)

“`*“`arun 

How to repair suspected mssql database

How to repair suspected mssql database-

When  you connect your MSSQL server you may notice some database(s) in ‘suspected’ mode and it doesn’t let you do anything. This is happening because of database corruption, server not properly shut down, etc..  To repair the ‘suspected’ database you may need to run the following query in your Query Analyzer(for SQL 2000) or Management Studio (for SQL 2005 and 2008)-

EXEC sp_resetstatus databasenamehere;
ALTER DATABASE databasenamehere SET EMERGENCY
DBCC checkdb(databasenamehere)
ALTER DATABASE databasenamehere SET SINGLE_USER WITH ROLLBACK IMMEDIATE
DBCC CheckDB (databasenamehere, REPAIR_ALLOW_DATA_LOSS)
ALTER DATABASE databasenamehere SET MULTI_USER

Note: Before running the query please make sure you have taken the copy of data and transaction log files to another location.

Your database is repaired now

“`*“`arun
kayako SupportSuite error

If you receive this error when accessing Kayako SupportSuite-

Parse error: syntax error, unexpected ‘{‘ in support\includes\SmartyLight\class.template.php on line 351

Please make sure ‘short_open_tag‘ is set to ‘On‘ in php.ini this will fix the problem.

“`*“`arun
Helm error – A name contained an invalid character

If you receive the following error after you try to delete or create a domain from helm or Restore from HelmRestoreTool-

2009-09-10 10:24:33 Website.IWeb_RemoveHostHeader 0-2147467259: Unknown error while adding host header: A name contained an invalid character.
{0}
2009-09-10 10:24:33 CDomainAlias.DeleteEx 0-2147467259: Unknown error while adding host header: A name contained an invalid character.
{0}
2009-09-10 10:24:33 CDomain.DeleteDomainEx 0-2147467259: Unknown error while adding host header: A name contained an invalid character.
{0}

2009-09-10 10:40:14 Website.IWeb_RemoveHostHeader 0-2147467259: Unknown error while adding host header: A name contained an invalid character.
{0}
2009-09-10 10:40:14 CDomainAlias.DeleteEx 0-2147467259: Unknown error while adding host header: A name contained an invalid character.

{0}
2009-09-10 10:59:22 Website.IWeb_AddWebsite 0-2147467259: Unknown error while creating site: A name contained an invalid character.
{0}
2009-09-10 10:59:22 CWebsite.RepairWebsiteEx 0-2147467259: Unknown error while creating site: A name contained an invalid character.
{0}

Solution – In the remote server where the site is hosted please goto C:\Helm.config\ and delete IIS.xml file. Now try to delete the domain from helm you will be able to delete successfully.

“`*“`arun
mysql command line administration

MySQL command line administration-

1. Login to server-

Goto MySQL installed location through command prompt-

C:\MySQL\bin

or

C:\Program files\MySQL\bin

Specify MySQL user and password -

C:\MySQl\bin> mysql -u root -p

Above command is used to login to local MySQL server. If you want to login to remote MySQL server use this command

C:\MySQl\bin> mysql -h <specify-remote-mysql-server-name-or-ip> -u root -p

2. List all the databases in MySQL server-

mysql> show databases;

3. Create new database in MySQL server-

mysql> create database <specify-db-name-here>;

4. Create a table in a database-

create table `<specify-table-name-here>` (`field1` type , `field2` type);

For example- To create a table ‘fortest’ with 3 fields – testid, testname, testemail-

mysql> create table `fortest` (`testid` int( 11 ) not null auto_increment , `testname` varchar( 50 ) not null , `testemail` varchar( 100 ) not null , primary key ( `testid` ));

5. To access a particular database in MySQL server-

mysql> use <specify-db-name-here>;

for example-

mysql> use test;

6. To view all the tables in that particular database-

mysql> show tables;

7. To view that particular database’s table field format-

mysql> desc <specify-table-name-here>;

for example-

mysql> desc fortest;

8. To access all the contents in a table-

mysql> select * from <specify-table-name-here>;

for example-

mysql> select * from fortest;

9. To retrieve specific info from particular table-

mysql> select * from <specify-table-name-here> where <specify-field-name-here> = ‘any-info’;

for example – if you want to find the details of a person named ‘arun’ from the table ‘fortest’ -

mysql> select * from fortest where testname = ‘arun’;

10. To create user in MySQL server-

mysql> create user <specify-user-name-here> identified by ‘<specify-password-here>’;

for example-

mysql> create user ‘testinguser’@'%’ identified by ‘testingpassword’;

alternate method-

You can create through mysql database-

mysql> use mysql;
Database changed
mysql> insert into user (host,user,password) values (‘%’,'testinguser’,password(‘testingpassword’));
Query OK, 1 row affected (0.19 sec)

mysql> flush privileges;

11. Change password for a user-

mysql> set password for ‘user-name’@'hostname’ = password(‘specify-password-here’);

12. To assign database specific privileges-

All privileges to a particular database-

mysql> grant all privileges on `test` . * to ‘testinguser1′@’%’ with grant option ;

Specific privileges to a particular database-

mysql> grant select , insert , update , delete , create , drop , index , alter , on `fortest` . * to ‘testinguser’@'%’;

Alternate method-

mysql> insert into user (host,db,user,select_priv,insert_priv,update_priv,delete_priv,create_priv,drop_priv) values (‘%’,'specify-db-name-here’,'specify-user-name-here’,'y’,'y’,'y’,'y’,'y’,'y’);

mysql> use mysql;
Database changed
mysql> insert into user (host,db,user,select_priv,insert_priv,update_priv,delete_priv,create_priv,drop_priv) values (‘%’,'test’,'testinguser’,'y’,'y’,'y’,'y’,'y’,'n’);

13. To remove privileges for a particular user from a database-

mysql> revoke all privileges on `test` . * from ‘testinguser’@'%’;

14. To delete a particular table-

mysql> drop table `fortest` ;

15. To delete a particular database-

mysql> drop database `test` ;

16. Backup the database-

C:\MySQL\bin> mysqldump -u root -p <database-name> > C:\backup\test.sql

17. Backup particular table from the database-

C:\MySQL\bin> mysqldump -u root -p <database-name> <table-name> > C:\backup\fortest.sql

18. Restore a database from the backup-

C:\MySQL\bin> mysql -u root -p <database-name> < C:\backup\test.sql

“`*“`arun
Reset MySQL root password

How to reset MySQL root password-

Lost your MySQL root password? Resetting MySQL root password is simple. Please follow these steps-

# Login to your MySQL server.
# Locate the mysql.ini file.
-This should be something like C:\MySQL\my.ini or “C:\Program files\MySQL\bin\mysqld-nt.exe” –defaults-file=”C:\Program files\MySQL\Data\my.ini” MySQL
-You can also check this by viewing the Properties of the MySQL service command line under the Services MMC.
# Edit the appropriate *.ini file and add the following line immediately after [mysqld] ;
skip_grant_tables = 1
# Restart the MySQL service. Please note that MySQL is now running unsecured.
# From a command prompt, change to the /bin directory (Ususally C:\MySQL\bin or whereever under MySQL installed location) and enter the following command to login as root:
mysql -u root
# Then input the following command:
update mysql.user SET Password = Password(‘newpassword’) WHERE User=’root’;
# Now remove the line you added to my.ini in previous step and restart MySQL.
# Make sure you can login to MySQL using the updated password.

“`*“`arun
Steps to secure Active Directory

Important steps to secure Active Directory-

# Rename or disable the Administrator account (and guest account) in each domain to prevent attacks on your domains.

# Physically secure all domain controllers in a locked room.

# Manage the security relationship between two forests and simplify security administration and authentication across forests.

# To provide additional protection for the Active Directory schema, remove all users from the Schema Admins group, and add a user to the group only when schema changes need to be made. Once the change has been made remove the user from the group.

# Restrict user, group, and computer access to shared resources and to filter Group Policy settings.

# Avoid disabling the use of signed or encrypted LDAP traffic for Active Directory administrative tools.

# Some default user rights assigned to specific default groups may allow members of those groups to gain additional rights in the domain, including administrative rights. Therefore, your organization must equally trust all personnel that are members of the Enterprise Admins, Domain Admins, Account Operators, Server Operators, Print Operators and Backup Operators groups.

# Use global groups or universal groups instead of domain local groups when specifying permissions on domain directory objects replicated to the global catalog. For more information, see Global catalog replication.

“`*“`arun
Active directory concepts in pictorial format

Active directory concepts in pictorial format-

click to enlarge the image

active directory

“`*“`arun
FSMO Roles in Active directory services

Overview of FSMO Roles-

There are five different FSMO roles and they each play a different function in making Active Directory work:

PDC Emulator – This role is the most heavily used of all FSMO roles and has the widest range of functions. The domain controller that holds the PDC Emulator role is crucial in a mixed environment where Windows NT 4.0 BDCs are still present. This is because the PDC Emulator role emulates the functions of a Windows NT 4.0 PDC. But even if you’ve migrated all your Windows NT 4.0 domain controllers to Windows 2000 or Windows Server 2003, the domain controller that holds the PDC Emulator role still has a lot to do. For example, the PDC Emulator is the root time server for synchronizing the clocks of all Windows computers in your forest. It’s critically important that computer clocks are synchronized across your forest because if they’re out by too much then Kerberos authentication can fail and users won’t be able to log on to the network. Another function of the PDC Emulator is that it is the domain controller to which all changes to Group Policy are initially made. For example, if you create a new Group Policy Object (GPO) then this is first created in the directory database and within the SYSVOL share on the PDC Emulator, and from there the GPO is replicated to all other domain controllers in the domain. Finally, all password changes and account lockout issues are handled by the PDC Emulator to ensure that password changes are replicated properly and account lockout policy is effective. So even though the PDC Emulator emulates an NT PDC (which is why this role is called PDC Emulator), it also does a whole lot of other stuff. In fact, the PDC Emulator role is the most heavily utilized FSMO role so you should make sure that the domain controller that holds this role has sufficiently beefy hardware to handle the load. Similarly, if the PDC Emulator role fails then it can potentially cause the most problems, so the hardware it runs on should be fault tolerant and reliable. Finally, every domain has its own PDC Emulator role, so if you have N domains in your forest then you will have N domain controllers with the PDC Emulator role as well.

RID Master – This is another domain-specific FSMO role, that is, every domain in your forest has exactly one domain controller holding the RID Master role. The purpose of this role is to replenish the pool of unused relative IDs (RIDs) for the domain and prevent this pool from becoming exhausted. RIDs are used up whenever you create a new security principle (user or computer account) because the SID for the new security principle is constructed by combining the domain SID with a unique RID taken from the pool. So if you run out of RIDS, you won’t be able to create any new user or computer accounts, and to prevent this from happening the RID Master monitors the RID pool and generates new RIDs to replenish it when it falls beneath a certain level.

Infrastructure Master – This is another domain-specific role and its purpose is to ensure that cross-domain object references are correctly handled. For example, if you add a user from one domain to a security group from a different domain, the Infrastructure Master makes sure this is done properly. As you can guess however, if your Active Directory deployment has only a single domain, then the Infrastructure Master role does no work at all, and even in a multi-domain environment it is rarely used except when complex user administration tasks are performed, so the machine holding this role doesn’t need to have much horsepower at all.

Schema Master – While the first three FSMO roles described above are domain-specific, the Schema Master role and the one following are forest-specific and are found only in the forest root domain (the first domain you create when you create a new forest). This means there is one and only one Schema Master in a forest, and the purpose of this role is to replicate schema changes to all other domain controllers in the forest. Since the schema of Active Directory is rarely changed however, the Schema Master role will rarely do any work. Typical scenarios where this role is used would be when you deploy Exchange Server onto your network, or when you upgrade domain controllers from Windows 2000 to Windows Server 2003, as these situations both involve making changes to the Active Directory schema.

Domain Naming Master – The other forest-specific FSMO role is the Domain Naming Master, and this role resides too in the forest root domain. The Domain Naming Master role processes all changes to the namespace, for example adding the child domain vancouver.mycompany.com to the forest root domain mycompany.com requires that this role be available, so you can’t add a new child domain or new domain tree, check to make sure this role is running properly.
To summarize then, the Schema Master and Domain Naming Master roles are found only in the forest root domain, while the remaining roles are found in each domain of your forest. Now let’s look at best practices for assigning these roles to different domain controllers in your forest or domain.

To summarize these three rules then and make them easy to remember:

Forest root domain – Schema Master and Domain Naming Master on the same machine, which should also host the Global Catalog.
Every domain – PDC Emulator and RID Master on the same machine, which should have beefy hardware to handle the load.
Every domain – Never place the Infrastructure Master on a machine that hosts the Global Catalog, unless your forest has only one domain or unless every domain controller in your forest hosts the Global Catalog.

“`*“`arun
Port numbers used in ADS

PORT NUMBERS USED IN ACTIVE DIRECTORY SERVICES-

53 TCP Enable DNS TCP 53
53 UDP Enable DNS UDP 53
88 TCP Enable Kerberos TCP 88 (AD)
88 UDP Enable Kerberos UDP 88 (AD)
123 UDP Enable NTP UDP 123 (AD)
135 TCP Enable RPC TCP 135
135 UDP Enable RPC UDP 135
137 UDP Enable NetBIOS Name Service
138 UDP Enable NetBIOS Datagram Service
139 TCP Enable NetBIOS Session Service
389 TCP Enable LDAP TCP 389 (AD)
389 UDP Enable LDAP UDP 389 (AD)
445 TCP Enable SMB over TCP
464 TCP Enable K Password TCP 464 (AD)
543 TCP Enable K Login TCP 543 (AD)
544 TCP Enable K Shell TCP 544 (AD)
1025 TCP Enable MSRPC TCP 1025 (AD)
1026 TCP Enable 1026 TCP (AD)
3268 TCP Enable Global Catalog TCP 3268 (AD)
3268 UDP Enable Global Catalog UDP 3268 (AD)
53211 TCP Enable AD Replication TCP 53211 (AD)
53212 TCP Enable File Replication Service TCP

“`*“`arun
ADS overview

Basic Questions about ADS 2003.

What is active directory?

Active Directory is the directory service included in the Windows Server 2003 family. Active Directory includes the directory, which stores information about network resources, as well as all the services that make the information available and useful. Active Directory is also the directory service included in Windows 2000.

Active directory database-

NTDS.Dit located in C:\Windows\ntds\

.Dit – Directory Information Tree.

Active Directory Schema-

The Active Directory schema defines objects that can be stored in Active Directory. The schema is a list of definitions that determines the kinds of objects and the types of information about those objects that can be stored in Active Directory. Because the schema definitions themselves are stored as objects, they can be administered in the same manner as the rest of the objects in Active Directory. Normally called schema object or metadata .

Structure of Active Directory-

1)Physical structure -  Sites, Domain Controllers
2)Logical structures – Forest, Tree, Domain, OU

Domain functional levels in Active directory 2003?

1)Mixed mode
2)Native mode
3)Interim mode

What is Global catalog and GC server?

The global catalog is the central repository of information about objects in a tree or forest. By default, a global catalog is created automatically on the initial domain controller in the first domain in the forest. A domain controller that holds a copy of the global catalog is called a global catalog server.

Functions of GC-

A)It enables a user to log on to a network by providing universal group membership information to a domain controller when a logon process is initiated.
B)It enables finding directory information regardless of which domain in the forest actually contains the data.

Active directory database engine name?

ESE (Extensible Storage Engine)

Partitions available in AD-

i)Schema partition
ii) Configuration Partition
iii) Domain Partition
iv)Application Partition

Types of replications-

Inter-site(Site to site) and Intra-site(With in site) replications.

About KCC-

KCC is called Knowledge Consistency Checker. The KCC is a built-in process that runs on all domain controllers. The KCC configures connection objects between domain controllers. Within a site, each KCC generates its own connections. For replication between sites, a single KCC per site generates all connections between sites.

The 2 trust protocols 2003 using -

Kerberos V5 and NTLM

Types of Trust relations available in 2003-

Tree-Root , Parent- Child , Shortcut, Realm, Forest trust , External trust

What is the hierarchy of applying Gpo(Group Policy Object) in 2003?

It is applied from parent level to child level in AD.

i) Local GPO
ii) GPOs linked to sites
iii) GPOs linked to domains
iv) GPOs linked to OUs

Protocols used on replication-

RPC over IP (Used for synchronies transfer), SMTP over IP (Asynchronies transfer)

What is the default time delay on replication?

Intra site – 15 min ( KCC automatically create the topology for Replication)
Inter-site – 1 hrs.
Security related changes replicated immediately across sites.

What Different tables available in NTDS database?

i)Schema table
ii)Link Table
iii)Data table
iv)Configuration Table

Where is the FRS logs stored in and what is the database engine name?

C:\Windows\ntfrs\jet\log ,The engine used is jet database engine. Ntfrs.jdb.

What is tombstone object in AD? What is it’s life time?

Any objects deleted from Active directory will not removed from Database immediately. That object is called tombstone object. The default life time for that object is 60 days.For win 2k3 SP1 180 days

What are the FSMO roles in AD and what are the functionalities of those roles?

Every Active Directory forest must have the following roles:
1) Schema master 2) Domain naming master

These roles must be unique in the forest. This means that throughout the entire forest there can be only one schema master and one domain naming master.

Schema Master Role
The domain controller assigned the schema master role controls all updates and modifications to the schema. To update the schema of a forest, you must have access to the schema master. At any time, there can be only one schema master in the entire forest.

Domain Naming Master Role
The domain controller holding the domain naming master role controls the addition or removal of domains in the forest. There can be only one domain naming master in the entire forest at any time. Domain-Wide Operations Master Roles Every domain in the forest must have the following roles:

3)Relative identifier (RID), or relative ID, master
4) Primary domain controller (PDC) emulator
5) Infrastructure master

These roles must be unique in each domain. This means that each domain in the forest can have only one RID master, PDC emulator master, and infrastructure master.

RID Master Role
The domain controller assigned the RID master role allocates sequences of relative IDs to each of the various domain controllers in its domain. At any time, there can be only one domain controller acting as the RID master in each domain in the forest. Whenever a domain controller creates a user, group, or computer object, it assigns the object a unique security ID. The security ID consists of a domain security ID (that is the same for all security IDs created in the domain) and a relative ID that is unique for each security ID created in the domain. To move an object between domains (using Movetree.exe: Active Directory Object Manager), you must initiate the move on the domain controller acting as the RID master of the domain that currently contains the object.PDC Emulator

Note: For all Active directory administration, troubleshooting and Changes; please refer this link-

http://www.microsoft.com/technet/prodtechnol/windows2000serv/technologies/activedirectory/maintain/opsguide/part2/adogdapb.mspx

“`*“`arun
Category: ADS  Tags:  One Comment
Advantages of Windows 2003

Advantages of Windows 2003

1. Domains can be renamed or moved to a different level in an AD tree.

2. Schema attributes can be deleted as well as added.

3. Any Domain Controller can cache the Global Catalog thus preventing user logon problems if no Global Catalog server is available.

4. AD Replication can be set not to use compression.

5. Cross-Forest Transitive Trusts can be created.

6. Many administrative tools allow drag-and-drop and there are more configuration and management wizards.

7. Most services are disabled by default in 2003 instead of enabled as in Windows 2000.2003
allows partial synchronizations of the Global Catalog 2000 had always to have full synchronizations.

8. Support for IPv6. Ping and Tracert have extra IPv6 options.

9. Supports XML web services.

10. A new service called Volume Shadow Copy takes periodic snapshots of a hard drive making it easier to take backups and recover deleted files. Users can even be allowed to recover previous versions of files by themselves by using the Previous Versions client.

11. A Global Catalog server can be built from backup media instead of by replication.

12. IPSec Nat Traversal – NAT-T – allows IPSec VPN clients and servers to pass through NAT firewalls. This is likely to lead to the wider adoption of L2TP VPNs.

13. Distributed File System DFS has had significant improvements made to it. For example DFS replicas can now be prestaged to avoid excessive initial file replication.

14. Multiple DFS Roots per server can be created (Enterprise and Datacenter editions only).

15. Print queue redundancy can be achieved by storing them on multiple servers.

16. Active Directory Migration Tool v.2.0 can now migrate users, computers, groups and passwords from an NT domain and can also perform the cross-forest migration of objects.

17. Terminal Server allows clients to map their local drives and printers

18. The FTP server allows different default directories to be assigned to different users.

19. There’s a Security Configuration and Analysis tool to check a server’s security settingsDNS AD-integrated zones are stored in the Application Partition of a forest so aren’t replicated to domain controllers which aren’t DNS servers.

20. Regedit.exe and Regedt32.exe have been amalgamated into a single utility which takes the best features of each. Both files still exist but run the same utility.

21. The DNS server has added flexibility with the new options of stub zones and conditional forwarding.

22. Internet Information Server 6 (IIS 6) has the ability to keep worker processes from different websites and web applications separate so that if one application crashes then other websites running on the same server remain unaffected.

“`*“`arun
IIS SMTP not available in IIS Snap-in

IIS SMTP not available in IIS Snap-in-

Please make sure IIS SMTP is installed in the server. If you find it’s installed but not visible in IIS Snap-in can be fixed by registering the dll using this code-

regsvr32 C:\Windows\System32\inetsrv\smtpsnap.dll

or

regsrv32 %systemroot%\system32\inetsrv\smtpsnap.dll

Once done IIS SMTP virtual server node will be listed in IIS Snap-in.

“`*“`arun
Find the exact version of your MSSQL server

Many people are not sure of how to find the exact version of their MSSQL server. Here’s the query to be run on SQL Query Analyzer or SQL Server Management Studio thro’ new query-

Find out the version of SQL Server 6.5 -

SELECT @@VERSION

Find out the version of SQL Server 7.0 -

SELECT @@VERSION

Find out the version of SQL Server 2000 -

SELECT  SERVERPROPERTY(‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’)

Find out the version of SQL Server 2005 -

SELECT  SERVERPROPERTY(‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’)

Find out the version of SQL Server 2008 -

SELECT SERVERPROPERTY(‘productversion’), SERVERPROPERTY (‘productlevel’), SERVERPROPERTY (‘edition’)

“`*“`arun
Enable Full trust mode for ASP.NET sites

To enable Full trust mode for ASP.NET sites please follow these steps-

Locate web.config file at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG
or
%systemroot%\Microsoft.NET\Framework\v2.0.50727\CONFIG

Add the following entries at the top of the page before the entry ‘<location allowOverride=”false”>’ (Without quotes)-

<location path=”your website name here” allowOverride=”true”>
<system.web>
<trust level=”Full” originUrl=”.*”/>
</system.web>
</location>

Finally restart IIS.

***Note: Please take a copy of web.config before making the above changes***

Crystal Reports – Error in File UNKNOWN.RPT

Problem description-
Server Error in ‘/virtual directory name’ Application.
Error in File UNKNOWN.RPT:
The request could not be submitted for background processing.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Error in File UNKNOWN.RPT: The request could not be submitted for background processing.

Solution-

This is most likely a permission error in C drive. To fix this please follow these steps-

Open My Computer > Right click ‘C’ drive then properties > Security tab > Click Advanced > in ‘Permissions tab’ click ‘Add’ > Add ‘Network Service’ > in the ‘Apply onto’ drop down list make sure ‘This folder only’ is selected and no other should be selected > Make ‘Read Attributes’ and ‘Read Permissions’ are checked > Click Ok > Also make sure ‘Replace permission entries on all child objects’ is NOT checked.

***Note: If you incorrectly set to anything other than ‘This folder only’ in  ‘Apply onto’ dropdown list will result in severe permission issues and all of your sites will prompt for authentication so handle withe extra care.***

Change terminal service/RDP port

To change Terminal Service/RDP port please follow these steps-

*****You are about to make changes in server’s registry so any incorrect changes will result in severe problem*****

1. Open registry editor by running this command in run – regedit
2. Locate for HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
3. Locate the ‘PortNumber’ subkey and find the value of d3d (in hexadecimal), change the ‘Base’ radio button to ‘Decimal’ and modify the port no. from 3389 to new one.

Note: If your server is behind hardware/software firewall please make sure to add this port in allow list so that you can establish connection from outside.

Category: Windows 2003  Tags:  Leave a Comment
Remote IIS Management in Windows Server 2008

Remote IIS Management feature is available in DNP. Not many control panels have implemented this. Even it’s possible in IIS 6. Here’s the steps for IIS 7-

Note: Resellers should enable this feature in their client hosting plans.

1. Login to DNP,  click web > websites

2. Click your website you wish to enable for IIS Remote management tool.

3. Click the last tab “Management”

4. Create a Username and password, and then click ‘Enable’.

Note: when the page reloads, make sure it now shows that ‘Management’ is now enabled.

5. Using Windows Vista or Windows 7 or Windows 2008, Open IIS 7 by going to-

Control Panel > Administrative Tools > Internet Information Services

Note: You can install IIS if not installed from add/remove windows features from program & features.

6. Once IIS is loaded click ‘Connect to a site’ under IIS > Start Page > ‘Connection tasks’ section.

7. Specify the server name, for site name, enter your full domain name without www > Next > specify user name and password.

8. Here it will ask you to enter a friendly name, this is the name of the website on your local IIS machine > Click Finish.

Display detailed errors in IIS 7 – Windows 2008

In Windows server 2008, displaying detailed error is disabled by default. To enable this please follow this steps-

1. Open web.config file located under domain root (possibly under wwwroot if helm/DNP, httpdocs if plesk).
2. Look for the lines (esp at last)-
</handlers>
</system.webServer>
</configuration>

after  </handlers>  press enter and add the following line

<httpErrors errorMode=”Detailed”/>

After adding should look like-

</handlers>
<httpErrors errorMode=”Detailed”/>
</system.webServer>
</configuration>
Save the file and now you will be able to see the detailed error.

Install Ioncube loaders for php windows

To install Ioncube loaders for php windows please follow these steps-

# Download Ioncube loaders available at

http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_win_x86.zip

http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_win_x86_ipf.zip

# Place the dll files in C:\PHP5\Ioncube or C:\PHP\Ioncube (for php4) or to any location where php is installed
# Open php.ini under C:\PHP5 or C:\PHP and add the following entry after ‘;Windows Extensions’ section-

zend_extension_ts =”C:\PHP5\ioncube\ioncube_loader_win_5.x.dll” for php5
zend_extension_ts =”C:\PHP5\ioncube\ioncube_loader_win_4.x.dll” for php4

Prevent synattack in Windows server 2003

To prevent synattack in Windows server 2003 please follow this-

Save the following in synattackprotect.reg and double click it to merge-

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
“EnableTCPChimney”=dword:00000000
“SynAttackProtect”=dword:00000002
“TcpMaxHalfOpen”=dword:00000064
“TcpMaxHalfOpenRetried”=dword:00000050
“TcpMaxPortsExhausted”=dword:00000005
“TcpMaxConnectResponseRetransmissions”=dword:00000003

Php application popup in the server

To fix the application popup-

Warning : Unknown(): Unable to load dynamic library ‘C:\Program Files\SWsoft\Plesk\Additional\Php\extensions\php_curl.dll’ – The specified module could not be found

Make sure libeay32.dll and ssleay32.dll exist in the Windows system32 folder. These 2 files can be found in a folder called dll in the PHP folder.

Enable IIS HTTP conditional GET and HTTP compression

To enable HTTP compression and Conditional GET please follow these steps-

1. You need to open Metabase.xml from the location – C:\Windows\System32\inetsrv

******Please take much care in handling this since you are doing this in Metabase file. Any incorrect actions can lead to severe problems. Do it at your own risk******

**Before doing this please make sure your IIS Metabase is directly editable without stopping IIS. If this option is not enabled you can enable it in IIS > properties of server name > under ‘Internet Information Services’ tab > check ‘Enable Direct Metabase Edit’ check box > hit Ok. Otherwise you will have to stop IIS then open Metabase.xml to proceed further. Either things will work according to your convenience**

And look for the following parameters-

<IIsCompressionScheme Location =”/LM/W3SVC/Filters/Compression/deflate”
HcCompressionDll=”%windir%\system32\inetsrv\gzip.dll”
HcCreateFlags=”0″
HcDoDynamicCompression=”TRUE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”FALSE”
HcDynamicCompressionLevel=”0″
HcFileExtensions=”htm
html
txt”
HcOnDemandCompLevel=”10″
HcPriority=”1″
HcScriptFileExtensions=”asp
dll
exe”
>
</IIsCompressionScheme>
<IIsCompressionScheme Location =”/LM/W3SVC/Filters/Compression/gzip”
HcCompressionDll=”%windir%\system32\inetsrv\gzip.dll”
HcCreateFlags=”1″
HcDoDynamicCompression=”TRUE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”TRUE”
HcDynamicCompressionLevel=”0″
HcFileExtensions=”htm
html
txt”
HcOnDemandCompLevel=”10″
HcPriority=”1″
HcScriptFileExtensions=”asp
dll
exe”
>
</IIsCompressionScheme>
<IIsCompressionSchemes Location =”/LM/W3SVC/Filters/Compression/Parameters”
HcCacheControlHeader=”max-age=86400″
HcCompressionBufferSize=”8192″
HcCompressionDirectory=”%windir%\IIS Temporary Compressed Files”
HcDoDiskSpaceLimiting=”FALSE”
HcDoDynamicCompression=”FALSE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”FALSE”
HcExpiresHeader=”Wed, 01 Jan 1997 12:00:00 GMT”
HcFilesDeletedPerDiskFree=”256″
HcIoBufferSize=”8192″
HcMaxDiskSpaceUsage=”100000000″
HcMaxQueueLength=”1000″
HcMinFileSizeForComp=”1″
HcNoCompressionForHttp10=”TRUE”
HcNoCompressionForProxies=”TRUE”
HcNoCompressionForRange=”FALSE”
HcSendCacheHeaders=”FALSE”
>
</IIsCompressionSchemes>

Change the above to the following-

<IIsCompressionScheme Location =”/LM/W3SVC/Filters/Compression/deflate”
HcCompressionDll=”%windir%\system32\inetsrv\gzip.dll”
HcCreateFlags=”0″
HcDoDynamicCompression=”TRUE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”TRUE”
HcDynamicCompressionLevel=”10″
HcFileExtensions=”htm
xml
css
rdf
js
html
txt”
HcOnDemandCompLevel=”10″
HcPriority=”1″
HcScriptFileExtensions=”asp
php
cgi
dll
aspx
asmx
exe”
>
</IIsCompressionScheme>
<IIsCompressionScheme Location =”/LM/W3SVC/Filters/Compression/gzip”
HcCompressionDll=”%windir%\system32\inetsrv\gzip.dll”
HcCreateFlags=”1″
HcDoDynamicCompression=”TRUE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”TRUE”
HcDynamicCompressionLevel=”10″
HcFileExtensions=”htm
html
xml
css
rdf
js
txt”
HcOnDemandCompLevel=”10″
HcPriority=”1″
HcScriptFileExtensions=”asp
php
cgi
aspx
asmx
dll
exe”
>
</IIsCompressionScheme>
<IIsCompressionSchemes Location =”/LM/W3SVC/Filters/Compression/Parameters”
HcCacheControlHeader=”max-age=86400″
HcCompressionBufferSize=”8192″
HcCompressionDirectory=”%windir%\IIS Temporary Compressed Files”
HcDoDiskSpaceLimiting=”TRUE”
HcDoDynamicCompression=”FALSE”
HcDoOnDemandCompression=”TRUE”
HcDoStaticCompression=”FALSE”
HcExpiresHeader=”Wed, 01 Jan 1997 12:00:00 GMT”
HcFilesDeletedPerDiskFree=”256″
HcIoBufferSize=”8192″
HcMaxDiskSpaceUsage=”100000000″
HcMaxQueueLength=”1000″
HcMinFileSizeForComp=”1″
HcNoCompressionForHttp10=”FALSE”
HcNoCompressionForProxies=”FALSE”
HcNoCompressionForRange=”FALSE”
HcSendCacheHeaders=”FALSE”
>
</IIsCompressionSchemes>

Once the changes are done please save the metabase file.

2. Now goto command prompt and to the following location and type-

C:\Inetpub\AdminScripts>
adsutil set w3svc/filters/compression/parameters/HcDoSta
ticCompression false
HcDoStaticCompression : (BOOLEAN) False

C:\Inetpub\AdminScripts>adsutil set w3svc/filters/compression/parameters/HcDoDyn
amicCompression false
HcDoDynamicCompression : (BOOLEAN) False

C:\Inetpub\AdminScripts>adsutil set w3svc/1234/root/DoStaticCompression true
DoStaticCompression : (BOOLEAN) True

C:\Inetpub\AdminScripts>adsutil set w3svc/1234/root/DoDynamicCompression true
DoDynamicCompression : (BOOLEAN) True

Note: The value ’1234′ is website’s identifier. You can note this in IIS Manager > locate the website > note the identifier or you can find it in site’s logfile folder name for ex- w3svc1234

3. Finally restart IIS.

Coldfusion error: Hebrew characters failed to display properly – UTF8

Problem description-

Setup MySQL database and CF DSN but the Hebrew characters fail to display properly – UTF8.

Temporary work around-

Recreate the DSN and set the driver type from MySQL 3 to MySQL 4/5
Note: This solves only for characters already stored in the DB – if I update the text using coldfusion – then ? Marks appear instead

Permanent solution-

Please include this code in your script-

<cfscript>
setEncoding(“URL”, “UTF-8″);
setEncoding(“Form”, “UTF-8″);
</cfscript>

At the top of form loading script.

In CFAdmin, under the connection string field specify these piece of entry-

useUnicode=true&characterEncoding=UTF-8

Coldfusion – Can’t connect to Access db

Problem description-

When creating Datasource with MS Access or MS Access Unicode driver seleceted produces this error even though there is valid Access database file-

Connection verification failed for data source: DSN name
java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][SequeLink Server]The specified data source is not defined.
The root cause was that: java.sql.SQLException: [Macromedia][SequeLink JDBC Driver][SequeLink Server]The specified data source is not defined.

Solution-

Chose “other” as the driver type and entered the following:

JDBC URL:
jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=[Full path to your database file];DriverID22;

Driver Class:
sun.jdbc.odbc.JdbcOdbcDriver

Drive Name:
MS Access via JDBC

Diagnosing Windows server 2003 performance problems

Microsoft has released the Windows Server 2003 ‘Server Performance Advisor’ tool designed to help troubleshoot Windows 2003 performance problems. Neither Windows XP nor Windows 2000 platforms support this tool. The tool is available here: http://www.microsoft.com/downloads/details.aspx?familyid=61a41d78-e4aa-47b9-901b-cf85da075a73&displaylang=en

Once downloaded please run the msi file and follow the instructions and these steps-

1. Click Next to go to the “Welcome to the Server Performance Advisor Setup Wizard” introduction screen.
2. Click “I accept” on the license page, then click Next.
3. Accept the default installation location and select whether the tool will be used by just the person installing the tool or by all administrators, as the figure shows. Click Next.
4. The wizard prompts you for a location for the temporary storage of performance log files. Accept the default C:\perflogs\data location and click Next.
5. The wizard prompts you for a reports folder location. Again, accept the default location (C:\perfLogs) and click Next. Click Next to begin the installation. When the installation is finished, click Finish.
7. You’ll now have a new Start menu item, Server Performance Advisor, which you can use to start the advisor process.