Community

Discussions  |  Feature Requests  |  Tips and Tricks

Sample demo PHP and Javascript code of creating your own Web Interface

#1Feb. 6, 2012 17:02:44

Jeremy Bar
Registered: 2011-01-05
Posts: 30

Sample demo PHP and Javascript code of creating your own Web Interface

The attached api-demo_v3.tar.gz tar file contains a small PHP / Javascript application that demonstrate how to connect to the Nimbula Director API from PHP.

You can follow those instructions to install this web application on an Ubuntu 10.04 server:

  1. Starting from an Ubuntu Lucid 10.04 system, install the following packages: (Might be similar for other Debian based distributions)
  2. sudo aptitude install php5-cgi php5-curl nginx
  3. Extract attached archive in the root folder, all paths are absolute to /
  4. cd / && sudo tar -zxf api-demo_v3.tar.gz
  5. Set up Nginx
  6. sudo rm /etc/nginx/sites-enabled/default
    sudo ln -s /etc/nginx/sites-available/demo /etc/nginx/sites-enabled/demo
    sudo service nginx restart
  7. Add the following line to /etc/rc.local
  8. /etc/init.d/php-fastcgi start
    and run:
    sudo /etc/init.d/php-fastcgi start
  9. Edit /var/www/api-demo.php and change the $api variable to point to the Nimbula Director API of your cluster.
  10. Point your browser at the IP address of the server running the web API.

Edited jeremy (Feb. 6, 2012 17:03:40)

Attachments: