Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openseadragon doesn't work #33

Closed
ruebot opened this issue Apr 30, 2015 · 18 comments
Closed

Openseadragon doesn't work #33

ruebot opened this issue Apr 30, 2015 · 18 comments
Labels

Comments

@ruebot
Copy link
Contributor

ruebot commented Apr 30, 2015

Need to setup proxy passes for djatoka...

@ruebot
Copy link
Contributor Author

ruebot commented May 1, 2015

Some work done here #34

@whikloj
Copy link
Contributor

whikloj commented May 2, 2015

Problem seems to be that Islandora (being the server) sees the valid Djatoka URL as http://localhost:80/adore-djatoka but then it uses that address to server OpenSeadragon tiles, and that address is invalid outside the VM.

Is there are reason we are using port 8000 instead of port 80? Or perhaps we should change the default apache port to 8000 as well.

@ruebot
Copy link
Contributor Author

ruebot commented May 5, 2015

Yeah, we need to change the default port. I'm doing a build now, and will push if need be.

@ruebot
Copy link
Contributor Author

ruebot commented May 5, 2015

31bdc12 should do it. Just need a sanity test and verify.

Islandora OpenSeadragon still isn't enabled at the end of the build. I had to go in and drush openseadragonplugin and drush en islandora_openseadragon.

@ruebot ruebot closed this as completed in acbf5d4 May 9, 2015
@ruebot ruebot added the bug label May 11, 2015
@mjordan
Copy link
Contributor

mjordan commented May 26, 2015

I'm still having problems with OpenSeadragon (at 694932f). It wasn't rendering images, so I tried the two commands that @ruebot describes above. Here is the output, still with no working viewer (also ran the first one with sudo):

vagrant@islandora:/var/www/drupal/sites/all/modules$ drush openseadragonplugin
unlink(openseadragon/LICENSE.txt): Permission denied filesystem.inc:132                                                 [warning]
unlink(openseadragon/LICENSE.txt): Permission denied filesystem.inc:132                                                 [warning]
Destination directory openseadragon already exists.                                                                     [error]
Unable to move openseadragon-bin-0.9.129 to openseadragon.                                                              [error]
Openseadragon plugin has been installed in /var/www/drupal/sites/all/libraries                                          [success]
vagrant@islandora:/var/www/drupal/sites/all/modules$ drush en islandora_openseadragon
islandora_openseadragon is already enabled.                                                                             [ok]
There were no extensions that could be enabled.                                                                         [ok]

I'd be happy to help troubleshoot this, but I've never dug into OpenSeadragon before. Any ideas?

@ksclarke
Copy link
Contributor

When I run without sudo it doesn't work, but when I run with sudo it does:

vagrant@islandora:/var/www/drupal/sites/all/modules/islandora_paged_tei_seadragon$ drush openseadragonplugin
unlink(openseadragon/LICENSE.txt): Permission denied filesystem.inc:132                                                                                           [warning]
unlink(openseadragon/LICENSE.txt): Permission denied filesystem.inc:132                                                                                           [warning]
Destination directory openseadragon already exists.                                                                                                               [error]
Unable to move openseadragon-bin-0.9.129 to openseadragon.                                                                                                        [error]
Openseadragon plugin has been installed in /var/www/drupal/sites/all/libraries                                                                                    [success]
vagrant@islandora:/var/www/drupal/sites/all/modules/islandora_paged_tei_seadragon$ sudo drush openseadragonplugin
Openseadragon plugin has been installed in /var/www/drupal/sites/all/libraries

I think we're a little all over the map with file permissions on this box. Some files/dirs in modules and libraries are owned by vagrant:vagrant others by root:root and yet others by vagrant:web. Planning on submitting a different ticket to have the whole file system (except Drupal files dir and related) consistently owned, but for the purposes of this ticket I do notice openseadragon is a root:root one on my instance (so sudo would be needed).

@mjordan
Copy link
Contributor

mjordan commented May 26, 2015

Still no luck for me with sudo drush openseadragonplugin (also disabled then re-enable the module):

sudo drush openseadragonplugin Openseadragon plugin has been installed in /var/www/drupal/sites/all/libraries [success]

I can confirm that /var/www/drupal/sites/all/libraries/openseadragon/ exists though.

@ksclarke
Copy link
Contributor

So, you don't get the error with sudo but the viewer still doesn't work on a page?

Do you get any Javascript errors on the page (or does Chrome network tools, or whatever, show any additional information... like some AJAX call that's getting a 404 response)?

@mjordan
Copy link
Contributor

mjordan commented May 26, 2015

That's correct. I've cleared my cache as well, just to be sure.

@ksclarke
Copy link
Contributor

Does this work for you? If it does, I'd say take a look at the output from Chrome's network tools + javascript console as a next step.

@mjordan
Copy link
Contributor

mjordan commented May 26, 2015

Yes, thanks, when I change the localhost port to (host) localhost:8001 (which is where I am running Apache) in that URL, I can see that map of Arizona and New Mexico.

Since I'm also running Tomcat on a non-standard port, (host) localhost:8081, I changed the djatoka proxy lines in apache's config file to use that port, just to see what would happen:

ProxyPass /adore-djatoka http://localhost:8081/adore-djatoka
ProxyPassReverse /adore-djatoka http://localhost:8081/adore-djatoka

But, after restating apache, it still doesn't work. On guest, Tomcat is running on port 8080.

@mjordan
Copy link
Contributor

mjordan commented May 26, 2015

Tailing my apache access log I see the following request:

10.0.2.2 - - [26/May/2015:20:40:21 +0000] "GET /adore-djatoka/resolver?url_ver=Z39.88-2004&rft_id=http%3A%2F%2Flocalhost%3A8001%2Fislandora%2Fobject%2Fislandora%253A45%2Fdatastream%2FJP2%2Fview%3Ftoken%3D4aa95376541dd4e8b2ff9022422d835d3104cb6853e99e579c19dac931ecb4aa&svc_id=info%3Alanl-repo%2Fsvc%2FgetMetadata HTTP/1.1" 404 1176 "http://localhost:8001/islandora/object/islandora%3A45" "Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.76 Safari/537.36"

There is a 404 in there for /adore-djatoka/resolver though. Port seems to be alive or there wouldn't be a response, so it must have to do with the proxy configuration. I'll play around a bit more and report back.

EDIT: Just tailed the log and refreshed the request that you gave me (to render the Arizona map) and there's a 200 response code in the access log for /adore-djatoka/resolver.

@mjordan
Copy link
Contributor

mjordan commented May 27, 2015

Got it to work by running apache on guest and host 8000. I'll continue to look into why changing the host's port breaks it (but not anything else, presumably).

@ruebot
Copy link
Contributor Author

ruebot commented May 27, 2015

Correct. Apache runs on port 8000 on this box because of VirtualBox restrictions, and the reverse proxy setup in the apache config uses that port.

@ksclarke
Copy link
Contributor

@mjordan Had you changed the port 8000 in Vagrantfile too? I don't understand Vagrant port mapping / handling, but noticed there is a setting in there too.

@mjordan
Copy link
Contributor

mjordan commented May 27, 2015

Up until about two builds ago I've only been using my laptop as a host with the following port mappings in Vagrantfile:

  config.vm.network :forwarded_port, guest: 8080, host: 8081 # Tomcat
  config.vm.network :forwarded_port, guest: 3306, host: 3307 # MySQL
  config.vm.network :forwarded_port, guest: 8000, host: 8001 # Apache

I do that because all those ports are all taken already on my host laptop. OpenSeadragon is the only thing that I've found doesn't work with those modified host ports. Doing a grep -r in the vagrant directory, I see that 8000 is hard-coded in a couple of apache config files:

scripts/drupal.sh:sed -i 's#<VirtualHost \*:80>#<VirtualHost \*:8000>#' $APACHE_CONFIG_FILE
scripts/drupal.sh:sed -i 's/Listen 80/Listen \*:8000/' /etc/apache2/ports.conf
scripts/drupal.sh:sed -i "/Listen \*:8000/a \
scripts/drupal.sh:NameVirtualHost \*:8000" /etc/apache2/ports.conf 

Which I assume is why the port mapping in the Vagrantfile is being ignored.

@ksclarke
Copy link
Contributor

I've created a ticket to pull out things like ports (usernames, passwords, etc.) into variables: #70

@whikloj
Copy link
Contributor

whikloj commented May 27, 2015

The problem here is that you need both the outside and inside Tomcat on the same port, because the Tomcat builds the request using the port you define inside and sends it out to your browser which initiates the Ajax call.

So if your Drupal setup works with port 8080, but your external browser use 8081 then you will never see the page because your ajax call for the tiles is using 8080.

Not sure if I am explaining myself clearly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants