Setting up an API development environment


    This guide assumes you have downloaded and started the latest MindTouch Deki Wiki VMWare Virtual Appliance, available by clicking here: VMWare-Certified Virtual Appliance. Make sure the vm is running in bridged (not NAT) mode. 

                 

    Configure the Deki Wiki VMWare Virtual Appliance

    Move the code that comes with the appliance and checkout the latest trunk code from the MindTouch SVN repository:
    # mv /var/www/dekiwiki /var/www/dekiwiki-sf
    # svn co https://svn.mindtouch.com/source/public/dekiwiki/trunk/web/ /var/www/dekiwiki
    # mv /opt/deki /opt/deki-sf
    # svn co https://svn.mindtouch.com/source/public/dekiwiki/trunk /opt/deki

    Change permissions on the config directory by typing:

    # cd /var/www/dekiwiki
    # chmod a+w config 

                 

    Edit the file /etc/apache2/sites-available/dekiwiki,  and in the lines below replace localhost with the IP address of your Windows development machine.
    ProxyPass /@api http://localhost:8081 retry=1
    ProxyPassReverse /@api http://localhost:8081

    Note that if you want to avoid editing this file in the future due to IP changes, you can create a host entry in /etc/hosts and then use the host name instead.

                 

    Using your web browser, go to http://IP_ADDRESS, where IP_ADDRESS is the address of the virtual machine. Fill in the required information (where the database password is password), and click Install Deki Wiki. Follow the final instructions on the creation page.

                 

    Next, edit /var/www/dekiwiki/LocalSettings.php and add this line, changing WINDOWS_DEV_HOST to match the IP address of the Windows machine used above:
    $wgDreamServer = "http://WINDOWS_DEV_HOST:8081"

                 

    In order to allow outside access to the MySQL database, an external user permission must be added. Get to the MySQL prompt by typing:

    mysql -u root -p

    and use password as the password. Then, add external connectivity privileges by entering the following commands:

    GRANT ALL PRIVILEGES on *.* TO wikiuser@'%' IDENTIFIED BY 'password';

    FLUSH PRIVILEGES;

    quit

    Next, comment out the following line in /etc/mysql/my.cnf:

    bind-address 127.0.0.1

    Finally, restart mysql by typing:

    # /etc/init.d/mysql restart 

    Configure the XML File

    In your Windows system, get the latest trunk code by checking out https://svn.mindtouch.com/source/pub...dekiwiki/trunk to C:\mindtouch\public\dekiwiki\trunk (if using a release, unzip it and you'll have the equivalent of the trunk directory above).

         

    Download the xml file (mindtouch.deki.startup.xml) from below, rename it to my.mindtouch.deki.startup.xml, and put it in C:\mindtouch\public\dekiwiki\trunk\src\bin.

    Edit that file to change the first dbhostname in the file to the IP address of your Deki Wiki linux virtual appliance in the line below:

    <db-server>dbhostname</db-server>

            

    Configure Visual Studio and the MindTouchDeki Solution

    Open C:\mindtouch\public\trunk\src\MindTouchDeki.sln with Visual Studio and build the solution to create the necessary executable files.

    Then, right-click on mindtouch.deki project and click Properties. Open the "Debug" tab, check "Start External Program" and point it to C:\mindtouch\public\dekiwiki\trunk\src\bin\mindtouch.host.exe.

    Set the "Command line arguments" to:

    apikey 123 script my.mindtouch.deki.startup.xml path-prefix @api http-port 8081

         

    Set the "Working Directory" to: C:\mindtouch\public\dekiwiki\trunk\src\bin\.

    Click the "Play" button to start the API and start debugging.

         

    Lastly, in a web browser, go to http://IP_ADDRESS, where IP_ADDRESS is the IP of the Deki Wiki virtual appliance. You will see the DOS console screen in the Windows machine step through its' processes, confirming that the Deki Wiki Linux virtual appliance is speaking to the API running in Visual Studio.

         

    Tag page

    Files 1

    FileVersionSizeModified 
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by