axaroth / ushahidi-webapp

A webapp based on HTML5 to collect data and to send data to Ushahidi.
https://sites.google.com/site/onlineofflinewebapps/ushahidi-webapp
7 stars 2 forks source link

Integration with existing ushahidi instance #18

Open evoltech opened 12 years ago

evoltech commented 12 years ago

Hey I am trying to stand web app up on a server that is also hosting an ushahidi instance. The problem is that I can't seem to get it to work with apache. The mod-rewrite from the docs looks like this:

RewriteRule ^/oo-report/(.*) http://127.0.0.1:8080/$1 [P,L]

where the static python server is listening on 127.0.0.1:8080

I have this embeded in the vhost config for the ushahidi instance so all together it looks like this:

<VirtualHost *:80>                                                                         
  ServerName ushahidi.march-hare.org                                                       
  ServerAdmin evoltech@march-hare.org                                                      
  DocumentRoot <doc_root>                               
  LogLevel Debug                                                                           
  CustomLog <custom_log> combined                          
  ErrorLog <error_log>                              
  RewriteRule ^/oo-report/(.*) http://127.0.0.1:8080/$1 [P,L]                             
  <Directory "<doc_root>">                                
    Options Indexes FollowSymLinks                                                         
    AllowOverride All                                                                      
    Order allow,deny                                                                       
    Allow from all                                                                         
  </Directory>                                                                             
</VirtualHost>

In checking out the paster.log of the app and output from iptables I dont see any traffic coming through from apache to the app, but I am able to make requests directly (and confirmed issue 14). I additionally enabled mod_proxy thinking this would help, but it didn't. Do you have any idea why this is not getting passed through?

I am also not clear on how the app will determine which Ushahidi instance to publish to. Is this a configurable setting somewhere?

axaroth commented 12 years ago

I have to rewrite the documentation :)

The idea is to serve the oo-report on the same url of ushahidi to avoid xss errors so if ushahidi is on http://myushahidi.com/ the oo-report must be served on http://myushahidi.com/oo-report

At this moment we have the call to the API embedded on the javascript so you must check if in /www/resources/interview.db.js the api_url is correct:

var api_url = "/api"  // fix for your server

After the download of the web app the only interaction with the server will be the upload of reports to ushahidi using the value in api_url (excluding the check for the cache.manifest).

There is no configuration in ushahidi so you need to put a link somewhere in the portal.

evoltech commented 12 years ago

I also had to change how mod_proxy was configured allow from all and I had to enable proxy_http. This would all be good stuff to have in the docs.