This tutorial provides instructions on setting up the VM to use an external API, and how to configure Visual Studio for MindTouch API development. It assumes you already have a VM up and running with SSH access.
This example assumes you are working in C:\MindTouch\public\dekiwiki\trunk; if you want to use another location, just change all the paths below.
You can either get the latest and greatest code from SVN or you can use the code from any release.
ProxyPass /@api http://localhost:8081 retry=1 ProxyPassReverse /@api http://localhost:8081Modify it so that it points to your API machine, and not the VM. The best way to do this is to make sure that your VM is running in NAT mode and _not_ Bridged mode. Then, find out what the VM adapter's IP address is on your local machine and fill that in. The new lines might look something like this:
ProxyPass /@api http://192.168.47.1:8081 retry=1 ProxyPassReverse /@api http://192.168.47.1:8081(If you want to avoid editing this file in the future due to IP changes, just create a host entry in /etc/hosts and use the host name instead)
$wgDreamServer = "http://192.168.47.1:8081"
As part of the hyper-sensitive brute force approach to security taken by Vista, the concept of URI reservation was introduced (for what I'm guessing is an attempt to add a hoop for malware to jump through before listening on a socket that speaks HTTP). The Windows core http.sys library restricts the root namespace (i.e. '/') of HTTP URI's to require administrator access or explicit rights. Lots has been written about this, but you'll never know about it until you run into an issue. In Dream's case it's an Access Denied error when starting up as a non-admin.
This means that if you're going to be starting Dream from Visual Studio, then VS itself has to run as Admin. This causes some annoying problems, like not being able to drag in or out of the window from Explorer, as well as potentially serious security issues you may become victim of by running code as admin.
The proper way to fix it is to add a URL reservation for Dream. Download the HTTPNamespaceManger tool described here, unzip it, and run it as admin. Click Add and type the URL "http://{yourip}:8081/", where {yourip} is an IP that your UI is able to access as well (e.g. not localhost). Hit OK. Click Add, and type the username you generally use when running VS. Click OK, then OK again, and quit the tool.
Modify the mindtouch.host.exe command line startup arguments by appending "ip {yourip}:8081" with {yourip} substituted by the ip you entered above. Start the project again from within VS and hopefully the error is gone.
You now have the PHP side and MySQL database running off of the VM while the API is run through Visual Studio. Run the project and start working!
| Images 0 | ||
|---|---|---|
| No images to display in the gallery. |
Copyright © 2011 MindTouch, Inc. Powered by