Working with the IIS console. Windows Server. Configuring the IIS web server The application worked through the web server iis

What if we needed to deploy a website on a computer or virtual machine running Windows OS? Of course, you can use third-party software products such as:

  • Apache is a popular web server with a huge number of functions, it was originally written for Linux, on this moment There is an edition for Windows.
  • Endels - New web server for local testing, for web development.
  • Denwer - Development package, web server with PHP 5.3.13, MySQL 5.1, PostgreSQL 8.4 etc.

You can simply download them from the Internet, then each has its own configuration. But what should we do if our PC does not have access to the Internet and we need to deploy a simple website in html without any problems. You can use the built-in IIS in Windows 7 .

In this article we will look at the process of installing IIS on Windows 7 and launching a regular website.

Go to Start\Control Panel


After that, click on the button on the left turn Windows features on or off". We tick the IIS services box and then you can select necessary components. You can select everything and then, depending on the situation, you can delete unnecessary ones.

We are waiting for the installation to complete.

After this, we check that our site opens. Type in the browser line http://localhost(I remind you that localhost is the address of the local machine, it corresponds to IP 127.0.0.1 and was created for testing)

To access the site management console, you need to go to Start Control Panel\Administrative Tools\IIS Manager

Here you can set the settings as you wish. Default IIS uses the directory " C:\inetpub\wwwroot» for hosting a standard website. Through the Internet Information Services Manager, you can create a new site or use an existing one by replacing the files in the folder with your own.

View the dedicated section

Hello. Let's install ISS. First of all, let’s find out what IIS is?

IIS (Internet Information Services, up to version 5.1 - Internet Information Server) is a proprietary set of servers for several Internet services from Microsoft. IIS is distributed with operating systems Windows family N.T.

The main component of IIS is the web server, which allows you to host websites on the Internet. IIS supports HTTP, HTTPS, FTP, POP3, SMTP, NNTP protocols.

Great. Now we know what we will bet. Let's get started.

Installation

First of all, go to the main menu “Start” (Start) further

Control Panel -> Programs -> Turn Windows features on or off.

Find "IIS Services" in the list and select the required components

  • Safety. All components except “Certificate Matching Authentication...”.
  • Application development components. PHP requires a CGI component.
  • Common HTTP Features. We tick all the boxes.
  • Functional testing and diagnostics. Select "HTTP Logging" and "Request Monitor".
  • Performance enhancement functions. We tick all the boxes.
  • Website management tools. We only mark "IIS Management Console».

Personally, I deviated a little from this description and added FTP, since for my needs I will need to test working with FTP.

After the necessary items have been selected, click “Ok” and all that remains is to wait until the components we need are installed. after which you can reboot the machine. this will not prevent her from starting all the required services.

All. We can say that our ISS Server is installed. Let's move on to its initial configuration.

Configuration

Go to computer management (right-click on the "Computer" icon -> Manage), then "Services and Applications" -> "IIS Service Manager" or happy owners of Windows 7 can go to another "Start" and in the "Search programs and files" enter "IIS" and the treasured "IIS Service Manager" will appear in the list

Let's go to the sites. I deleted the default site immediately, deciding that I didn’t need it and for clarity, I would create a new one.

Right click on "sites" -> "Add web site"

and create our first website

Please note that "localhost" was not chosen randomly. Since this directive is the “default” one, it has a local address of 127.0.0.1 and a name written in the hosts file lcalhost. I advise you to read more on Wikipedia

IT support

Setting up 1C web publication, connecting cash register equipment

1. Setting up a web server in IIS

Install the Internet Information Server web server, which is included by default Microsoft Windows Server. When installing, be sure to select the components:

  • Common HTTP Features
    • Static Content
    • Default Document
    • Directory Browsing
    • HTTP Errors(HTTP Errors)
  • Application Development
    • ASP.NET 3.5
    • .NET Extensibility 3.5
    • ISAPI Extensions
    • ISAPI Filters
  • Health and Diagnostics
    • HTTP Logging
    • Request Monitor
  • Management Tools
    • IIS Management Console

2. Database publications in 1C

On the same server where the IIS web server is deployed, we install 1C:Enterprise (32-bit components), making sure to select the components during installation:

  • 1C:Enterprise
  • Web server extension modules

If you plan to configure a 64-bit web server extension module, then you must additionally run the 64-bit server installation program from the corresponding 1C:Enterprise package and install the component:

  • Web server extension module


Now you need to set the necessary rights to the key folders used when using web access to 1C:Enterprise databases. For the storage directory for website files published on the web server (by default: C:\inetpub\wwwroot\), you must give full rights to the group "Users"(Users). In principle, you can skip this step, but then to publish or change the publication of the database you will need to run 1C:Enterprise as an administrator. To configure the security of this directory, right-click on it and select from the context menu "Properties"(Properties).

In the properties window that opens, go to the tab "Safety"(Security) and press the button "Change"(Edit...), to change existing permissions. The permissions window for this directory will appear. In the list of Groups or user names, select the “Users” group and in the list of permissions for the selected group, set the flag "Full access"(Full control). Then click "Apply"(Apply) to record changes and close all windows using the button "OK".


Next, you need to give full rights to the directory with installed files"1C:Enterprise" (default: C:\Program Files (x86)\1cv8\ for 32-bit expansion module and C:\Program Files\1cv8\ for 64-bit) group IIS_IUSRS. To do this, we perform actions similar to those described above, with the only difference that in order for the required group to appear in the list "Groups or users"(Groups or user names), you must click the button located below the list "Add"(Add..), and in the window for selecting groups or users, click "Additionally"(Advanced...).


Then click the button on the right "Search"(Find Now), then select the required group IIS_IUSRS in the search results table and click "OK".


Finally, if publishing to a file base, you must also give the group IIS_IUSRS full rights to the directory containing the files of this infobase.


Let's move on to directly publishing the database on the web server. To do this, launch “1C:Enterprise” in the mode Configurator for the database you want to publish. Then select from the menu “Administration” - “Publishing on a web server...”


The window for setting up publishing properties on the web server will open. The main fields required for publication are already filled in by default:

  • Virtual directory name - the name by which the database on the web server will be accessed. Can only consist of characters of the Latin alphabet.
  • Web server - selected from the list found on current computer web servers. In our case, this is Internet Information Services.
  • Directory - the physical location of the directory in which the virtual application files will be located.
  • Using the corresponding flags, you can specify the types of clients to publish, as well as indicate the possibility of publishing Web services. In the table below, you can edit the list of Web services that will be published, and also in the “Address” column change the synonym by which this Web service will be accessed.
  • It is also possible for the IIS web server to indicate the need to perform authentication on the web server using OS means by setting the appropriate flag.

Having selected the necessary publishing settings, click "Publish".


If the publication went through without errors, we will see a corresponding message.

2.3 Connecting to a published infobase via a web browser


To this information base You can also connect from any computer on the network by accessing the web server via its internal connection (or if you connect port 80- by external) IP address.

3. Create a free Let’s Encrypt SSL certificate on IIS

Having an SSL certificate for a website allows you to protect user data transmitted over the network from attacks man-in-the-middle and guarantee the integrity of the transmitted data.

Let's Encrypt is a non-profit certification authority that allows automatic mode Issue free SSL/TLS certificates via API. Only domain validation certificates are issued with a validity period of 90 days, which is not a problem due to the built-in ability to automatically reissue the certificate, resulting in continuity of protection.

The following describes how to obtain an SSL certificate from Let’s Encrypt using the console utility LetsEncrypt-Win-Simple. It is a simple wizard that allows you to select one of the sites running on IIS and automatically issue and bind an SSL certificate to it.

3.1 Creating an SSL certificate

Download the latest client release from the project page on GitHub https://github.com/PKISharp/win-acme/releases

Let's unpack it into a directory on the server with IIS: c:\inetpub\letsencrypt


An interactive wizard will launch, which will first ask you to indicate your e-mail to which notifications about problems with certificate renewal will be sent, and to agree to the user agreement.


Then you will need to select that you need to create a new certificate ( N: Create new certificate) and select the type of certificate (in our example there is no need to use a certificate with multiple SANs), so just select the item 1. Single binding of an IIS site.


The next step is to perform domain validation. Several validation options are available: TLS, via DNS entry or via HTTP). The easiest option is to select the item 4 Create temporary application in IIS (recommended). In this case, a small application will be created on the web server through which Let’s Encrypt servers can perform validation.


Note. When performing a TLS/HTTP check, your site must be accessible from the outside using its full DNS name using the HTTP (80/TCP) and HTTPS (443/TCP) protocols.

After validation, the utility letsencrypt-win-simple will automatically send a request to generate a certificate, download it (all necessary files, as well as the private key, are saved in the C:\Users\User\AppData\Roaming\letsencrypt-win-simple directory) and create a binding on the IIS website. If an SSL certificate is already installed on the site, it will be replaced with a new one. It will also create a rule in Windows Task Scheduler that runs every day and automatically issues and installs a new certificate every 60 days.

3.2 Creating a separate pool and website with a connected SSL certificate.

Create a separate pool in IIS for letsencrypt



Add the site to the new pool. We indicate the port 443 (or another one to which we will later forward to port 443).

Specify the new certificate in “SSL Certificates”:


Set up a link to our site:



Let's check.


4. Connecting cash register equipment. Forwarding COM ports over TCP/IP using Virtual Serial Ports Emulator (VSPE).

4.1 Setting up VSPE on the server

Launch the VSPE program. Click on the “Create a new device” button.


Then you need to create virtual ports (each cash register has its own port). It is better to set the port numbers lower to avoid problems.

In the window that opens, select from the drop-down menu TcpServer. Press the button "Further".


Set the local TCP port number to listen on. Select the COM port to which the equipment is connected via an interface converter. Click the button "Settings".

Installing and Configuring IIS

In most cases, in real production projects, one or more servers will be used to serve client requests for a website. These servers may be owned and operated by you, a dedicated team, or a third-party hosting company. In any case, sooner or later there comes a time when the coding and testing is completed, and the work must be presented to the general public - this is the deployment of the website.

In this and future articles, we'll look at different deployment options. However, in all cases the basic premises remain the same. On workstation There is a ready-made website that needs to be deployed on the server so that it is available to clients. For ASP.NET such a server is IIS (Internet Information Services - Internet information services), And his current version- IIS 8. When it was first implemented, IIS was a basic web server. Over the years, IIS has evolved into a sophisticated application server that provides a wide variety of functionality, the most important of which is support for hosting ASP.NET applications.

This article focuses on IIS 8. Although the machine running IIS 8 is referred to here as a server, IIS can be run on both workstation and server versions of Windows. Not all are available on workstations, but most are functionality, allowing you to host complex websites. We recommend using Windows Server whenever possible, but Windows 7 or Windows 8 are inexpensive alternatives.

Microsoft ties IIS releases to Windows releases. Included with Windows Server 2008 and Windows Vista includes version IIS 7.0, Windows Server 2008 R2 and Windows 7 - version IIS 7.5, and Windows Server 2012 and Windows 8 - IIS 8. Versions 7.0 and 7.5 are collectively called IIS 7 by Microsoft, which can be confusing. The version of IIS supported by the operating system cannot be changed - Windows Server 2008 will only use IIS 7.0. For example, you cannot upgrade to IIS 7.5, which is used in Windows Server 2008 R2.

Installing IIS

The IIS component is included as part of Windows installations(for both the server and workstations) and requires activation and configuration. The following are three ways to activate IIS for different operating systems.

Installing IIS on desktop versions of Windows (Windows Vista, Windows 7 and Windows 8)

Each version operating system Windows offers its own version of IIS - IIS 8 (in Windows 8), IIS 7.5 (in Windows 7) or IIS 7 (in Windows Vista). In all of these versions of Windows, IIS is enabled but not installed initially. To install it, you must follow these steps:

Installing IIS on Windows Server 2008

Installing and configuring IIS is the same for Windows Server 2008 and Windows Server 2008 R2. The necessary steps are described below:

    Start Server Manager. To do this, click the Start button and select All Programs --> Administrative Tools --> Server Manager.

    Select the Roles node in the tree on the left.

    Execute necessary actions in the master. You will probably be asked to install additional required roles - if so, you should simply accept the operations and continue.

    After installation, you will be prompted to configure your web server. As with desktop versions of Windows, you can select specific IIS 7 features to be enabled.

    If you are working in ASP.NET with version .NET Framework 4.5, then this version of .NET Framework will need to be installed (.NET Framework Developer Center)

Installing IIS on Windows Server 2012

The IIS installation process in Windows Server 2012 is essentially the same as in Windows Server 2008. The main difference is that user interface somewhat different. Detailed description you can find it by following the link Installing IIS 8 on Windows Server 2012.

IIS Management

When you install IIS, it automatically creates a directory called C:\inetpub\wwwroot that represents your website. All files in this directory will appear as if they were in the root directory of your web server.

To add additional pages to your web server, you can copy the HTML, ASP, or ASP.NET files directly to the C:\Inetpub\wwwroot directory. For example, if you add the file TestFile.html to this directory, you can request it in the browser through the URL http://localhost/TestFile.html. You can even create subfolders to group related resources. For example, you can access C:\inetpub\wwwroot\MySite\MyFile.html through a browser using the URL http://localhost/MySite/MyFile.html.

The wwwroot directory is convenient for launching simple examples and static pages. To use ASP.NET properly, you must make your own virtual directory for each web application you create. For example, you can create a folder with any name on any drive on your computer and place it in the IIS virtual directory as if it were located in the C:\inetpub\wwwroot directory.

Before you get started, you need to start IIS Service Manager. It can be found in the Start menu. The exact location may depend on the type of Windows versions(IIS --> IIS Service Manager). The program shortcut will be located in the Programs or Administrative Tools section. home page IIS Manager is shown in the figure below:

Now you need to become familiar with a number of terms used in IIS. An entry with the name of the server you are using appears on the left side of the IIS Manager window. Our server has the name PROFESSORWEB, generated by the Windows 8 default, which will be used in most examples. The central area displays a view of the server. This view displays a set of icons that allow you to configure server settings. On the right side of the screen there is a list of available actions. For example, in this view you can start, stop, and restart the server.

If you expand the server item in the tree view on the left side of the screen, you will see the Sites item, which contains a single Default Web Site entry. A site is a collection of files and directories that make up a website. IIS can support multiple sites on a single server, typically on different TCP/IP ports (the default is port 80). The combination of the server name and the site port forms the first part of the URL. For example, when using mywebserver with a site connected to port 80, the URL looks like this:

http://mywebserver:80

Each site can contain many files and directories. Each of them forms part of the URL. Yes, the URL static page mypage.html, located in the myfiles directory, will be as follows:

http://mywebserver:80/myfiles/mypage.html

In some situations, the name by which the server is known to you and the name that clients use to receive content will be different. We'll leave this aside, but the server administrator or hosting company will provide the necessary information if it's important for a particular server.

To check the health of IIS, select Default Web Site and in the right pane of the IIS service manager, select "Run". After that, click the "Browse *.80 (http)" button to open the site page in the browser:

As you can see, in my case I changed the default port (from 80 to 8080). I did this because... on 80 I have a local Apache server running. If you have the same problem, you can change the port by right-clicking on the site (Default Web Site) and selecting “Edit Bindings” from the context menu. You can then change the default port in the dialog box.

So, each server can support multiple sites, each running on a different port or IP address. Each site can have many files and directories, and the combination of these elements provides information about the URL. We'll return to URLs and using IIS Manager as we look at each deployment approach.

Usually, when people talk about a web server, they mean solutions based on the Linux platform. But if your infrastructure is deployed on Windows based Server then it would be logical to use the IIS web server. Contrary to popular belief, this is a very popular platform that allows you to work with most popular CMS, and has a wide range of systems designed to work specifically on Windows and IIS.

The undoubted advantage of IIS is its close integration with other Microsoft technologies and development tools. In particular, web solutions for IIS can leverage the rich capabilities of .NET and easily interoperate with desktop applications on that platform. If you are not interested in this yet, then a wide selection of ready-made CMSs are at your service, including those written specifically for IIS. Today we will look at how to install and configure IIS to work with ASP.NET-based web solutions and install one of the popular CMS for this platform.

To install a web server on Windows platform let's go to the equipment Roles V Server Manager and select install roles Web server (IIS) And Applications server.

But don’t rush to click Next, on the left, under the name of each role, the option is available Role Services, go to it and set the following options for the Application Server: Web server support (IIS), General access to TCP ports and Activation via HTTP.

And for the web server, install the FTP server service.

Then install the selected roles. To check the functionality of IIS, enter the IP address of your server in your browser, you should see a standard web server stub page.

Now let's move on to setting up the server, for this we will open Internet Information Services Manager(located in Start - Administration).

First of all, let's create a new site, to do this, right-click on the item Websites in the IIS Manager side menu and select Create a new site.

In the window that opens, specify the name of the site, the path to the root folder (by default, user sites are located in C:\inetpub\wwwroot), which should be previously created and specify the node name ( Domain name site), in our case iissite.local

Don't forget to add an A record with the name of your site to the DNS server or write the necessary lines in hosts files those workstations from which you will access the site

In principle, you can already place web pages in the site folder and access them through a browser, but for full-fledged work FTP access to the site will not interfere with it. To do this, right-click on your site name in the side menu and select Add FTP publication

Next, specify the binding of the FTP service to network interfaces and ports, and also configure security settings. If you're going to use SSL, keep in mind that you'll need a certificate, although if you'll be using FTP access only for your own needs, you can get by with a self-signed certificate. Don't forget to check the box to automatically launch the FTP site.

On the next page, specify the server access parameters; we recommend specifying specific users who will work with this site.

The web server is configured and you can use it to host HTML pages, however, modern sites use a DBMS to store their data, so the next step is to install MS SQL Express 2012, the capabilities of which are more than enough for our tasks. Installation is performed with default values, except Authentication Mode, which should be switched to Mixed mode and set a password for the SQL server superuser sa.

Now let's try to install any popular CMS created on the basis of ASP.NET technology; a wide selection of such solutions is presented in the Microsoft web application gallery. Please note that by clicking the download button you will receive a package for installation via Web PI; to install on IIS you will need to go to the developer’s website and download full package with CMS

We will install Orchard CMS, to get the package follow the link and select Download as zip, unpack the resulting archive and upload the contents of the Orchard folder to the root of the site.

This CMS is based on ASP.NET 4, so we will configure our site to use the necessary technologies. To do this, right-click on the site name in the side menu and select Website Management - Advanced Options

In the window that opens, change the parameter Application Pool, indicating there ASP.NET v.4

Then set the necessary rights to the site folder, you need to add the IIS_IUSRS user the ability to write and change the contents of this folder.

Also, do not forget to create a database for the site, to do this, go to SQL Server Management Studio and by right-clicking on the item Database in the side menu, create a new database.