Http Server Virtual Host



If you're looking for a web host that's more reliable than a shared host, but not as pricey as a dedicated host, a virtual private server (VPS) might be what you need. In our testing, these top. Set up virtual hosts on your IBM® HTTP Server for i instance using the IBM Web Administration for i interface. Virtual hosts allow more than one Web site on one system or Web server. The servers are differentiated by their host name. Visitors to the Web site are routed by host name or IP address to the correct virtual host. In Apache (httpd) virtual hosts are used to host web content for multiple domains off of the same server depending on the IP address or domain name that is being used. Depending on the request received different virtual host configuration can apply, resulting in different settings and web content being served from a single web server.

Set up virtual hosts on your IBM® HTTP Server for i instance using the IBM Web Administration for i interface. Virtual hosts allow more than one Web site on one system or Web server. The servers are differentiated by their host name. Visitors to the Web site are routed by host name or IP address to the correct virtual host. Using Virtualhost and modproxy together. The following example allows a front-end machine to proxy a virtual host through to a server running on another machine. In the example, a virtual host of the same name is configured on a machine at 192.168.111.2.

-->

by Robert McMurray

Introduction to the Windows Web Platform

The Microsoft Web Platform gives you the framework, web server, database and tools your customers need to build and run Web sites and applications on Windows. It provides a complete ecosystem of products, technologies, partners, and customers. You will be able to easily setup your servers with <link:WebPI>, test your environment using the same experience your users will have with <link:WebMatrix>, promote your offerings through the <link: Hosting Gallery>, and have quick access to the latest platform updates. The following sections will guide you through the process of configuring your servers using all the elements of the platform.

ToolsCustomerWeb Hosting Provider
Web Platform Installer (Web PI)Installs Web Platform Tools and AppsInstalls Web Plat Tools and Apps
WebMatrixInstalls/Develops Applications, Customizes, and Publishes to Hosting ProviderSupports customers publishing through WebMatrix by configuring <link:Web Deploy>
Web Hosting GalleryBrowse/Search for hostingPublishes offerings
Web Application GalleryBrowse/Search for Web Applications to customize and publish to a hosting providerSupports these popular applications
WebsitePanelUses it to manage their Hosting Account and resourcesUses it to manage their plans, customers, resource allocation, and provisioning

Image 4: The Microsoft Web Platform Ecosystem

Configure your Hyper-v Host for Shared Web Hosting

As we discussed earlier, you can setup a shared hosting environment with a basic configuration consisting of a single server. The following steps will guide you through the setup of a single server running as a Hyper-v host. This server will host the three VM Servers as described above.

To get started, setup the hyper-v host server with Windows Server 2008 R2 Enterprise. This version of Windows includes four guest licenses (Windows Server Standard or Enterprise); it allows you to setup the host with four guests and pay monthly only for the host server after you have customer websites in any of the guest servers.

a. Click the 'Server Manager' button in the task bar; or click 'Start' menu, type 'Server Manager' and press Enter. This will bring up the Server Manager application.

b. On the left panel of Server Manager click on 'Roles'

c. Under 'Roles Summary' click on 'Add Roles'. Follow the Add Roles Wizard to Add the Hyper-v role. The wizard will ask you to reboot the computer; when you log back in, the wizard will complete the Hyper-v configuration.

Create your Web Server VM

This section will guide you through the creation of a guest VM to be the Web Server using Windows Server 2008 R2 SP1 Standard.

a. On the host machine, click the 'Start' menu, type 'Hyper-v Manager' and press Enter. This will bring up the Hyper-v Manager application.

b. On the 'Actions' bar (right side) click 'New' and select 'Virtual Machine'. The New virtual Machine Wizard will come up.

c. Enter the name of the virtual machine, I usually use a descriptive name that refers to the OS version used, for example 'WS2K8R2Std'.

d. On the same screen, select the location of where in disk the virtual machine will be stored. Do so by checking the check box and selecting the location you will use for the Web Server VM.

e. If you already have a prepared virtual hard disk available, this is the moment to specify to use it for your VM; otherwise you could create one from scratch or attach one later.

f. The next step is to install the OS, you have several options, for some of them you need to have the OS media ready. If you have not visited the SPLA site to download Windows Server 2008 R2 SP1 Standard, now is the time. You can use the downloaded OS in this step or do it later from a DVD, network drive, or network-based installation server.

From this point on your VM will be ready for you to start and connect to, use the Hyper-v Manager and double click on the machine listed under 'Virtual Machines' in the center panel.

Configure the Web Server Components to support WebMatrix

This article will walk you through installing the required server components to be WebMatrix compatible and fulfill the Spotlight requirements for the Web Hosting Gallery.

To simplify the installation of the web server components, we highly recommend installing Web Platform Installer, also known as WebPI, on both machines. WebPI is a tool that automates the installation of a vast majority of server components and other products for Microsoft's Web Platform.

Get WebPI 3.0 here: https://go.microsoft.com/fwlink/?LinkID=194638

If you prefer to not use WebPI, all of the required components can also be installed by hand or via your own provisioning scripts.

Option 1: Via Web Platform Installer 3.0 (recommended)

If you have WebPI 3.0 installed, the following link will automatically launch it with all of the basic web server components you'll need ready to install:

  1. Login in the VM created in the previous section, use your administration account. Notice that these instructions will work regardless of whether you are using a VM or an actual machine.

  2. Install Spotlight Components using Web PI. This link will install WebPI (if you have not done so already) and will let you review the list of products and dependencies before you start the process of installing the components. Notice that this list of components completely fulfills the Spotlight requirements from the Web Hosting Gallery.

  3. Once the Web PI window is displayed, click the 'Items to be installed' link to review the list of products and dependencies.

  4. Scroll down to see the rest of the items in the list:

    Here is the list of Products to install:

    1. IIS 7 or above Web Server including the following modules: Web Deploy 2.0, FTP, Media Services 3.0, IIS Remote Management Services, CGI, URL Rewrite 2.0, SQL Server 2008 Management Objects (SMO), Windows Cache 1.1 for PHP, MySQL Connector, Microsoft SQL Server Driver for PHP 2.0
    2. Frameworks: .NET 3.5 SP1, .NET 4.0, ASP.NET, ASP.NET MVC, and PHP 5.2.14 or higher
  5. Review the license page and accept the terms to continue with the install:

  6. If you are not using Windows Server 2008 R2 SP1, install the following Web Server Patch: Extensionless URL Hotfix. This hotfix is required for ASP.NET Web Pages to function correctly. M-audio driver. It is discussed further in this blog post.

  7. (Optional) Install Spotlight Components plus PHP/MySQL related components using Web PI. Many of the web applications that can be published by WebMatrix have PHP/MySQL components as requirements. To ensure you are able to support those applications, you can use this link to install everything above plus PHP/MySQL related components

Option 2: Manually install Web Server components

Here is the full list of which components are installed by those links, so you can confirm against the list of products listed in WebPI. Note that many of them bring in dependencies – that is expected behavior – but the total download should not exceed 50 MB or so.

Server:

  • [Required] IIS 7 Web Server basic components. Required for basic web server functionality.

Frameworks:

  • [Required] .NET Framework 3.5 SP1. Some applications depend on this framework
  • [Required] .NET Framework 4.0. Some applications depend on this framework
  • [Optional] PHP (5.2.14 or higher). This is not required for Spotlight, but many applications that can be published by WebMatrix depend on this framework

ASP.NET:

  • [Required] ASP.NET. This framework is the backend of many of the most popular web applications
  • [Required] ASP.NET MVC 1.0. A handful of applications in the App Gallery depend on this installed centrally
  • [Optional] You can also optionally install ASP.NET MVC3 and ASP.NET Web Pages, which gives you the ability to host applications written in the new 'Razor' syntax of ASP.NET. However, note that the binaries required for these kinds of applications are automatically published by WebMatrix. That is, each end user who publishes applications of this type will automatically end up with the required binaries in a /bin/ folder within their site root directory, so it is not really necessary to install them centrally.

IIS Modules:

  • [Required] Microsoft Web Deploy. Web Deploy is a client-server tool that simplifies the deployment of sites and applications to IIS servers. While WebMatrix supports web application publishing using both FTP and Web Deploy protocols, the latter providers a faster, more secure, and richer experience. It also lets the user deploy whole apps, including databases, ensuring they work both locally and remotely. It is the highlight of the WebMatrix publishing story.
  • [Required] FTP Publishing Service. To ensure the option of FTP exists for maximum compatibility
  • [Optional] Media Services. For IIS Smooth Streaming support
  • [Required] IIS Remote Management Service. To allow your users to manage aspects of their accounts using the IIS console. Also a dependency for Web Deploy to function properly
  • [Required] FastCGI for IIS. Provides a much faster CGI implementation than the default
  • [Required] URL Rewrite. A dependency for many applications to function correctly
  • [Required] SQL Server 2008 Management Objects. A dependency for many applications to function correctly, and for WebDeploy to manage SQL Server db's.
  • [Optional] Windows Cache Extension 1.1 for PHP. Highly recommended when running PHP on Windows.
  • [Optional] MySQL Connector/Net 6.2.3 or higher. Necessary for .NET applications using MySQL databases
  • [Optional] Microsoft Drivers for PHP for SQL Server in IIS. Necessary for PHP applications using SQL Server
  • Extensionless URL Hotfix. Needed only if you are not using Windows 2008 R2 SP1. Required for ASP.NET Web Pages to function correctly. It is discussed further in this blog post.

Database Server Components (see next section):

  • [Optional] PHP Driver for SQL Server. We highly recommended installing this component on your database server if you are supporting PHP.

Next Steps:

• Proceed to configure the database server machine.

• Ensure that the Web Deploy 2.0 (or higher) component is configured to allow delegated deployments. This is critical, as it is the primary method that allows your customers to publish to your servers with WebMatrix.

Create & Configure your SQL Server VM

Create a second guest as the Database Server Virtual Machine

  1. Follow the same steps outlined in 'Create your Web Server VM' to create the Database Server VM.

  2. Add Database Server Components to the Database VM

    1. Download the SQL Server 2008 R2 Web media from the SPLA site, find the link in the email you received confirming your SPLA agreement.
    2. [Required] Install SQL Server 2008 R2 Web on the Database VM. Follow the installation wizard instructions. WebPI supports installing Microsoft SQL Server 2008 Express edition, but we do not recommend this product in shared hosting environments, you should use the full version instead on a separate server.
    3. Install MySQL, use the following related article to ensure the installation supports WebMatrix.

Configure your Content Server VM

Virtual

Create a third guest as the Content Server Virtual Machine

  1. Download the Windows Server 2008 R2 Enterprise media from the SPLA site, find the link in the email you received confirming your SPLA agreement.

  2. Follow the same steps outlined in 2.a to create the VM Server.

  3. Install the Windows Server Backup features in the content server:

    1. Click the 'Server Manager' button in the task bar; or click 'Start' menu, type 'Server Manager' and press Enter. This will run the Server Manager application.

    2. On the left panel of Server Manager click on 'Features'

    3. Under 'Features Summary' click on 'Add Features'. Follow the Add Features Wizard to Add the Backup service.

  4. Install the File Services role in the content server.

    1. Click the 'Server Manager' button in the task bar; or click the 'Start' menu, type 'Server Manager' and press Enter. This will run the Server Manager application.

    2. On the left panel of Server Manager click on 'Roles'

    3. Under 'Roles Summary' click on 'Add Roles'. Follow the Add Roles Wizard to Add the 'File Services' role. Midtjudsk computer service aps driver download.

Configure your Control Panel Server VM

Create a second Web Server VM, configure follow the same steps that you did for the first Web Server. This server will act as the Control Panel server; it will host WebsitePanel (we will install it in a subsequent section). It could also help you troubleshoot websites issues. This final VM will complete the four guests allowed by your Windows Server Enterprise 2008 R2 license. If you are planning on a larger deployment, you may want to use the Windows Server 2008 R2 Datacenter edition which has no license limits on guests.

Details
Written by Nam Ha Minh
Last Updated on 06 August 2019 | Print Email
In this Java Tomcat tutorial, we'll guide you how to configure Apache Tomcat server to deploy and run multiple Java web applications under different hostnames, on a single server machine. For example, a project management application can be accessed via this URL:A payroll application is deployed to the following address:And a bug tracking application can be accessed via this URL:And so on..Though the applications are deployed and accessed via diffrent hostnames, they are actually running on a single instance of Tomcat. You can set up this kind of deployment by configuring virtual hosts in Tomcat.Follow these steps:

1. Update Server Configuration File

Open the server.xmlfile under the conf folder in Tomcat installation directory. Scroll this file to the end, and you see a <Host> section that looks like this:You see, this is the configuration for the default host - with hostname is locahostand the base directory is webapps:Now, to add another virtual host to this server, copy all the XML code in the <Host> section and change the properties name and appBase. For example:

Oracle Http Server Virtual Host

2. Configure Host Name Resolution

Note that when you specify the hostname 'projectx.com', you must also configure the operating system to resolve the hostname to IP address of the server. On Windows, you can do this by editing the hosts file under c:WindowsSystem32driversetc directory. Add the following line at the end of the file:Of course you need to use the correct IP address of the server. Then save the hosts file.

3. Create Base Directory for the Virtual Host

The property appBase points to a directory that contains the web application's files. So create a new directory named projectapp under Tomcat installation directory.

4. Deploy the Java Web Application

Copy the web application's WAR file to projectapp directory, and rename it to ROOT.war.Now, start the server. You will see Tomcat automatically unpacks the ROOT.war file to host the application. You now can access the application via this URL:Note that in the <Host>

Free Virtual Host

element for the host 'projectx.com', the <Vavle> element specifies the access log file:Navigate to the logs folder under Tomcat installation directory, you will the the project_access_log.txt has been reated.That's how to add a virtual host in Tomcat. You can repeat the same steps for other applications.The XML code for virtual hosts configuration in server.xml would look like this:The host name resolution in hosts file would look like this:And the base directories for those web applications would look like this:

References:

Other Tomcat Tutorials:

About the Author:

Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on Facebook and watch his Java videos you YouTube.