Thursday, 28 May 2015

Host asp.net application on the web server (IIS)



How to host asp.net application on the web server (IIS)

In this article, I am going to show how to host an asp.net application on IIS 7 (I have shown this example on Windows 7 Home Premium OS), however similar steps can be followed to host the application on the Windows Server 2008 R2 as well.
Introduction
In general hosting part of the application is not done by developer however in some scenario where the team size is small or we need to host the application on the local server, we developer does all the work. In this article, I am going to show how to host an asp.net application on IIS 7.5 in Windows 7 Home Premium Operating System.
Step 1
Open the IIS either from the Start Menu by writing the "inetmgr" command in the search box or at the command window (you must have the administrative privilege).


You can also achieve the same by going to Control Panel and clicking on Administrative Tools > Internet Information Services (IIS) Manager as displayed in the picture below.

If you are not able to see the Internet Information Service (IIS) Manager, your computer might not have IIS installed. To install the IIS, follow below steps.
Installing IIS on Windows 7
Go to Control Panel > Programs > Turn Windows Features on or off as displayed in the picture below.

Ensure that from the Tree View, the Check boxes against the Internet Information Services (IIS) is checked, even explore the depth of this root folder and check almost all check boxes as displayed in the picture below. Checking almost all checkboxes will install more than enough (extra components as well that is not required for web hosting) component to get started and you may not use all the components. However later on you can uncheck to un-install those.
Step 2
Once you have opened the Internet Information Service (IIS) Manager, your screen should look like below (displayed the left panel in the below picture).


Now, right click the Sites and select Add Web Site ... and your screen should look like below

Enter the Site Name (in my case its SampleWebSite), select the physical folder where you have kept your website files (this may be your Visual Studio solution folder if you are setting it up at your local machine or the unpackaged folder path or the root folder of the website or web application). Now you can click on the OK button.

Clicking OK button may give you above alert box, complaining about the port you are going to use as by default port 80 is used for the default website of your IIS so you might want to change it. Click on No button at above alert box and change the port. I have changed the port to 8123 as displayed below and clicked on OK button.

Clicking OK should give you a screen something similar to below picture where you will have a SampleWebSite created (notice at the left panel).

Step 3
Now, you may click on the Advance Settings ... from the right panel and modify some settings that you want to modify. In general it is not needed and you can keep it default.

Step 4
Now, your website is ready to be browsed, you can right click on the website name (SampleWebSite in my case) and go to Manage Web Site > Browse and you should have an Internet Explorer window open displaying the default page of your website or web application.

Below is the screenshot of the default page of my SampleWebSite.

Step 5 (Optional)
Notice: Your website may not work if you have developed your it Visual Studio 2010 as your web.config file may have some tags that is not identified by the IIS. This is becuase creating the website the way we created just now will host your website in its own application pool that will have .NET Framework version 2 as target version. So you will need to change to the .NET Framework 4.0 version.

Click on Application Pools from the left panel and double click the Application pool for your webiste (generally application pool for your website is your website name so in my case SampleWebSite) and you should see a dialogue box similar to above. Select .NET Framework v4.xxx from the .NET Framework version dropdown and click OK. Now follow the Step 4 above again and your should see the default page.

IIS 7 SSL Certificate CSR Creation and renewal



IIS 7 SSL Certificate CSR Creation

IIS 7 SSL Certificate CSR Creation
Easy IIS 7 SSL Certificate Renewal
For a very simple way of renewing your certificate for IIS 7
How to Generate an SSL Certificate Renewal CSR in Microsoft IIS 7
  1. Open the IIS Manager by going to Start > Administrative Tools > Internet Information Services (IIS) Manager.
  2. Under Connections click your server's Host name.
  3. In the center window pane, scroll down to and Double-Click the Server Certificates icon.  
  1. On the right window pane under Actions click the link to Create Certificate Request...
  1. Enter the following information in the "Distinguished Name Properties" and click Next:

    Common Name - Typically the domain (e.g. www.yourdomain.com) computers will connect to this server with.
    Organization -    Your organizations or company's legally registered name (e.g. Your Company, LLC; Your Company, Inc.)
    Organizational unit - Your organization's department name (If you don't know what to put just enter 'IT').
    City/locality -     The city/municipality where your organization is located.
    State/province - The state where your organization is located.
    Country/region - Your country's 
  1. Choose Microsoft RSA SChannel and 2048 and then click Next

  1. Save your CSR file to a location. Then open this file in in Wordpad, hit (Ctrl+A) and (Ctrl+V) to select all and copy the contents to the clipboard.

  2. Under the "My Orders" tab, click + to expand the options for order you would like to renew, then click the Renew link.

SSL Certificate Renewal Installation in Microsoft IIS 7
Installation Instructions to Renew your Windows 2008 Server SSL Certificate
  1. Save your certificate file to the IIS server that the CSR request was generated from.
  2. Open the IIS Manager and on the left side click on your server's name, and in the center window pane scroll down to Server Certificates and open it.
  1. Now under Actions pane click to Complete Certificate Request...
  1. Click ... to browse to the .CER certificate file xyz sent you, and give the certificate a Friendly Name to help you refer to this certificate by in the future and click Ok.

    Note: You may receive the following error messages when installing the certificates:
    "Cannot find the certificate request associated with this certificate file. A certificate request must be completed on the computer where it was created." "ASN1 bad tag value met".

    If you created the CSR (AKA pending request) for the certificate you are installing you can ignore this error, close the dialog box and hit the "F5" key to update the list of available installed certificates.
    If you can see your certificte with the friendly name you just assigned, click to go to the next step.

  1. Under the Connections window pane, expand your server's computer name, then click the Site that you want to enable SSL on.
  2. In the Actions menu click Bindings... then select the binding for https and click 'Edit'.
  1. In the 'SSL certificate:' drop-down menu select your newly-installed SSL Certificate by its friendly name, and click Ok.
https://www.digicert.com/images/support-images/iis7/iis7-install-6.gif
Your new SSL Certificate should now be installed to your server.
Test Your Installation

Thursday, 21 May 2015

Resetting Administrator Password in Windows server 2012



The whole process is remarkably easy and quite quick.




Instructions

To reset the password on your Windows 2012 server, simply complete the following steps:
  • Boot from the Microsoft Windows Server 2012 DVD
  • From the Windows Setup menu, click “Next”.
  • Select “Repair your computer”
  • Under Choose and option, click on “Troubleshoot”.
  • Under Advanced options, click “Command Prompt”.
  • At the command prompt, run the following commands:
    d:
    cd windows\system32
    ren Utilman.exe Utilman.exe.old
    copy cmd.exe Utilman.exe
  • Close the command prompt and then click “Continue”.
  • The server should now boot and present the logon screen. Here click Windows Key + U.
  • At the prompt you can now change the password, by typing the following command:
    net user administrator Password123
    This will set the password for the Administrator user to be Password123 (case sensitive).
Closing the command prompt, you should now be able to log back onto the server using the password you have provided in the last step.


Cleanup Steps
Once you have verified you can log on to the server you will have repeat the steps above and boot using the Windows Server 2008 DVD/ISO and run the command prompt again.
  • Restart your server and once again, boot from the Microsoft Windows Server 2012 DVD
  • From the Windows Setup menu, click “Next”.
  • Select “Repair your computer”
  • Under Choose and option, click on “Troubleshoot”.
  • Under Advanced options, click “Command Prompt”.
  • At the command prompt, run the following commands:
    d:
    cd windows\system32
    ren utilman.exe utilman.exe.new
    copy utilman.exe.old utilman.exe
  • Close the command prompt and then click “Continue”.
  • The server should now boot and present the logon screen. Here click Windows Key + U.
  • At the prompt you can now change the password, by typing the following command:
    net user administrator Password123
    This will set the password for the Administrator user to be Password123 (case sensitive).
Closing the command prompt, you should now be able to log back onto the server using the password you have provided in the last step.
Cleanup Steps
Once you have verified you can log on to the server you will have repeat the steps above and boot using the Windows Server 2008 DVD/ISO and run the command prompt again.
  • Restart your server and once again, boot from the Microsoft Windows Server 2012 DVD
  • From the Windows Setup menu, click “Next”.
  • Select “Repair your computer”
  • Under Choose and option, click on “Troubleshoot”.
  • Under Advanced options, click “Command Prompt”.
  • At the command prompt, run the following commands:
    d:
    cd windows\system32
    ren utilman.exe utilman.exe.new
    copy utilman.exe.old utilman.exe
  • Close the command prompt and then click “Continue”
  •  

Here are the some screen shorts.  








 

     

What is Cloud Computing?

Cloud computing is the on-demand delivery of compute power, database storage, applications, and other IT resources through a cloud se...