Changes between Version 127 and Version 128 of doc/meek


Ignore:
Timestamp:
Sep 22, 2014, 7:24:55 AM (5 years ago)
Author:
dcf
Comment:

How to set up Azure.

Legend:

Unmodified
Added
Removed
Modified
  • doc/meek

    v127 v128  
    130130=== Microsoft Azure ===
    131131
     132{{{
     133$ wget -q -O - https://ajax.aspnetcdn.com/ --header 'Host: az668014.vo.msecnd.net'
     134I’m just a happy little web server.
     135}}}
     136
    132137Azure is a cloud computing platform with a [https://azure.microsoft.com/en-us/services/cdn/ CDN].
    133138
     
    149154 * http://azure.microsoft.com/en-us/pricing/free-trial/
    150155
    151 Working on deploying on Azure: #13189.
     156Here's how to set up Azure. Azure's CDN is not a general-purpose CDN: it can only point to domains running on Azure. Just as with App Engine, we need to run a tiny "reflector" app on the platform itself, one that simply copies requests and forwards them to an external meek-server. Azure has three main kinds of service: [http://azure.microsoft.com/en-us/documentation/articles/choose-web-site-cloud-service-vm/ Azure Websites, Cloud Services, and Virtual Machines]. Probably any one of the three works fine as a reflector. With a VM you could also just run the bridge directly on Azure. These instructions are for setting up an Azure Website, which gives you a subdomain of azurewebsites.net.
     157
     158 * [https://azure.microsoft.com/en-us/documentation/articles/web-sites-python-configure/ Configuring Python with Azure Websites]
     159 * [https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/ Publishing to Azure Websites with Git]
     160 * [http://msdn.microsoft.com/en-us/library/azure/gg680301.aspx How to Enable the Content Delivery Network (CDN) for Azure]
     161
     162Log in at https://manage.windowsazure.com/. Click New→Compute→Web Site→Quick Create, then enter a name. I used "meek-reflect". Click the site name to get to the Quick Start screen. Click "Set up deployment from source control". Choose the Local Git option and set your user name and password. Note the push URL. Click the Configure tab. Turn off PHP and turn on Python 2.7. Under "app settings", set
     163 * PYTHONPATH=D:\home\site\wwwroot\reflect
     164 * WSGI_HANDLER=reflect.main
     165Under "handler mappings", make the first line be
     166{{{
     167*       D:\python27\python.exe  D:\python27\scripts\wfastcgi.py
     168}}}
     169Under "virtual applications and directories", make the first line be
     170{{{
     171/       site\wwwroot\reflect    ✓
     172}}}
     173
     174Now set up your local Git repository and push to the deployment.
     175{{{
     176mkdir azure
     177cd azure
     178git init
     179mkdir reflect
     180cp ~/meek/wsgi/reflect.py reflect
     181git add reflect
     182git commit -m initial
     183git remote add azure https://<username>@<appname>.scm.azurewebsites.net:443/<appname>.git
     184git push azure master
     185}}}
     186
     187Now the code is running and you can use the URL !https://''appname''.azurewebsites.net/ in your meek configuration. In order to protect the domain, you have to set up the CDN. From the main screen, click New→App Services→CDN→Quick Create and select the Azure Websites domain you created. Once the CDN endpoint is created, click on it and click "Enable HTTPS" at the bottom. It really does take about an hour before it starts working. Now you have an az''######''.vo.msec.net domain name that points to your ''appname''.azurewebsites.net domain, and you can front the former with any other Azure CDN domain such as ajax.aspnetcdn.com.
     188
     189Adding your own CDN endpoint appears to be necessary; i.e., you can't front your azurewebsites.net domain but you can front your CDN domain. I also couldn't get it to work with reflect.py installed directly in the D:\home\site\wwwroot domain; I had to put it in a subdirectory and edit "virtual applications and directories" to match.
    152190
    153191