Linux to Windows Migration

Migrating Linux-Apache-MySQL-PHP to Windows 2000

Abstract

This paper discusses migration issues for LAMP-based sites that are being moved to Microsoft Windows 2000. Future versions of this article will detail the benefits of Windows 2000 as a platform and IIS as a Web server. Watch for updates on https://www.microsoft.com/technet/archive/interopmigration/linux/mvc/win2kcd.mspx.

On This Page

Introduction
Windows 2000 Server Installation
Application and Content Migration to Windows 2000
Advanced PHP
Summary
For More Information
Appendix A. Extracting tar files
Appendix B. MySQL Database and Data Setup
Appendix C. Comparison of Apache and IIS settings and terminology
Appendix D. PHP IDEs for Linux and Windows

Introduction

This paper illustrates a common migration scenario for a site based on the Linux-Apache-MySQL-PHP (LAMP) platform to Windows 2000 Server. This introduction details a few sample pages, used for demonstration purposes only. The following information and instructions are included in this document, presented in a step-by-step format:

  • Windows 2000 Server installation and setup

  • Application and content migration

  • Information about PHP for Linux and Windows, including Apache-specific functions

This information is presented for informational purposes only and does not reflect a comprehensive documentation of every aspect of a LAMP site or administration of a Windows 2000 Server site. These instructions assume some proficiency with Red Hat Linux, Apache, MySQL, and PHP.

The Demonstration Pages

The e-commerce site is a sample LAMP platform Web application that demonstrates a typical LAMP architecture, based on the following:

  • Red Hat Linux 7.0

  • Apache 1.3.12

  • MySQL 3.22.38

  • PHP 4.0.5

End User Expectations

Customers at any e-commerce site expect that the site will be able to provide the following:

  • Work with any Web browser.

  • Register new users.

  • Buy goods.

  • Use a common type of shopping basket format for purchase.

  • Provide the ability to search the site for specific items.

Administrator Requirements

The administrator of an e-commerce site has a variety of priorities, including the need to manage the application through the command line and view all transactions.

Middle Tier

The middle tier of a LAMP site may use CGI PHP or server-side PHP. PHP is not a pure object-oriented scripting language and won't give the performance of C or C++ language, although the Zend Optimizer in PHP 4 will speed up the performance of PHP to certain extent. As a scripting language, it is interpreted and will be a bit slower than the optimized C++ programs. For top performance, use C++ and fast-CGI with database/Web server connection pooling, and use C++ compiler optimizer -O3 options.

Other limitations of using PHP include no integrated development environment (IDE) tools, a poor debugging environment, and error handling that is not as sophisticated as other scripting languages, such as ASP.

Database Design

The database in a typical LAMP structure (including the demonstration site) uses MySQL and supports application programming interface (API) to PHP. The database design is simple and includes five tables: categories, customers, order details, orders, and products.

Schema

The MySQL database schema for the sample pages is as follows. Refer to Appendix B for code that can be run in the MySQL interpreter to create the databases and tables.

Security

This document will not cover any aspect of security; please review the application installation documentation to understand how the MySQL user is set up.

Windows 2000 Server Installation

This section explains how to install the Windows 2000 Advanced Server with Internet Information Services (IIS) 5.0, along with PHP and MySQL as the database. For details about migrating from Linux to Windows 2000, refer to Migrating Linux and Apache Server to Windows 2000 and Internet Information Services.

For this exercise, use the following software versions:

Use the following instructions to install Windows, IIS, PHP, and MySQL.

Installing Windows

To install Windows

  • Follow the instructions that come with Windows 2000 Server.

Installing PHP

To install PHP

  1. Download the zip file from https://www.php.net/downloads.php, which contains the ISAPI filter for IIS.

  2. Extract the contents of the zip file to C:\php.

  3. Go to C:\php.

  4. Copy the php.ini-dist file to your system root (the directory where you installed Windows), rename it to php.ini, and edit it to fit your needs.

  5. Start the Microsoft Management Console or the Internet Services Manager, located in Control Panel.

  6. Click your Web server, and select Properties.

    Dd316405.miglam01(en-us,TechNet.10).gif

  7. If you want to perform HTTP authentication using PHP, add a new ISAPI filter under ISAPI Filters. Use PHP as the filter name, and supply a path to php4isapi.dll.

    Dd316405.miglam02(en-us,TechNet.10).gif

  8. Under Home Directory, click Configuration. Add a new entry to Application Mappings. Enter the path to php4isapi.dll as the Executable, enter .php as the extension, leave Method exclusions blank, and select the Script engine checkbox.

    Dd316405.miglam03(en-us,TechNet.10).gif

    Dd316405.miglam04(en-us,TechNet.10).gif

  9. Stop IIS completely:

    net stop iisadmin /y
    
  10. Start IIS again:

    net start w3svc
    

You can also perform this installation via command line using the ADSI object model for IIS.

To test PHP

  • Create a file called test.php with the following code to check for PHP support:
<? phpinfo(); ?>

The file needs to be located in the document root path, which should be set up by default to C:\inetpub\wwwroot\lamp.

Installing MySQL

To install either distribution, unzip it in an empty directory and run the Setup.exe program. By default, MySQL-Windows is configured to be installed in C:\mysql. If you want to install it somewhere else, install it in C:\mysql first, and then move the installation to where you want it. If you do move MySQL, you must supply options to mysqld that indicate where the database is installed.

To install MySQL

  1. Download the MySQL database from https://www.mysql.com/downloads/mysql-3.23.html.

  2. Extract the contents to C:\mysql.

Tip Type C:\mysql\bin\mysqld --help to display all options.

For example, if you have moved the MySQL distribution to D:\programs\mysql, you must start mysqld with the following:

D:\programs\mysql\bin\mysqld --basedir D:\programs\mysql

With all newer MySQL versions, you can also create a C:\my.cnf file that holds any default options for the MySQL server. Copy the \mysql\my-xxxxx.cnf file to C:\my.cnf, and then edit it to suit your setup. You should specify all paths with forward slashes (/) instead of backward slashes (\). If you use a backward slash, you need to specify it twice, because "\" is the escape character in MySQL.

Installing on Windows NT/Windows 2000

For Windows NT/Windows 2000, the server name is mysqld-nt. Normally you should install MySQL as a service on Windows NT/Windows 2000:

C:\> C:\mysql\bin\mysqld-nt install

or

C:\> C:\mysql\bin\mysqld-max-nt install

You can also use mysqld binaries that don't end with -nt.exe on Windows NT, but those cannot be started as a service, nor can they use named pipes.

Starting or Stopping MySQL Services

You can start and stop the MySQL service with these commands:

C:\> NET START mysql 
C:\> NET STOP mysql

The service is installed with the name MySQL. Once installed, it must be started using the Services Control Manager (SCM) Utility (found in Control Panel) or by using the NET START MySQL command. If any options are desired, they must be specified as "Startup parameters" in the SCM utility before you start the MySQL service.

Creating MySQL Tables

After MySQL is installed, you can create the MySQL tables used to define the permissions. Make sure you replace "new-password" with a text string of your choice; otherwise, new-password will be your root password.

Via the command prompt, go to C:\mysql\bin ( or the directory where you installed MySQL).

C:\mysql\bin:>mysqladmin -u root password 'new-password'

You can verify that MySQL is working by running some simple tests. The output should be similar to what is shown below:

mysql -u root -p 
Enter password: 
mysql> show databases;  
+--------------------+ 
|Database            | 
+--------------------+ 
|Mysql               | 
|Test                | 
+--------------------+ 
2 rows in set (0.00 sec)  
mysql> create database test2;  
Query OK, 1 row affected (0.00 sec)

Installing IIS

IIS is part of the Windows 2000 Advanced Server operating system. Refer to the documentation for information about how to install and modify IIS settings.

To test IIS, point a Web browser to https://localhost.

Application and Content Migration to Windows 2000

There are two parts to the migration of the demonstration site: content and the database tier. There are several ways to move files back and forth from a Linux machine to Windows, including the following two methods:

  • Method 1. Use the IIS Migration Wizard. The IIS Migration Wizard is a tool that facilitates the task of migrating Web sites from many different platforms to IIS version 5.0. It can migrate UNIX-based Web sites running Apache Web Server version 1.3.x, or it can simply migrate from IIS version 4.0 to IIS version 5.0.

    https://www.microsoft.com/ISN/downloads/migration_toolsP65238.asp?A=0

  • Method 2. FTP the files from Linux to Windows 2000 Server/Advanced Server.

Method 3. Use a static migration site. To find out more about how to use this method, see the white paper, Migrating Static Content from Linux to Windows 2000 and IIS 5.0.

Database Tier

You can move the database tier either by moving the MySQL to a MySQL database on the Windows 2000 Server, or you can move it to a Microsoft SQL Server database.

To move the database tier to a MySQL on the new server, you must first dump the contents of the MySQL running on Linux.

You can import the contents into MySQL Windows 2000:

Mysql > mysql source c:\linux.txt

For more information, refer to the following:

https://www.mysql.com/doc/m/y/mysqlimport.html

https://www.mysql.com/doc/L/O/LOAD_DATA.html

To move the MySQL database to a SQL Server database, refer to the white paper, MySQL Migration to Microsoft SQL 2000 on the Linux Migration Guide CD. This white paper can also be found at https://www.microsoft.com/technet/prodtechnol/sql/2000/deploy/mysql.mspx.

Other Components of This Site

User ID and password are verified against a database, and a temporary cookie is stored for the session. The site also uses session variables and HTTP form variables. This site does not account for performance, security, or fine-tuning.

Advanced PHP

The sample pages are a simple introduction to Linux, and you are not likely to have many issues with migrating such a straightforward site. This section contains in-depth information and links for key areas where you may experience difficulty.

PHP Portability

In general, PHP is quite portable. Cross-platform development has been a major goal in the development of PHP since the days of version 3. For the most part, PHP scripts should be easily ported from Linux to Windows with few problems. However, there are several instances where you might run into roadblocks when porting your scripts. The hardest part of porting PHP scripts will be dependent on the extensions you have used in your scripts. For more information, see the following:

PHP is still a changing language. There are minor differences among PHP releases. For example, include_once is only available from PHP 4.0 patch level 1.

Moving from PHP with Apache to PHP with IIS

You have to be aware of differences in behavior between Apache and other Web servers, including IIS. For example, certain server variables available in Apache are not available in IIS, and vice versa. Consider the following information about how PHP interacts with Web servers:

  • Php.ini settings on different servers can cause big differences in how global variables are handled and what the PHP program accepts as legal PHP code.

  • Make sure all PHP extensions are compiled consistently. Some PHP Web sites lack certain key extensions, or have old versions of certain extensions.

  • Many of the file system functions are Linux/UNIX-specific and will not do anything under Win32. Check each function in the PHP manual to find out whether or not it will not work with Windows.

  • Make sure that the parameters and file names you pass are case-sensitive. Although you can set case sensitivity off in MySQL, most servers prefer to leave it on by default. On the Windows NT version of MySQL, case sensitivity is off by default.

Programming for Portability Between Platforms

If you program correctly—taking care of browser types and versions—the PHP codes are portable across Web browsers. There are some changes that might be needed for Windows-based and UNIX/Linux-based server platforms.

Mail Functions

One issue in changing platforms with PHP is the use of the mail() function. On Linux systems, you can configure this function to use Sendmail or Qmail to send messages. As of version 4.0.5, this is not available under Windows. The Windows version of PHP includes a built-in implementation for sending e-mails that is limited to simple messaging. See https://www.php.net/manual/en/function.mail.php for more information. One way to work around the lack of a full implementation of Sendmail in PHP (4.0.6 or higher required) is to use the Microsoft Collaboration Data Objects (CDO) Library. The following is a short example of its usage:

<? 
$message = new COM("CDO.Message"); 
$message->To = 'receiver@somplace.com'; 
$message->From = 'Sender@MyCompany.com'; 
$message->Subject = "This is a subject line"; 
$message->HTMLBody = "<html><body>This is <b>the</b> body!</body></html>"; 
$message->AddAttachment('https://www.ActiveState.com'); 
$message->Send(); 
?>

Apache-specific Functions

PHP includes several Apache-specific functions. Click on the function for more information at the PHP Web site.

Remote Files

You can use HTTP and FTP URLs with most functions that take a file name as a parameter, including the require() and include() statements, as long as either one of the following is true:

  • Support for the URL fopen wrapper option is enabled when you configure PHP. This is enabled by default, unless you explicitly pass the --disable-url-fopen-wrapper flag to configure (for versions up to 4.0.3).

  • Set allow_url_fopen to off in php.ini (for newer versions).

Note: You can't use remote files in include() and require() statements on Windows.

For example, you can use the following to open a file on a remote Web server, parse the output for the data you want, and then use that data in a database query, or simply output it in a style matching the rest of your Web site.

Example. Getting the title of a remote page 
<?php 
$file = fopen ("https://www.php.net/", "r"); 
if (!$file) { 
echo "<p>Unable to open remote file.\n"; 
exit; 
} 
while (!feof ($file)) { 
$line = fgets ($file, 1024); 
/* This only works if the title and its tags are on one line */ 
if (eregi ("<title>(.*)</title>", $line, $out)) { 
$title = $out[1]; 
break; 
} 
} 
fclose($file); 
?>

COM Support in Windows

COM functions are only available on the Windows version of PHP. The following functions have been added in PHP 4. Click on a function for more information, provided by the PHP Web site.

COM  COM class.

VARIANT VARIANT class.

com_load Creates a new reference to a COM component.

com_invoke Calls a COM component's method.

com_propget Gets the value of a COM component's property.

com_get Gets the value of a COM component's property.

com_propput Assigns a value to a COM component's property.

com_propset Assigns a value to a COM component's property.

com_set Assigns a value to a COM component's property.

com_addref Increases the component's reference counter.

com_release Decreases the component's reference counter.

HTTP Authentication with PHP

The HTTP authentication hooks in PHP are only available when it is running as an Apache module, and so are not available in the CGI version. In an Apache module PHP script, you can use the header () function to send an "Authentication Required" message to the client browser, which causes the browser to pop up a Username/Password dialog box. After the user has filled in a user name and a password, the URL containing the PHP script will be called again using the variables $PHP_AUTH_USER, $PHP_AUTH_PW, and $PHP_AUTH_TYPE, set to the user name, password, and authentication type, respectively. Only Basic authentication is supported at this point. See the header() function for more information. This does not work in IIS.

DNS Records

PHP uses checkdnsrr to check DNS records corresponding to a given Internet host name or IP address (host may either be the IP address in dotted-quad notation or the host name). The checkdnsrr() function is not available on Windows. For more information, refer to https://www.php.net/manual/en/function.checkdnsrr.php.

System Log Messages

Use syslog() to generate a system log message. For Windows, the log message will be written to the event log. Currently, there is no method to access the information from PHP written by syslog

XML Support

XML support in PHP is limited, but there are no issues in porting PHP/XML applications (see https://www.php.net/manual/en/ref.domxml.php). Refer to the Microsoft XML parser on the Windows platform (https://msdn.microsoft.com/xml) for more information.

Directory Functions

PHP provides several directory manipulation functions. PHP understands the use of either backward or forward slashes on Windows platforms, and can even handle paths that mix the use of the two slashes. However, as of version 4.0.5, when accessing Windows UNC paths, PHP will only recognize the forward slash in the path (that is, //machine_name/path/to/file).

Example:

<?php 
if ($dir = @opendir("/tmp")) { 
while($file = readdir($dir)) { 
echo "$file\n"; 
}   
closedir($dir); 
} 
?>

Socket Programming

On Windows, PHP supports accessing sockets via standard file functions such as fread and fwrite, though the socket must be initiated with fsockopen(). See https://www.php.net/manual/en/ref.sockets.php.

PHP Windows Limitations

Currently, PHP uses more than 80 extensions, covering a wide range of services and functionality. Only about half of these are available on both platforms. A handful of extensions, such as the COM, .NET, and IIS extensions, are specific to Windows. If an extension you use in your scripts is not currently available for Windows, you will need to look at either porting that extension or converting your scripts to use functionality that is available for Windows.

Another issue that you may face in using extensions on Windows will be the form in which you use PHP. If you use PHP as a Web server plug-in (via the ISAPI filter), the extensions must be thread-safe. Some extensions depend on third-party libraries that may not be thread-safe, thus making the extension incompatible with the ISAPI plug-in. Unfortunately, the level of thread safety in PHP extensions is poorly documented and will require testing on your part to discover where you may run into difficulty. Fortunately, if an extension is particularly popular, there's a greater chance that an extension is available or Windows.

Note that PHP has the following additional limitations:

  • Support for XML is low, compared to the Microsoft XML implementation.

  • Support for SOAP is low (see https://www.gigaideas.com.cn/phpsoap/), compared to Microsoft SOAP support (see https://msdn.microsoft.com/soap/).

  • PHP cannot access the Windows registry.

  • PHP does not include support for handling users and groups on Windows.

  • PHP does not include full support for Unicode, as of version 4.0.5.

Summary

For basic Web sites running LAMP, migration to Windows 2000 Server/Advanced Server can be as easy as these four steps:

  1. Windows 2000 Server installation and setup

  2. Content migration

  3. Application migration

  4. Fine-tuning issues with migration and PHP portability

This paper covered these basic first steps, and offers additional information about PHP for Linux and Windows, including Apache-specific functions and HTTP authentication with PHP. Appendix C offers details about Apache and IIS terminology and settings comparisons. To learn more about the next step, which is to take advantage of the .NET platform, refer to the MSDN online developer center for more information https://msdn.microsoft.com/net.

This information is presented for informational purposes only and does not reflect a comprehensive documentation of every aspect of a LAMP site or administration of a Windows 2000 Server site. These instructions assume some proficiency with Red Hat Linux, Apache, MySQL, and PHP.

For More Information

For the latest information on Windows 2000, check out our Web site at https://www.microsoft.com/windows2000.

Appendix A. Extracting tar files

The tar file on this CD contains contents for the PHP files, GIF files, and so on. The MySQL directory contains files that create the MySQL database and tables, and insert data.

To extract the tar file, lamp.tar.gz

  1. cd /usr/local/apache/htdocs

  2. Untar the file:

    gunzip -c lamp.tar.gz | tar xf

  3. cd /tmp/lamp

Appendix B. MySQL Database and Data Setup

Mysql u root p 
Mysql> 
Create database ibuyspy 
CREATE TABLE Categories( 
CategoryName VARCHAR(50), 
CategoryID INT NOT NULL AUTO_INCREMENT, 
PRIMARY KEY (CategoryID)); 

CREATE TABLE Customers ( 
CustomerID INT NOT NULL AUTO_INCREMENT, 
FullName varchar(50), 
EmailAddress varchar(50), 
Password varchar(50),  
PRIMARY KEY (CustomerID)); 
CREATE TABLE OrderDetails( 
OrderID int NOT NULL , 
ProductID int NOT NULL , 
Quantity int NOT NULL , 
UnitCost decimal(9,2) NOT NULL,  
PRIMARY KEY (OrderID,ProductID)); 

CREATE TABLE Orders( 
OrderID INT NOT NULL AUTO_INCREMENT, 
CustomerID int NOT NULL , 
OrderDate datetime NOT NULL , 
ShipDate datetime NOT NULL,  
PRIMARY KEY (OrderID)); 
CREATE TABLE Products( 
ProductID INT NOT NULL AUTO_INCREMENT, 
CategoryID int NOT NULL, 
ModelNumber varchar(50), 
ModelName varchar(50), 
ProductImage varchar(50), 
UnitCost decimal(9,2) NOT NULL, 
Description BLOB, 
PRIMARY KEY (ProductID)); 

CREATE TABLE Reviews( 
ReviewID INT NOT NULL AUTO_INCREMENT, 
ProductID int NOT NULL, 
CustomerName varchar(50), 
CustomerEmail varchar(50), 
Rating int NOT NULL, 
Comments BLOB, 
PRIMARY KEY (ReviewID)); 

CREATE TABLE ShoppingCart( 
RecordID INT NOT NULL AUTO_INCREMENT, 
CartID varchar(50), 
Quantity int NOT NULL, 
ProductID int NOT NULL, 
DateCreated datetime NOT NULL,  
PRIMARY KEY (RecordID));

Database User

One database user is created to access the database from the PHP application, as follows:

GRANT ALL PRIVILEGES ON *.* TO dummy@localhost IDENTIFIED BY 'mydum' WITH GRANT OPTION;

Appendix C. Comparison of Apache and IIS settings and terminology

The following are some Apache features that have different names and implementations on IIS 5.0.

Administration Interface

IIS 5.0 properties, which correspond with Apache directives, are contained in the metabase. The most significant difference you'll find between administering Apache and IIS 5.0 is the fact that IIS 5.0 provides graphical tools, the IIS snap-in and the Internet Services Manager (HTML), for configuring the metabase, whereas Apache provides plaintext configuration files, usually httpd.conf, srm.conf, and access.conf, in which you configure directives. It should be noted, however, that IIS 5.0 does include adsutil.vbs to allow command line and scripting administration.

Apache administrators who prefer to work from the command line and to script routine tasks will be happy to know that IIS 5.0 also provides a set of tools for programmatic administration. These tools are described in the "Administering IIS Programmatically" topic in the IIS 5.0 online product documentation.

Apache administrators will also find that Windows 2000 Server commands are similar to familiar UNIX commands. Additional utilities for command-line administration are included with the Windows NT Services for UNIX, a suite of interoperability tools and utilities provided by Microsoft for Windows NT Server and UNIX. At the time of this writing, a version of these tools is under development for Windows 2000.

Security

If you're accustomed to Apache security, be aware that Allow and Deny access permissions are processed in a different order by Windows 2000 Server, producing results you might not expect. Windows 2000 Server always honors a Deny. If you deny permission to a group, and then try to allow permission to an individual member of the group, the member still will not be able to access the resource. These results could change should you change the order of implementation of the deny and allow access permissions. Also note that, unlike in Apache, CGI scripts are contained within the IIS 5.0 Web space. This is because NTFS and IIS 5.0 security sufficiently protects it from attack.

User Directory

You set up individual user Web sites differently on IIS 5.0 than on Apache HTTP Server. With Apache, you add a user to the machine, and then create a <~username> directory for the user's Web pages. The server then responds to the following request by displaying the user's Web pages:

https://www.server.com/\<~username>

IIS 5.0 does not automatically create virtual directories for users. Instead, to add a user Web site you create a <username> directory for their files in Windows Explorer, create a virtual directory named <~username> in the IIS 5.0 snap-in, and then point it to the <username> directory.

Virtual Host

The IIS 5.0 counterpart to the Apache Virtual Host is a virtual server. As with Apache virtual hosts, each virtual server in IIS 5.0 has its own domain name and IP address. Apache also includes "name-based" virtual hosts in this category. IIS 5.0 supports this feature in the same manner as Apache, through host header names, but doesn't have a specific term for it.

Alias/Directory Alias

In IIS 5.0 an alias or directory alias is called a virtual directory. In Apache, you use the RedirectMatch/AliasMatch command to map a directory alias to a real directory located on the hard disk, as shown in the following example:

ReditrectMatch /usr/apache/htdocs/newfolder/.

To do the same thing in IIS 5.0, in the IIS snap-in, create a virtual directory and point it to the real directory in Windows Explorer. Using the previous example, the virtual directory would be named "folder," and you would point it to c:\apache\htdocs\newfolder\. Note the change from using forward slashes (/) in the UNIX pathname to backslashes (\) in the Windows path.

Custom Error Messages

In Apache, you provide custom error messages by editing the Error Document and referring to it by using the command:

ErrorDocument 404 https://www.domain.com/404.html

To customize error messages in IIS 5.0, in the IIS snap-in open Properties for the Web site. On the Custom Errors tab, you'll see the location of the error message files. From here, you can map custom error messages to a file or to a URL on the local server.

Redirects

In Apache you use the following .htaccess command to redirect a user to another file:

Redirect /oldfile.html https://www.domain.com/path/to/new/file

There are two ways to implement a redirection in IIS 5.0:

  • In the IIS snap-in open Properties for the Web site. On the Home Directory tab, select A redirection to a URL, and choose the appropriate options.

  • Or, put a Default.asp file, containing the following code, in the same directory as the old file:

Response.Redirect /oldfile.html https://www.domain.com/path/to/new/file

Migrating Apache Directives

This section lists the core Apache HTTP Server 1.3 directives and lists corresponding IIS 5.0 metabase properties, as well as how to configure each property in the IIS snap-in. There is not a one-to-one correspondence between Apache and the IIS 5.0 configuration options: not all IIS 5.0 settings exist on Apache and vice versa. This section does not cover IIS 5.0 properties that have no counterpart in Apache. For in-depth information about IIS 5.0 configuration parameters and metabase properties, see the "Administrator's Reference" topic in the IIS 5.0 online product documentation.

Server Directives

Apache httpd.conf Directives and Corresponding IIS 5.0 Properties

Apache Directive

IIS Metabase Property

IIS Snap-in Configuration

AccessConfig

Not applicable

In IIS 5.0 there is no separate access configuration file.

BindAddress

ServerBindings

For multihoming, IIS 5.0 allows you to specify Virtual Hosts, or virtual servers. To configure a virtual server, right-click a Web site, choose Properties, and then select the Web Site tab. Click the Advanced button on the Web Site tab, and add the correct IP address and Transmission Control Protocol (TCP) port.

CacheNegotiatedDocs

Not applicable

You can specify an expiration date for content in a browser or proxy cache. To configure this setting, right-click a Web site, choose Properties, and then select the HTTP Headers tab. Select the Enable Content Expiration check box and enter expiration dates.

ErrorLog

Not applicable

All errors for the Inetinfo process are logged to the Windows Event Log and do not need to be specified in the Web server configuration.

ExpiresActive

HttpExpires

In IIS 5.0 content expiration is disabled by default. To enable content expiration, right-click a Web site, choose Properties, select the HTTP Headers tab, and then check the Enable Content Expiration check box.

ExpiresDefault

HttpExpires

In IIS 5.0 content expiration is disabled by default. To enable content expiration, right-click a Web site, choose Properties, and then select the HTTP Headers tab. Select the Enable Content Expiration check box, and then set the parameters.

Header

HttpCustomHeaders

To create a custom header, right-click a Web site, choose Properties, and then select the HTTP Headers tab. In the Custom HTTP Headers box, click Add, and then type a name and a value for the header.

HostnameLookups

EnableReverseDNS

IIS 5.0 log files capture the IP addresses of Web site visitors. To look up the host name of a given IP address, enable the metabase property EnableReverseDns. To set IP address restrictions, right-click a Web site, click Properties, click the Directory Security tab, and then click the Edit button in the IP Address and Domain Name Restrictions box.Note: Enabling this feature may impact system performance.

IdentityCheck

LogExtFileUserName

To log the identity of each Web site visitor, right-click a Web site, click Properties, and then click the Web Site tab. Select the Enable Logging check box, and then click Properties. Click the Extended Properties tab, and then select the User Name check box.

<IfDefine>

Not applicable

 

Include

Not applicable

This directive is not needed in IIS 5.0.

KeepAlive

AllowKeepAlive, MaxConnections

In IIS 5.0, HTTP Keep-Alives are enabled by default. To disable Keep-Alives, right-click a Web site, and choose Properties. On the Web Site property sheet, clear the HTTP Keep-Alives Enabled check box. You set the maximum number of connections and the connection time-out in this location as well.

KeepAliveTimeout

Connection Timeout

To set the Keep-Alive time-out, right-click a Web site and then choose Properties. In the Connections box on the Web Site property sheet, select the Limited To radio button and, in the Connection Timeout box, specify the number of seconds you want before an idle connection times out.

Listen

ServerBindings

IIS 5.0 allows you to specify a port for name-based virtual hosts. To configure this setting, right-click a Web site and then choose Properties. On the Web Site property sheet, click the Advanced button, and then enter the TCP port number.

ListenBacklog

ServerListenBacklog

This is a service-level property, and it cannot be configured from the MMC. However, it can be administered at the service level instead of at the site level.

MaxClients

MaxConnections

To configure this property, right-click a Web site, choose Properties, and then select the Web Site tab. Select the Unlimited or the Limited To radio button. For limited connections, in the Connection Timeout box specify the number of seconds before a connection should time out.

MaxKeepAliveRequests

Not applicable

There is no equivalent in IIS 5.0.

MaxRequestsPerChild

Not applicable

IIS 5.0 uses a limited number of processes, and there is no need to set the maximum number of requests per child process as there is with Apache.

Min/MaxSpareServers

Not applicable

IIS 5.0 uses a limited number of processes, and there is no need to account for this number.

NameVirtualHost

ServerBindings

An Apache virtual host corresponds to an IIS 5.0 Web site. In IIS 5.0 you can create virtual hosts either by using multiple IP addresses or by using a single IP address and HTTP 1.1 Host Header Names. To create a virtual host with a unique IP address, right-click a Web site, choose Properties, and then select the Web Site tab. Click the Advanced button and specify the IP address. To specify a host header name for a name-based virtual host, right-click a Web site, and then choose Properties. On the Web Site property sheet, click the Advanced button and enter the host header name for the IP address you want to use.

PidFile

Not applicable

IIS 5.0 does not offer the option to log its process ID to a file.

Port

ServerBindings

To set the port to which your Web server should listen, right-click a Web site, choose Properties, and then select the Web Site tab. Enter a port number in the TCPPort box.

Proxy Cache Parameters

Not applicable

IIS 5.0 cannot function as a proxy server on its own. Microsoft ISA Server is recommended for use with Windows 2000 Server.

ProxyRequests

Not applicable

See the previous note for Proxy Cache Parameters.

RlimitCPU

CpuLimit

IIS 5.0 has a number of properties that specify CPU throttling parameters. To specify performance parameters in the IIS snap-in, right-click a Web site, choose Properties, click the Performance tab, and then choose the settings you want.

ScoreBoardFile

Not applicable

IIS 5.0 does not have a Scoreboard file.

ServerAdmin

Not applicable

IIS 5.0 does not have a configuration setting for displaying the administrator's name and contact information. You can add this information to your pages by using ASP.

ServerAlias

ServerBindings

IIS 5.0 allows you to specify a host header name for a name-based virtual host. To configure this setting, right-click a Web site, and then choose Properties. On the Web Site property sheet, click the Advanced button and enter the host header name for the IP address you want to use.

ServerName

Not applicable

The host name for your Web server is stored in your Domain Name System (DNS) server and is not required in IIS 5.0 configuration properties. However, you must specify an IP address and HTTP port in order for IIS 5.0 to serve content.

ServerPath

Path

This directive is migrated to the Path property of the IIS Virtual Directory object. This property defines the path from a virtual directory to its corresponding physical directory. You configure this property in the IIS snap-in when you create a new virtual directory, by specifying from which directory the content is to be served.

ServerRoot

Not applicable

IIS 5.0 does not have the same concept of server root and does not have a corresponding property.

ServerType

Not applicable

IIS 5.0 always runs in stand-alone mode. Once IIS 5.0 is started, its process remains in memory and listens to the specified HTTP port. You can't configure IIS 5.0 to dynamically load as with an inetd server on Apache.

StartServers

Not applicable

See the previous note for Min/MaxSpareServers.

Timeout

ConnectionTimeout

You can specify the maximum amount of idle time to elapse before your server drops a connection. To configure this setting, right-click a Web site, choose Properties, and then select the Web Site tab. Enter the maximum timeout value in the Connection Timeout box.

TransferLog

Not applicable

IIS 5.0 does not use a transfer log.

User/Group

Not applicable

When IIS 5.0 is installed, by default it creates the IWAM user account under which the server runs. You must be logged on as an administrator or operator in order to start and stop the IIS 5.0 service, but the process does not retain your permissions.

<VirtualHost>

Not applicable

For each Apache virtual host, you should create a new IIS Web site and apply the directives contained between the <VirtualHost> tags, including server bindings, to the Web site. You might need to correct the IP address of the new Web site, as well.

Resource Configuration

Apache srm.conf Directives and Corresponding IIS 5.0 Properties

Apache Directive

IIS Metabase Property

IIS Snap-in Configuration

AccessFileName

Not applicable

You can refer to these parameters for mapping access configuration information. However, in IIS 5.0 there is no separate access configuration file. IIS 5.0 security is integrated with Windows 2000 security. To limit access to a site or directory by user, you must configure a new user account in the Windows 2000 Server User Manager. You can also classify individuals or groups as "Web site Operators" with limited authority to administer a Web site. They do not have to be Windows 2000 Administrators. To define Web site Operators, in the IIS snap-in right-click a Web site, click Properties, and then click the Operators tab.

AddDescription

Not applicable

There is no corresponding property in IIS 5.0.

AddEncoding

MimeMap

To map a file extension to a MIME type, right-click a Web site, choose Properties, and then select the HTTP Headers tab. In the Mime Map box, click File Types, and then click New Type. Or, to edit an existing MIME type, select a file type in the list, and then click Edit. Type the file extension and associated MIME type in the appropriate boxes.

AddIcon

Not applicable

IIS 5.0 uses the standard Windows 2000 icons when displaying a directory. You cannot specify a substitute icon.

AddLanguage

Not applicable

There is no corresponding property in IIS 5.0.

AddType

MimeMap

To add MIME types, right-click a Web site, choose Properties, and then select the HTTP Headers tab. In the Mime Map box, click File Types, and then click New Type. Type the file extension and the associated MIME type in the appropriate boxes.

Alias

Not applicable

To create a virtual directory, right-click the FTP or Web site, click New, and select Virtual Directory. Use the New Virtual Directory Wizard to complete this task.

AliasMatch

Not applicable

There is no direct equivalent in IIS 5.0 because there is no concept of regular expressions. See the previous note for Alias.

DefaultIcon

Not applicable

Windows 2000 Server offers a standard default icon for file types that do not have a preset icon in the file system.

DefaultType

MimeMap

IIS 5.0 contains a comprehensive list of MIME types. You can add new MIME types to the list should you need to serve a new MIME type. To view default MIME types, right-click a Web site, choose Properties, and then select the HTTP Headers tab. Click the File Types button in the MIME Map section of the tab.

DirectoryIndex

EnableDirBrowsing

To allow directory browsing, right-click a Web site, choose Properties, select the Home Directory tab, and then select the Directory Browsing check box. IIS 5.0 does not allow you to specify a prewritten HTML document as a directory index.Note: This can be accomplished by editing the default page (default.htm, default.aps, etc.) to contain an annotated list of all files in the directory.

DocumentRoot

Path

The Path property of the IIS Root object defines the path from a Web site home directory to its corresponding physical directory. To configure this property in the IIS snap-in, right-click a Web site, choose Properties, and select the Home Directory tab. Then specify the location of the home directory (document root).

ErrorDocument

HttpErrors

To enable custom error messages, right-click a Web site, choose Properties, and then select the Custom Errors tab. In cases where the custom error page is a standard HTML page, you need only copy the file to the IIS 5.0 system in order to complete the migration. In the case of CGI custom errors, you need to test the CGI scripts after moving them to IIS 5.0.

FancyIndexing

Not applicable

IIS 5.0 offers default indexing only.

HeaderName

Not applicable

There is no corresponding property in IIS 5.0.

IndexIgnore

Not applicable

There is no corresponding property in IIS 5.0.

LanguagePriority

Not applicable

There is no corresponding property in IIS 5.0.

MetaDir

Not applicable

You do not need to specify a Meta Directory to serve HTTP header information. To specify custom HTTP headers, right-click a Web site, choose Properties, select the HTTP Headers tab, and then click Add. Specify a header name and value in the appropriate boxes.

MetaSuffix

Not applicable

See the previous note for MetaDir.

ReadmeName

Not applicable

IIS 5.0 does not specify a default name for ReadMe files.

Redirect

HttpRedirect

To redirect a request to another resource, right-click a Web site, choose Properties, select the Home Directory tab, and then select A redirection to a URL. Type the URL in the Redirect to box.

RedirectTemp

HttpRedirect

In IIS 5.0, redirections are temporary by default.

RedirectPermanent

HttpRedirect

To make a redirection permanent, follow the steps previously given for Redirect. In addition, select the A permanent redirection for this resource check box after typing the URL.

ResourceConfig

Not applicable

This information does not directly translate to an IIS 5.0 property.

ScriptAlias

Not applicable

To replicate this information, create a Virtual Directory object using the Apache path information and set the IIS AccessExecute property to TRUE. Any virtual directory can execute scripts when the "Allow Scripts" permission is enabled in the IIS snap-in. To configure this property, right-click a Web site, choose Properties, select the Home Directory tab, and then select the Scripts only or the Scripts and Executables option in the Execute Permissions box.

TypesConfig

MimeMap

To view or configure MIME types, right-click a Web site, choose Properties, and then select the HTTP Headers tab. Click the File Types button in the MIME Map section of the tab.

UserDir

Not applicable

IIS 5.0 does not offer a default directory for ISP user httpd directories. You must create a virtual directory for each user in the IIS snap-in, and then point it to the user directory in Windows Explorer.

Access Configuration

Apache access.conf Directives and Corresponding IIS 5.0 Properties

Apache Directive

IIS 5.0 Metabase Property

IIS Snap-in Configuration

AllowOverride

Not applicable

IIS 5.0 utilizes Windows 2000 security in order to restrict access to a site, so htaccess files are not necessary to control access. Note that in IIS 5.0 you can classify individuals or groups as "Web site Operators" with limited authority to administer a Web site. They do not have to be Windows 2000 Administrators. To define Web site Operators, in the IIS snap-in right-click a Web site, click Properties, and then click the Operators tab.

AuthDBGroupFile

Not applicable

Following migration, you must reconfigure all security on IIS 5.0, including users and groups.

AuthDBUserFile

Not applicable

See previous note for AuthDBGroupFile.

AuthDBMGroupFile

Not applicable

See previous note for AuthDBGroupFile.

AuthDBMUserFile

Not applicable

See previous note for AuthDBGroupFile.

AuthName

Realm

See previous note for AuthDBGroupFile.

AuthType

AuthBasic

In Apache, AuthType is usually set to Basic. The corresponding IIS 5.0 metabase property is AuthBasic. To configure authentication, right-click the virtual directory for which you want to set authentication, click Properties, and then click Directory Security. In the Enable anonymous access and edit the authentication methods for this resource box, click Edit, and then choose an authentication method.

<Directory>

Not applicable

You'll need to migrate defined directives enclosed in this tag to the corresponding IIS 5.0 virtual directory.

<DirectoryMatch>

Not applicable

You'll need to migrate defined directives enclosed in this tag to the corresponding IIS 5.0 virtual directory.

<Files>

Not applicable

You'll need to migrate defined directives enclosed in this tag to the corresponding IIS 5.0 virtual directory.

<FilesMatch>

Not applicable

You'll need to migrate defined directives enclosed in this tag to the corresponding IIS 5.0 virtual directory.

<Limit>

Not applicable

There is no equivalent in IIS 5.0.

<LimitExcept>

Not applicable

There is no equivalent in IIS 5.0.

<Location>

Not applicable

You'll need to migrate defined directives enclosed in this tag to the corresponding IIS 5.0 virtual directory.

<LocationMatch>

Not applicable

You'll need to migrate defined directives enclosed in this tag to the corresponding IIS 5.0 virtual directory.

Options, ExecCGI

AccessExecute

You can set most of the IIS 5.0 equivalents of the Options parameter by enabling execution or script permissions for any virtual directory. To do this, in the IIS snap-in right-click the directory for which you want to set permissions, and then click Properties. Click the Home Directory tab, and then set permissions in the Execute Permissions box.

Options Indexes

EnableDirBrowsing

To enable users to view directory contents, in the IIS snap-in right-click the directory for which you want to enable browsing, and then click Properties. Click the Home Directory tab, and then select the Directory browsing check box.

Server status reports

Not applicable

IIS 5.0 does not provide server status reports.

Migrating Custom Modules

In Apache, custom modules extend the capabilities of the Web server. With IIS 5.0, there kkare a number of options for extending server capabilities. There is no direct way to migrate a custom module, so it must be recreated in IIS 5.0 using one of the following approaches:

  • ASP with COM components or ISAPI DLLs can be written to duplicate most of the desired functionality, such as database or file system access. There are a number of built-in ASP objects to speed this task, such as FileSystemObject, which provides the methods, properties, and collections you use to access the file system.

  • ISAPI filters allow you to implement custom authentication and logging, as well as URL rewriting, or "munging."

For more information about using these technologies, see the IIS 5.0 section of the SDK documentation on MSDN.

Appendix D. PHP IDEs for Linux and Windows

PHP IDE for Linux Only

On Windows

PHP IDE for Windows Only

PHP IDE for Both Windows and Linux

  • PHP editor (for both Windows and Linux/UNIX) (rating 5 stars).

  • HTML/PHP editors Amaya

  • Folding text editor (Windows and Linux)

  • PHP Editor (Windows and Linux)

  • Color editor gvim for PHP (Windows and Linux) at and see also "ptags of PHP"

  • Jed (Windows and Linux)

Editors for PHP

https://www.itworks.demon.co.uk/phpeditors.htm

https://www.oodie.com/index.php?m=tools&sm=editors&p=index