Windows Web Server 2008 is the successor to Windows Web Server 2003. It has some interesting tricks up its sleeve, that I just wanted to share with you in this SC'enario, since I believe Windows Web Server 2008 might eventually be the Operating System showing one of the ultimate potential of Web Services in Server Core.
Server Core
First of all let me make it clear that Windows Web Server 2008 comes with the Server Core installation option. When you enter the DVD into your system, boot to it and select to install Windows Server 2008 onto your system, you can choose between:
- Windows Web Server 2008 (Full Installation)
- Windows Web Server 2008 (Server Core Installation)
Licensing
With Windows Server 2008 Microsoft has also decided to change the licensing terms on the Web Server SKU. The changes are quite profound:
- Client Access Licenses (CAL's) are no longer required
- Usage of any type of Database is allowed (no longer limited to MSDE)
The effect, according to ChannelWeb is Windows Web Server 2008 will be competing more effectively with open source alternatives. This is certainly true for the CAL aspect of the new licensing terms.
The removal of the Microsoft SQL Based database limitation is sure to contribute to compete more effectively too, but I guess this change also has another reason: You cannot install Microsoft SQL based databases on Server Core installations.
Pros and Cons
Advantages of using Windows Web Server Core
When using Windows Web Server 2008 Server Core you can implement an Internet-facing IIS Web Server with a very low attack surface, a very low footprint in terms of RAM and Disk usage and almost no patching needs. Furthermore Web Server SKU pricing is almost 2/3 of Server, Standard Edition pricing.
You may expect Server Core installations to be deployed for very precisely targeted scenarios by only the most experienced system administrators. I guess a malicious person will think twice before targeting Server Core based systems.
Combining lower system requirements (which mean you can buy a cheaper server) and lower licensing prices (no CAL's) means you get a great bang for your buck!
Disadvantages of using Windows Web Server Core
You won't be able to run ASP.Net Web Applications on your Web Server and you won't be able to manage the web services remotely since IIS-ManagementService isn't an available package from ocsetup.exe and pkgmgr.exe in Server Core installations.
You cannot use applications or packages that require Managed Code Support, the .Net Framework and specific parts of the Windows GUI. These applications include Microsoft SQL Server and PowerShell.
From weakness to strength
Not having ASP.Net and Microsoft SQL databases on a Web Server might sound ridiculous if you're a Microsoft focused web developer, but in the context of open source development this is good news!
WIMP
According to Wikipedia a wimp is a physical or emotional weakling. (considered to be derived from J. Wellington Wimpy, a character in the popeye cartoon series)
Windows Web Server 2003 might be seen as the wimpy version of Windows Server 2003. Server Core might also be considered a wimpy version of the Full version of Windows Server 2008.
WIMP (as well as LAMP) is also an acronym to describe a web platforms. Where LAMP is built from Linux, Apache, MySQL and PHP, WIMP consists of Windows, IIS, MySQL and PHP. I guess now is a(s) good (a) time (as any) to look closely at PHP and MySQL on top of Internet Information Services (IIS) 7 and Windows Web Server 2008 Server Core.
Getting started
IIS 5 (Windows 2000 Server) and IIS 6 (Windows Server 2003) were modular to a certain degree, but Internet Information Services (IIS) 7 takes this do a different level. When you "install" Internet Information Services (IIS) 7 on your Server Core machine this modularization becomes evident soon.
Internet Information Services Packages
Windows Vista and Windows Server 2008 can be equipped with the Internet Information Services (IIS) 7 packages. Windows Vista can be used for testing. Windows Server 2008 Server Core also offers Internet Information Services (IIS) 7 packages, but not all of them.
Mete Goktepe from the IIS Team specified the following IIS packages can not be installed on Windows Server 2008 Server Core (yet):
- IIS-ASPNET
- IIS-NetFxExtensibility
- IIS-ManagementConsole
- IIS-ManagementService
- IIS-LegacySnapIn
- IIS-FTPManagement
- WAS-NetFxEnvironment
- WAS-ConfigurationAPI
That's right! There's only a 8 package difference between Server Core and a fullblown Windows Server 2008…
Configuring the IIS base role
If you want to be able to host even the simplest website on your Server Core server you need to install at least 3 roles. Only after installing these three roles will you see the default IIS 7 welcome page and will you be able to host HTM HTML JPG GIF pages. To install these three roles type:
start /w ocsetup IIS-WebServerRole
start /w ocsetup WAS-WindowsActivationService
start /w ocsetup WAS-ProcessModel
Note:
You can use the pkgmgr /iu: command as well to install packages on Server Core. You may find Pkgmgr available on both Server Core and Full installations of Windows Server 2008.
The commands take care of installing Internet Information Services (IIS) 7 on your Server Core box and even configure your firewall for port openings. According to my oclist output it specifically installs:
- IIS-Webserver
- IIS-CommonHttpFeatures,
- IIS-DefaultDocument
- IIS-DirectoryBrowsing
- IIS-HttpErrors
- IIS-StaticContent
- IIS-HealthandMonitoring
- IIS-HttpLogging
- IIS-RequestMonitor
- IIS-Performance
- IIS-HttpCompressionStatic
- IIS-Security
- IIS-RequestFiltering
- IIS-WebServerManagementTools
- IIS-CommonHttpFeatures,
- WAS-WindowsActiviationService
- WAS-ProcessModel
- IIS-DefaultDocument
- IIS-DirectoryBrowsing
- IIS-HttpCompressionStatic
- IIS-HttpErrors
- IIS-HttpLogging
- IIS-RequestFiltering
- IIS-RequestMonitor
- IIS-StaticContent
- WAS-ProcessModel
Your Server Core box should be displaying the default IIS 7 website.
Installing CGI
There are two ways to run PHP. You can run it as a module (only available in Apache) and as a CGI application. IIS 7 comes with functionality called FastCGI, which significantly enhances the performance of CGI based PHP. You can expect a x4 to x8 improvement in performance compared to plain-old CGI. Let's start by installing the CGI package for IIS 7 (which also installs the FastCGI package), which will serve as the basis:
start /w ocsetup IIS-CGI
Installing PHP5
To install PHP5 onto your system you simply need to download PHP from the PHP website. There are two flavors for download. You can use both, but the non-thread safe version of PHP 5 will offer the most performance, according to Mike Volodarsky.
All you need to do after you downloaded the PHP ZIP package and extracted the files onto your Server Core installation is:
- Place the extracted files in C:\PHP
- xcopy c:\php\php.ini-recommended c:\php\php.ini
- Notepad.exe c:\php\php.ini
- Change: extension_dir=”c:\php\ext”
- Add: Extension=php_gd.dll
- Exit notepad.exe while saving the file
Configuring IIS for PHP and FastCGI
To create the PHP handler in IIS and add index.php as a default document type the following commands:
cd C:\Windows\System32\Inetsrv
appcmd set config /section:system.webServer/fastCGI /+[fullPath='c:\php\php-cgi.exe']
appcmd set config /section:system.webServer/handlers /+[name='PHP-FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='c:\php\php-cgi.exe',resourceType='Either']
appcmd set config "Default web site" /section:defaultDocument /enabled:true
appcmd set config "Default Web Site" /section:defaultDocument /+files.[value='index.php']
Tip
Since the above commands are heavy on syntax I recommend placing the commands in a text file and renaming the extension of the file to *.bat.
Configuring your application
Your Server Core box is now able to display and interpret PHP pages. The only thing you need to do now is install your PHP application into C:\inetpub\wwwroot. If you need MySQL you can simple download the free MySQL Community Edition and run the installer.
Dennis Chung made an excellent write-up explaining how to install IIS 7, Configure PHP, Install MySQL and finally install and configure WordPress, which effectively makes his Server Core box perform as a fully functional blogging platform. I've followed his documentation and ended up with a perfectly functioning Web 2.0 platform. I enjoy blogging for Dirteam, so I really didn't need it, but that's besides the point…
Conclusion
Don't believe a Server Core installation of Windows Web Server 2008 isn't able to provide a decent platform for web services.
In today's world PHP is the most popular platform for Content Management Systems and the platform behind most of today's blogging platforms. Companies look at this software but might be reluctant to introduce Linux (LAMP) boxes inside their environment. Running this software on a Windows Server (WIMP) might be the solution to use new services without really changing the game of systems administration.
Perhaps Windows Web Server 2008 Server Core will prove to be the most popular way to provide web services using PHP!
Further reading
Download Details: Windows Web Server 2008
Microsoft Removes Licensing Restrictions From Windows Server 2008
Microsoft softens limits on its Windows Web Server
Getting PHP to perform on IIS7
Administering IIS7 on Server Core Installations of Windows Server 2008
Windows Server 2008 Core screencast – Installing Open Source Software
Internet Information Services Packages
IIS7 – Vista vs. Longhorn Server
Server Core + IIS7 + PHP + MySQL
Using Fast CGI to Host PHP Applications on IIS7
Robust and High Performance PHP with IIS: Using FastCGI
FastCGI: A High-Performance Web Server Interface
Shane Caraveo talks PHP, FastCGI and IIS
FastCGI for IIS
Running Windows Web Server 2008 x64
New Licensing Model for Microsoft Windows Web Server 2008
Windows Web Server 2008 licensing restrictions eased
PHP vs Microsoft .NET Framework
Mask Your Web Server for Enhanced Security
New IIS7 extensions available for download!
Hi, i used your SC'enario to build a WIKI, using MediaWIKI, php & MySQL.
As an avid Linux user, I was surprised to see how easy it was. So now i have a Server Core server next to my main server!