IIS 7.5 and IIS 8.0 European Hosting

BLOG about IIS 7.5 Hosting, IIS 8.0 Hosting and Its Technology - Dedicated to European Windows Hosting Customer

IIS Hosting Europe - HostForLIFE :: Access Website Hosted In IIS On Windows 10 From Any PC On LAN

clock October 21, 2022 08:07 by author Peter

In this article, we will learn about Access Website Hosted In IIS On Windows 10 From Any PC On LAN


Prerequisites

    Windows 10 PC with IIS installed. (In this example IIS version is 10 )
    Basic knowledge of website hosting on IIS.

Create a website in IIS
 
Open run (windows key + R) and type inetmgr and press enter or in Cortana Search type IIS.

IIS Manager opens.
Then right click on Sites and click on Add Website. The Add website dialog opens.

    Fill in required details and select folder where compiled code is located. Eg: C:\Nigel\Publish
    Select required port , default is 80. I will be using 7500.
    Do not enter host name details if you are testing or using on LAN.

Then click ok. A website gets created and it will show under Sites.
 

Now right click on website name then Manage website and then click browse.


The link should be in the form on http://localhost:7500/  if you used port 7500 and selected http.
Locate your IP Address

Now open command prompt. Type cmd in run.


Type ipconfig and press enter. Now locate your PC's IP address on the LAN.


Now in your website link replace localhost with 192.168.0.24 (IP address) so your URL will be - http://192.168.0.24:7500/
Try it in your browser to make sure it works.
 
Change Firewall Rules
In Cortana search type firewall then click on Windows firewall with advanced security.


The firewall window opens.


Click on Inbound rules on the left. Then click new Rule in the right side menu.

The New inbound rule wizard will open. What type of rule would you like to create? Select Port and click Next.

In Does this rule apply to TCP or UDP? Select TCP. Then enter port number (7500) in specific local ports textbox. Then click Next >.

Then the Action form opens. Select Allow the connection and click Next .


Then the profile form opens. In the When does this rule apply? - Select required ones , if not sure then select all. Click Next.

Give this Firewall rule a Name and Description, so you know for what purpose you created this. Then click finish.


Now if you share the link we created earlier with someone else on your LAN it should open your website.
Link example: http://192.168.0.24:7500/
 
Note
    Be careful when changing Firewall setting otherwise you may leave your PC vulnerable to online attacks.
    Only use ports in non standard range (preferably after 9000).
    Once you are done using the website you can delete the Firewall rule.

Summary
In this article, we learned about Access Website Hosted In IIS On Windows 10 From Any PC On LAN.



IIS Hosting Europe - HostForLIFE :: Configure IIS to host your website without Asp.net

clock October 14, 2022 10:44 by author Peter

This article describes how to set up IIS on your PC then host your web site without

Visual Studio Installed.
If you want, in a Client's machine if you don't install Visual Studio but want to host your website in it then you can do this. It can be very usefull for you.

Step 1 : Install IIS on Your Server Machine
Go with this way .

Start -> Control Panel -> Add Remove Programs -> Add/Removes Windows Components.
Then click on Window Component Wizard Internet Information Service (IIS)

Click the Checkbox for Internet Information Service (IIS) then click the next button and select browse to XP Installation CD for Required Files.
 
Then install the .Net Framework.

Step 2 : Install .Net Framework on Your Server Machine.
After IIS installation, install the .Net Framework; which one depends on what you used to develop your web site.


Step 3: After Installation Set Your Web Site For hosting

After IIS installation, on the C drive the Inetpub folder is created.

Copy and paste your web site folder into the wwwroot folder.

Inetpub -> wwwroot -> yourwebsitefolder

Step 4: After pasting your folder is set on the default web site.

Right-click on My Computer then click the manage option.

Manage -> Computer management (Local) -> Internet Information Service -> Website -> Default Web Site.

On right-click default Web Site Click New -> Virtual Directory.

On Virtual Directory Creation Wizard click next then set Alias Name.
After write alias name click next and browse your directory on wwwroot folder website . . then set all Access Permission Checked.
Read...Write...Browse

After finishing check the .Net Framework version; on right-click for your web site properties on the ASP.NET tab. If the version is not selected then choose it ASP.Net Version and set it. Then browse to your web site.

And in the client machine that you want to run the web site in, give the URL with server IP address.

http://192.168.192.1/Onlineshoping/Index.aspx

Enjoy Your Web Project.

Conclusion:
I am try do something helpful.



IIS Hosting Europe - HostForLIFE :: How To Deploy React Application On IIS Server?

clock August 31, 2022 09:31 by author Peter

Today, I am going to show you how to deploy the React App to the IIS server, so let's grab a cup of coffee and start coding.

 
What is IIS?
IIS stands for "Internet Information Services", which is a web server provided by Microsoft to host the websites and other stuff on the web.
 
How to enable IIS?
If you have already enabled IIS then you can skip this step. But if you have not enabled it already then follow the below steps:
    Open Control Panel and then click on the "Programs and Features".
    Click on "Turn Windows features on or off".
    Select Internet Information Services and click on the OK button.
    To see whether or not IIS is enabled, press Windows + R key and type inetmgr and click on OK.
    IIS Manager is open.

Create a Simple React App
Open a command prompt or your favorite terminal and type the below command to create a react app.
    npx create-react-app my-react-app  

 After successfully creating the app go to the new app.
    cd my-react-app  

To see how it look likes type the below command.
    npm start  

and it will start the development server and navigate you to http://localhost:3000/
 
You can see the default landing page:

To host an app in any web server we first need to create a production build. To create a production build of our react app use the below command.

    npm run build  

The output of the above command creates a new build folder inside the project which contains production build. So far we have created a React app & created a production build of that app. Now the next step is to deploy it on IIS. Press Windows + R key and write inetmgr to open the IIS Manager. You can see the below screen.

 
First, we will create a new Application Pool, so right-click on Application Pools and click on Add Application Pool. Then give it a name as you want and click on OK button.
 
After that right-click on the new app pool and select Advanced Settings. You will see the below window.


Then click on Identity and choose a Custom account and click on the set button and then add your windows credentials and click on OK.
 
After that right-click on Sites and then click on Add Website. Add the Site name and select application pool which we created earlier. After that under the physical path section, you have to give the path of build folder & also give the port number where you want to host.

Now right click on new website i.e ReactApp -> Manage Website -> Browse. Your react app is now successfully deployed.


Now the next step is to add routing in our react application. So I have created 2 components and also added react-router-dom package for routing. Here we are not going into detail about react routing.
 
Home page

Blog page

 

Create a production build again and try to browse the application which we hosted on IIS. You will see the application is working fine but now try to refresh the page and see what happens. You will get the below error.

So to fix this issue you have to install URL Rewrite module. After successful installation, you have to create a web.config file under public folder of app and copy-paste the below content into it.
<?xml version="1.0"?>  
<configuration>  
<system.webServer>  
    <rewrite>  
        <rules>  
            <rule name="React Routes" stopProcessing="true">  
                <match url=".*" />  
                <conditions logicalGrouping="MatchAll">  
                    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />  
                    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />  
                    <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />  
                </conditions>  
                <action type="Rewrite" url="/" />  
            </rule>  
        </rules>  
    </rewrite>  
</system.webServer>  
</configuration>     


Again build the application in production mode and browse. So now if you refresh the app you will not get an error and will be able to see the correct page. That's it -- so you have successfully created and deployed React application into the IIS server.

Conclusion

I hope that you have enjoyed this article, and please do not hesitate to send me your thoughts or comments about what could I have done better.



IIS Hosting Europe - HostForLIFE :: Publish And Host ASP.NET Core Web API On IIS

clock August 16, 2022 08:46 by author Peter

In this article you are going to learn about how to publish and host an ASP .Net Core Web API project on IIS.

Tools
    Visual Studio
    .Net Core SDK (Any Compatible Version)
    IIS Manager

Continuing from my previous article I’m going to use my project which I created already. There are several ways to do this but we will discuss the simplest way to do this. Just follow the steps as defined below.
 
Steps
First download .Net Core SDK compatible with your API version, I’m using .NET Core 2.1 so I downloaded it from here.
After downloading the SDK, open it and install it on your PC.

After installation create a new folder in C:\inetpub\wwwroot directory with the name “publish” as shown in figure below.

Right click the project and select Publish.

Visual Studio gives a default path, you can publish your API there but I am using another way to do this. So, click on browse.

Select the folder (publish) you created before and click Open.


After this the target location for publish project files will be changed, then simply click Publish.


It will take some time to publish. After the files are published, Open IIS Manager.

Now open IIS Manager.

Expand your connection and right click on Sites folder to add Website.


Give the site name and the Select the application Pool to DeaultAppPool.

Give a physical path of your folder where you published the API project.


Give the Port number 8085 or any you want and then click OK.

Right click on your new added site and Manage Site and click Browse, it will automatically open your hosted website in the browser.


Now give the URL http://localhost:8085/Values/GetStatus, this is the actual path of your Controller action and after writing just press enter. You will see the following results.


You can test other actions also by giving their URL as in given example above.
 
Conclusion
This article provides a brief introduction of publishing .NET Core Web API project and hosting it on IIS. Hope you find it useful and helpful for your work or studies.



IIS Hosting Europe - HostForLIFE :: Hosting ASP.NET Web API REST Service On IIS 10

clock August 5, 2022 07:35 by author Peter

To make any application accessible to the end-user, we need to host it on a server. So, in this article, we will learn how to host ASP.NET Web API REST Service in IIS 10. The following steps are required to host any application.

Step 1 Install IIS
Before hosting any application, make sure that IIS (Internet Information Services) is installed on your Hosting Server. If it is not installed or enabled, then follow the below steps.
    Click on Windows icon at the bottom left corner and find the "Control Panel" menu and click on it.
    In the "Control Panel", find the "Program and Features" option from the displayed list.
    This shows the list of installed programs. Find and click the "Turn Windows feature on or off" option from the left pane, as shown in the following image.

    Now, in the next popup, find Internet Information Services (IIS) and check on it.
    Click "Next" button and then "Finish". It takes a few minutes to install IIS.
    After installing IIS, restart your machine.

Note - I have Windows 10 OS and the above process is for Windows 10 PC. The steps might differ depending on your Operating System version.
 
Step 2 Install .NET Framework
 
Although Visual Studio is not required on your hosting Server, it must have .NET Framework installed, as per the .NET framework used to develop the application. If it is not installed, then please install the appropriate .NET Framework available on Microsoft official website.
 
I assume, you have installed the .NET framework on your Hosting Server.
 
Step 3 Move the published code on Hosting Server
 
Copy the "Published files" and paste those on respective Servers where you want to host the Web API REST Service. In our last article, we published Web API REST Service in the E drive of my Server, as shown in the following image .
 

Step 4 Open IIS Manager
Now, open the IIS Manager from Windows menu or in any other ways you have known.


The above image is of IIS 10 Manager of my Windows 10 machine. The view as well as options might be different on your machine depending on the OS version.

Step 5 Add Website
Right click on "Site" in IIS and click on add new website, as shown in the following screenshot.
 

 

After clicking on "Add Website" option, it displays the following configuration window.


I hope you understood the preceding configuration by highlighted text.
 
Step 6 Define Site Name & Application Pool
Define the site name which will be useful to uniquely identify the site within the IIS Server. After specifying the site name, choose the Application Pool from available pools. You can even create a custom application pool with any desired name. Currently, our IIS Manager has the following Application Pools.


Choose the application pool depending on your application configuration. In this article, we are going to choose DefaultAppPool.

Step 7 Browse and select Published Folder path
Now, choose the physical location of published code files by clicking on "Browse" button, as shown in the following image.


Now, click on "OK" button.
 
Step 8 Define IP address & Port
 
Choose one IP address from the list of available IP addresses and define the unique port number for the application, which will be unique within the defined IP address.

Step 9 Choose Protocol & Host name (optional )
 
Choose the protocol for your application i.e HTTP or HTTPS which requires port 443 to be open and choose the Host name which will be used publicly to access the application. After defining all the configurations, the web site configuration window will look like this.


Now, click on OK button. It will create and add the application in IIS.


Step 10 Browse the URL with REST Client
 
Browse the hosted application using REST client with base URL along with API, Controller name, and Action method name, with pattern defined in routing template inside the webapiconfig.cs file.
 
We can browse applications using the browser but then, we can only test the GET method. So, to test all types of Action Methods, we are using  advanced REST client which is a developer extension tool in Firefox browser.
 
Our hosted Web API REST Service includes these two methods, as given below.

    GetAllEmployees (GET )
    GetEmployeeById  (POST ) which takes id as input parameter

Browse GetAllEmployees method using Advanced REST client which has used HTTP GET verb.

The GetAllEmployees hosted Web API REST method is returning all the employee lists.
 
Now, browse GetEmployeeById method using Advanced REST client which uses HTTP POST verb and takes id as input parameter.


From the above desired output, it's clear that our Web API REST Service is hosted on IIS successfully.

Note
    Download the Zip file of the Published code to learn and start quickly.
    This article is just guideline to show how to host Web API REST Service on IIS .
    Optimize the speed by setting debug as false etc., from web.config file as per your skills.
    In this article, the optimization is not covered in depth.
    Configure the authentication in IIS as per your REST Service .

Summary

I hope, this article is useful for all readers. If you have any suggestions, please mention them in the comments section.



IIS Hosting Europe - HostForLIFE :: Host And Publish .NET Core 6 Web API Application On IIS Server

clock July 4, 2022 09:35 by author Peter

We are going to discuss how to host and publish .NET Core 6 Web API on IIS Server


Basically, Internet Information Service (IIS) is the flexible and general-purpose web server provided by Microsoft that will be run on Windows and used to serve requested files.

Required Tools

    IIS Manager
    .NET Core SDK 6
    Visual Studio 2022

Let’s start,

Step 1
Create a new .NET Core Web API Project

Step 2
Configure your new project


Step 3
Provide additional information like .NET Framework Version, Open API, and HTTPS


Step 4
Project Structure


Step 5
Create the Product Controller and add one endpoint inside that class and also check other files which are created by default

using Microsoft.AspNetCore.Mvc;
namespace WebAPI.Controllers {
    [Route("api/[controller]")]
    [ApiController]
    public class ProductsController: ControllerBase {
        [HttpGet]
        [Route("list")]
        public IDictionary < int, string > Get() {
            IDictionary < int, string > list = new Dictionary < int, string > ();
            list.Add(1, "IPhone");
            list.Add(2, "Laptop");
            list.Add(3, "Samsung TV");
            return list;
        }
    }
}

Program.cs file
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment() || app.Environment.IsProduction()) {
    app.UseSwagger();
    app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();


Here also you can see we configure the HTTP request pipeline for both Development and Production Environment.

WebAPI.csproj file
<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
  </ItemGroup>
</Project>


launchSetting.json file
{
  "$schema": "https://json.schemastore.org/launchsettings.json",
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:11254",
      "sslPort": 44315
    }
  },
  "profiles": {
    "WebAPI": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "launchUrl": "swagger",
      "applicationUrl": "https://localhost:7047;http://localhost:5047",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "launchUrl": "swagger",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}


Step 6
Run your application and use hit the API endpoint using swagger UI


Step 7
Check your all IIS Services are running on your system properly or not. If not then open the control panel and go to the program and features and click on Turn Windows Feature on or off


 

Apply the changes as I showed you in the above image and click on apply and then restart your computer

Step 8
After restarting your computer will see IIS Manager in the search box and open it.

Now, check your running IIS using localhost in the browser


Step 9
Install ASP.NET Core 6.9 Runtime – Windows Hosting Bundle Installer

Step 10
Now, we are going to publish our application for that, right-click on WebAPI Project and click on publish


As you see it will take the default path, so change that path to c:\inetpub\wwwroot\publish after creating publish folder over there


Step 11
Here you can see all the configurations related to publishing like path and some environmental variables and later on click on publish


Step 12
Open IIS Manager and create a new Web Application after right click on the sites


Step 13
Click on Web API and on the right side you can see the browse option so click on that and open the application inside the browser

Step 14
In the browser when you hit the Web API endpoint using Swagger then will see the following list of products as an output


In this article, we discussed .NET Core 6 Web API hosting and publish related things using IIS and things related to that step-by-step. I hope you understand all things.
Happy Coding!



IIS Hosting Europe - HostForLIFE :: Deploy ASP.NET Core API application In IIS

clock March 29, 2022 09:04 by author Peter

ASP.NET Core is a cross platform and open source framework which is used to build  modern web apps, API services and many more. In this article we are going to see how to deploy the ASP.NET Core API application in IIS.

 
Tooling

    Visual Studio 2019
    IIS
    POSTMAN

Creating an application
 
Open Visual Studio 2019 -> Click on create new project from the start up screen.

Click on ASP.NET Core Web application template -> give the project name, in my case I named it as AspCoreHosting -> click on create.
Choose API template, as shown in below figure.

Now run the application from visual studio and test the API in POSTMAN as shown in the below figure.

Deploy the application to IIS
Let’s create a package of the application, right click on the project and select publish, as shown in the below figure.


Choose IIS, FTP, etc option from publish target list and choose the publish method as file system, and click on save.

Open IIS, right click on application pools -> Add app pool -> Choose the .NET CLR Version as No Manager Code and name the app pool. in my case I named it as .NET Core V2.2 with pipeline mode as Integrated.


Note
Creating a new application pool for .NET Core is optional
 
Right click on sites -> Add site ->Give the Site name -> select the Application pool as .NET Core V2.2 -> choose the package path -> and give a port number as shown in the below figure.


Run the web site



Oops we got a configuration error. The problem is, to run the .NET Core application in IIS we need to install “dot net core windows hosting bundle”. Just download and install it using the below link.

 

Once it is installed, test the API using POSTMAN tool


Yes, now the application is up and running in IIS
We have seen how to deploy the ASP.NET Core API application in IIS by installing the dot net core windows hosting bundle.



IIS Hosting Europe - HostForLIFE :: Error Occurred in Deployment Step Recycle IIS Application Pool

clock March 25, 2022 09:01 by author Peter

This article describes what to do about a specific error that could occurr in the deployment step of recycling an IIS application pool.

Steps
An error has occurred in the deployment step of "Recycle IIS Application Pool': The communication object, System.ServiceModel.InstanceContext, cannot be used for communication because it has been Aborted.

Simple way to let the Deploy occur
1. Click "Start" -> "Run...".

2. Type "iisreset" as in the following:


3. Wait untill IIS stops then starts again as in the following:

4. Right-click on your SharePoint project then click "Deploy" as in the following:


5. Deploy will now succeed.

6. If you are still seeing "Error occurred in deployment step 'Recycle IIS Application Pool'" then please restart your SharePoint Server Front Web application.



IIS Hosting Europe - HostForLIFE :: Configure And Host On IIS For .Net Core/.Net 5+ Web Application In Windows 10

clock March 14, 2022 07:38 by author Peter

What is ISS?
Internet Information Services (IIS) is web server from Microsoft that runs on Windows systems to serve requested HTML pages or files.

Enable ISS
By default, ISS is disabled in windows, so to use it, first needs to be enabled. To enable and use IIS, Administrator Rights are required.

For .net core application hosting we need to install net core host bundle. Click here for the download link.

After the installation we need to enable IIS by following the next steps:

  • Open Control Panel
  • Select Programs and features
  • Select Turn Windows features on or off

Select Internet Information Services and Hostable Web core. Press ok. It will take some minutes to load everything.


After ISS is enabled, go to search bar in windows and type IIS, and open Internet Information Services Manager
That’s it, you have successfully enabled ISS on your machine.

Publish
An application to run on ISS needs to be published. Publishing in visual Studio for IIS is very easy by using the following steps:

  • Right click on your project
  • Select Publish
  • Select Folder option. With this you will select where the application will be published

Select the path

Press Finish

  • Press publish button
  • Done, your application is not published on the desired path


Host application
In order to host an application on ISS, a website and an application pool needs to be created.

Create Website

  • From left area Select Sites
  • Right click -> Add Website
  • Configure the Site
  • Site name: your desired site name

            Physical Path: the location of the folder for the published location
            Biding, select your IP address, this will be your site address
            Change port from 80 to something else, example 90

  • Press ok

Application pool

  1. From left area Select Application Pools
  2. Select Default application pool
  3. On the Right select Basic Settings
  4. At .NET CLR version select no managed code (specific for .net core applications)
  5. Press ok

Now you have a hosted application in IIS.



IIS Hosting Europe - HostForLIFE :: How to Restart a Remote Server Using Command Prompt

clock October 21, 2021 08:39 by author Peter

Sometimes the servers are remotely located and doesn’t respond, so you need to restart them. We can restart the remote server forcefully, but the user should be a server administrator or a member of the server administration to be able to Launch the command prompt (as an administrator) and run the below command. The user should have administrator permissions on the server.

Command: c:\windows\system32\shutdown /r /f /t 0 /m \\<Server Name> /c “<Description>”

/r Shutdown and restart the computer.
/f Force running applications to close without forewarning users.
/t xxx Set the time-out period before shutdown to xxx seconds.
The valid range is 0-600, with a default of 30.
/m \\computer Specify the target computer.
/c "comment" Comment on the reason for the restart or shutdown.


Once again, you enter the above command and you will get a message that the system shutdown processing



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in