| | 3 | This article will guide you through how to install Microsoft Internet |
---|
| | 4 | Information Services (IIS) and configure a new website running LiteCart. |
---|
| | 5 | For this guide we assume that you have already installed [PHP for Windows](https://windows.php.net/download). |
---|
| | 6 | |
---|
| | 7 | ## Install IIS |
---|
| | 8 | |
---|
| | 9 | If your machine isn't running IIS yet, you will need to install it. |
---|
| | 10 | This is usually done in the "Turn Windows features on or off" dialog. |
---|
| | 11 | |
---|
| | 12 | 1. Click your Windows START-menu button. |
---|
| | 13 | |
---|
| | 14 | 2. Type "Enable or disable Windows Features" |
---|
| | 15 | |
---|
| | 16 | 3. Navigate to "Internet Information Services" and enable the |
---|
| | 17 | following components: |
---|
| | 18 | |
---|
| | 19 | * World Wide Web Services -> Application Development Features -> "CGI" |
---|
| | 20 | * World Wide Web Services -> Common HTTP Features -> Default Document |
---|
| | 21 | * World Wide Web Services -> Common HTTP Features -> HTTP Errors |
---|
| | 22 | * World Wide Web Services -> Common HTTP Features -> HTTP Redirection |
---|
| | 23 | * World Wide Web Services -> Common HTTP Features -> Static Content |
---|
| | 24 | * World Wide Web Services -> Performance Features -> Dynamic Content Compression |
---|
| | 25 | * World Wide Web Services -> Security -> Request Filtering |
---|
| | 26 | |
---|
| | 27 | ![](windows_features_iis.png) |
---|
| | 28 | |
---|
| | 29 | 4. Click OK. |
---|
| | 30 | |
---|
| | 31 | ## Create a local domain |
---|
| | 32 | |
---|
| | 33 | If you intend to run this locally here is how we can create a new domain |
---|
| | 34 | used for local access: |
---|
| | 35 | |
---|
| | 36 | 1. Grab the Windows hosts file editor or |
---|
| | 37 | open Notepad as an administrator and edit |
---|
| | 38 | C:\Windows\System32\drivers\etc\hosts. |
---|
| | 39 | |
---|
| | 40 | 2. Create a new hostname e.g. *litecart.local* and assign it to the |
---|
| | 41 | local machine *127.0.0.1*. |
---|
| | 42 | |
---|
| | 43 | ## Configure IIS |
---|
| | 44 | |
---|
| | 45 | 1. Open IIS manager by right clicking Windows START-menu and selecting |
---|
| | 46 | Computer Management. |
---|
| | 47 | |
---|
| | 48 | 2. Navigate to Services and Applications -> Internet Information |
---|
| | 49 | Services. |
---|
| | 50 | |
---|
| | 51 | 3. Select (Local Computer) in the tree and double-click "Default |
---|
| | 52 | Document". Add "index.php" to the list |
---|
| | 53 | |
---|
| | 54 | 4. Select (Local Computer) in the tree and double-click "MIME Types" |
---|
| | 55 | and add extensions if missing: |
---|
| | 56 | |
---|
| | 57 | * .woff font/woff |
---|
| | 58 | * .woff2 font/woff2 |
---|
| | 59 | * .webp image/webp |
---|
| | 60 | |
---|
| | 61 | ## Setup a new IIS website |
---|
| | 62 | |
---|
| | 63 | Rewritten URLs will turn |
---|
| | 64 | **/index.php/**rubber-ducks-c-1/yellow-duck-p-1 into |
---|
| | 65 | **/**rubber-ducks-c-1/yellow-duck-p-1. To enable this we need to |
---|
| | 66 | make sure IIS has URL rewrite support installed and force enable |
---|
| | 67 | detection in LiteCart. |
---|
| | 68 | |
---|
| | 69 | 1. Open IIS manager by right clicking Windows START-menu and selecting |
---|
| | 70 | Computer Management. |
---|
| | 71 | |
---|
| | 72 | 2. Navigate to Services and Applications -> Internet Information |
---|
| | 73 | Services. |
---|
| | 74 | |
---|
| | 75 | 3. Expand (Local Computer) |
---|
| | 76 | |
---|
| | 77 | 4. Expand "Sites". |
---|
| | 78 | |
---|
| | 79 | 5. Right-click Sites and select New -> Web Site. |
---|
| | 80 | |
---|
| | 81 | 6. Give this new site the name LiteCart and the domain we created |
---|
| | 82 | litecart.local. |
---|
| | 83 | |
---|
| | 84 | ![](new_site_iis.png) |
---|
| | 85 | |
---|
| | 86 | 7. Select the new site "LiteCart" and Double-click Handler Mappings. |
---|
| | 87 | |
---|
| | 88 | 8. Select Add Module Mapping to configure a handler for PHP files: |
---|
| | 89 | |
---|
| | 90 | ![](php_handler_iis.png) |
---|
| | 91 | |
---|
| | 92 | ## Enable Rewritten URLs |
---|
| | 93 | |
---|
| | 94 | 1. Install the [URL Rewrite](https://www.iis.net/downloads/microsoft/url-rewrite) |
---|
| | 95 | Extension for IIS. |
---|
| | 96 | |
---|
| | 97 | 2. Open IIS manager by right clicking Windows START-menu and selecting |
---|
| | 98 | Computer Management. |
---|
| | 99 | |
---|
| | 100 | 3. Navigate to Services and Applications -> Internet Information |
---|
| | 101 | Services. |
---|
| | 102 | |
---|
| | 103 | 4. In the Connections tree select (Local Computer) -> Sites -> |
---|
| | 104 | LiteCart. |
---|
| | 105 | |
---|
| | 106 | 5. Double-click "URL Rewrite" -> Add Rule(s) -> Blank rule and |
---|
| | 107 | enter the following: |
---|
| | 108 | |
---|
| | 109 | ![](url_rewrite_iis.png) |
---|
| | 110 | |
---|
| | 111 | 6. Also under "URL Rewrite" click "View Server Variables" and add |
---|
| | 112 | the following: |
---|
| | 113 | |
---|
| | 114 | MOD_REWRITE |
---|
| | 115 | |
---|
| | 116 | 7. Install the add-on [Force Rewritten URLs](https://www.litecart.net/en/addons/236/force-rewritten-urls) |
---|
| | 117 | |
---|
| | 118 | ## Note |
---|
| | 119 | |
---|
| | 120 | If you haven't already, install [PHP Manager](https://www.iis.net/downloads/community/2018/05/php-manager-150-for-iis-10) |
---|
| | 121 | for IIS from here. Then you will see it in IIS Manager. |
---|