MFP Windows IIS

From HTPC How-To's
Jump to: navigation, search

This guide assumes you already have IIS Installed with PHP (including PHP_Curl) installed and configured. If not, please visit IIS Install first. Some of these steps are not required, but added to help ensure an error free install.

Prerequisites

Windows 7 (Professional OR Ultimate) / Windows Server 2008 R2º
Microsoft IIS 7.5 or Higher
PHP 5.2
Microsoft WebMatrix (Formally named "Microsoft Web Platform")
Python 2.7 (for SickBeard, CouchPotato, etc.) {For now, go to guides for SB, CP, etc. for Python related help}

ºAlthough Windows XP Pro and Vista (Pro/Ultimate) have the ability to install IIS, they are NOT supported by this guide.

Decisions

  • IIS Solely for MediaFrontPage and other HTPC related software:
    • Please be advised you'll have a much easier experience running Uniform Server or some other Apache based server.
  • IIS With Multiple Purposes:
    • If you have other needs for IIS you need to determine if you want your install of MediaFrontPage available publicly on the internet or not.
      • MFP (Private): Disable port forwarding on your router.
      • MFP (Public): Setup port forwarding on your router and make sure to configure the built in MFP Security.
        • Port Forwarding will NOT be covered here.

MediaFrontPage (Standalone)

By default when you install IIS your "Web Root" will be located on "%SystemDrive%\Inetpub\wwwroot" which in most cases translates to "C:\Inetpub\wwwroot\". Pending on how you obtain MediaFrontPage (via Git or download in *.zip format from Github) the simplest way to run MediaFrontPage is to place the files directly into the wwwroot folder which will allow you to view it from the following URL's:

On the local IIS machine:

http://localhost
http://SYSTEMNAME   (Example: http://xbmc)
http://IPADDRESS    (Example: http://192.168.1.2)

Other systems on local network:

http://SYSTEMNAME   (Example: http://xbmc)
http://IPADDRESS    (Example: http://192.168.1.2)

MediaFrontPage (Non-Standalone)

If you already have (or are planning) on additional sites being hosted by IIS, you'll want to use either a sub-directory or virtual directory to house the required files so that they aren't in your Web Root.

Sub-directory

Start by creating a directory inside the Web Root (wwwroot) called mediafrontpage and place the required files inside this directory instead of wwwroot.

On the local IIS machine:

http://localhost/mediafrontpage
http://SYSTEMNAME/mediafrontpage (Example: http://xbmc/mediafrontpage)
http://IPADDRESS/mediafrontpage  (Example: http://192.168.1.2/mediafrontpage)

Other systems on local network:

http://SYSTEMNAME/mediafrontpage (Example: http://xbmc/mediafrontpage)
http://IPADDRESS/mediafrontpage  (Example: http://192.168.1.2/mediafrontpage)

Virtual Directory

IIS allows you to essentially use any directory to house web files that can be accessed by using Virtual Directories. This can be done for file organization or more importantly, if you aren't that familiar with Git and it downloaded MediaFrontPage's files into your User folder, you can just use that folder in IIS and not have to remember to copy the files over after every update you do.

To create your virtual directory, open IIS and right click on "Default Web Site" and click "Add Virtual Directory". In the window that opens, make sure the path is `/` and remember, whatever name you put into the Alias box will act like a directory (Example: 'Alias = mediafrontpage' will result in the same URL's listed for the directory section above). When you browse for the Physical Path, as long as you don't select a folder that is somehow protected (inside your private User folder) you should be able to skip the "Connect as..." button.

This section will be expanded on once the remaining migration is complete

Security

IIS

IIS offers a few forms of security that you can mix and match based on your needs. Similar to the .htaccess that Apache uses, IIS has a file called web.config. However, these files are very different and you can't just copy the contents from one to the other or just rename them.

The recommended option is to force "Windows Authentication" so that even when viewed from outside your network you can use the same Username/Password that logs you into Windows: (This example turns on Windows Authentication while turning off Anonymous Authentication)

<location path="mediafrontpage">
   <system.webServer>
      <security>
         <authentication>
            <anonymousAuthentication enabled="false" />
            <windowsAuthentication enabled="true" />
         </authentication>
      </security>
   </system.webServer>
</location>

Windows Authentication

This "Role" is not available by default and must be added prior to use.

Windows Server 2008 R2
  1. Close IIS if open
  2. Start -> Administrative Tools -> Server Manager
  3. In Server Manager expand Roles and click Web Server (IIS)
  4. In Web Server (IIS) scroll to Role Services and click Add Role Services
  5. On the Select Role Services page of the Wizard, select Windows Authentication and click Next
  6. On Confirm Installation Selections click Install
  7. Close the Results page
Windows 7
  1. Close IIS if open
  2. Start -> Control Panel -> Programs and Features -> Turn Windows Features on or off
  3. Expand Internet Information Services -> World Wide Web Services -> Security
  4. Select Windows Authentication and click OK
Windows Server 2008 R2 AND Windows 7
  1. Open IIS and in the Connections pane, expand the Server name, expand Sites
  2. Select (click) either the Site or Directory where MediaFrontPage is located and go to Security in the Home pane
  3. Double click Authentication -> Windows Authentication -> Click Enable in the Actions pane

MediaFrontPage

Newer versions include built in authentication that allow you to configure a standard Username/Password via the configuration interface. For slightly older versions of MFP, you can manually edit the config.php and change $AUTH_ON from false; to true; and make sure to add your desired Username/Password as well.

Built In Authentication Variables:

$AUTH_ON         = false;
$AUTH_USERNAME   = '';
$AUTH_PASS       = '';

Final Configuration

With the host set up and secure, it's time to test drive your fresh install. Open your web browserº and go to the link determined from the steps above. You should be met with the "First Run" screen that will check your setup (PHP, LibXML, cURL, your config and layout files, etc.) and if there are any errors it will let you know so you can fix it, if all goes well, click "Continue" and you'll be greeted with the main page.

º Internet Explorer is NOT supported since it causes aspects of MFP to break (among thousands of other sites) so we recommend using Firefox or Google Chrome

Personal tools