Understanding the WebsitePanel Framework
This article includes additional information targeted for developers, for the non-developer version please go here. WebsitePanel is a distributed web-based application. It consists of three components:
- WSP Portal
- WSP Enterprise Server
- WSP Server
All three components are web applications that must be hosted using either IIS version 6 or greater.
WSP Portal is the user interface (presentation layer) part of WebsitePanel. It is ASP.NET application that does not contain any business logic. Instead, it communicates with WSP Enterprise Server using SOAP in order to perform various operations. The presentation layer contains all UI elements. User gestures such as button clicks invoke web service methods in the WSP Enterprise Server.
The WSP Portal web application is accessible to external consumers. It works within an IIS application pool that is associated with an account that has limited privileges.
Portal communicates to Enterprise Server by mean of proxy classes located in “WebsitePanel.EnterpriseServer.Client” project. This project is part of Enterprise Server solution. When you implement a new or update existing .asmx web service for Enterprise Server you could generate/update its proxy using wsewsdl.exe utility which is part of WSE 3.0 distribution. After proxy is generated you should run WseClean.exe over it to remove data types declarations. You can use generate_es_proxies.bat file in the root of solution’s “Sources” folder in order to do this.
Each call to Enterprise Server web service must be authenticated. WSP uses “UsernamePassword” authentication mechanism which is part of WSE 3.0. When user is signed in on WSP Portal their username/password is stored in encrypted cookie. On every call to Enterprise Server the value of this cookie is used to create UsernamePassword token and add it to WSE pipeline.
WSP Enterprise Server
WSP Enterprise Server is the primary WSP component that comprises the business logic of the application. WSP Enterprise Server uses a SQL Server database to store its internal data, including user accounts, hosting plans, information about hosted resources, and service settings.
Every operation in WebsitePanel is available as an XML web service that can be accessed from any programming environment, including the .NET Framework, PHP, Java, and Perl. Because of this, WebsitePanel web services can be used for integration by third-party applications.
To manage the hosting environment (such as creating web sites, FTP and mail accounts, databases, etc.), WSP Enterprise Server communicates with WSP Server using XML web services.
WSP Enterprise Server does not expose any UI, just web services. Typically is available only to computers in your hosting environment; the application listens only for internal IP addresses or the internal loopback address 127.0.0.1. WSP Enterprise Server runs in an application pool that is associated with an account that has limited privileges.
Enterprise Server communicates to Server agents by mean of proxy classes located in “WebsitePanel.Server.Client” project. WSE is used to authenticate and encrypt traffic between Enterprise Server and Server agent. Server agent password is stored in its web.config as a SHA1 hash. For username the ID of Server is used; any username could be used only the password gets validated.
WSP Server is web application that performs low-level management operations on the target server(s), such as working with files and folder and their permissions, email, databases, IIS, etc.
WSP Server can be considered a remote server agent and must be installed on every server in the hosting environment that should be managed in the WSP control panel. WSP Server runs in an application pool that has administrative privileges — that is, its application pool’s identity must be a member of the local Administrators group or of the Domain Admins group if AD must be managed as well.
Communication between WebSitePanel Components
All communications between WebSitePanel components are implemented using plain ASP.NET web services + Web Service Enhancements 3.0 (WSE 3.0) library to support WS-Security stack.
For more information on WSE 3.0 please visit this site:
Example Flow of a WebSitePanel Process (Create a new Website)
In order to understand better the flow between the modules, here is an example of what happens when a user clicks the “Create a new website” button in WebsitePanel Portal.
- User clicks “Create new website” button in WebsitePanel Portal
- Portal instantiates a new proxy using Websitepanel.EnterpriseServer.Client class for Enterprise Server esWebServer.asmx web service
- Portal calls the method responsible for creating a new website using the proxy class above
- Enterprise Server receives this request and calls the method in its WebServerController Class
- Enterprise Server creates a proxy class for for WindowsServer.asmx using WebsitePanel.Server.Client class and calls the method to create a folder for the site
- Server agent receives a request and creates the new folder on the target server
- Enterprise Server creates a proxy class for WebServer.asmx web service and calls the method to create a new site
- Server agent receives a request amd creates the new site on the target server
- Enterprise Server sends a response to the Portal for Success or Failure of the operation and displays the status to the end user
Common Deployment Scenarios
The following diagrams illustrate typical setups for configuring WebSitePanel.