GZWeb 1.4.0 only displaying text and broken images
I was able to setup gzserver and gzweb with few if any problems, but when I check the online site, I see this:
That's showing in both Firefox and Chrome. I did notice npm saying one package wasn't compatible with Ubuntu 16.04, and that another wasn't going to be installed but was optional. I tried using "npm bug gzweb" to get more details on the bugs, but it came back as "Not found : gzweb". Running "npm start" also seems to give no errors.
Viewing the source of the webpage though, I wonder if it's expecting me to run in localhost. Are there extra steps that should be taken when setting it up on an actual webserver? Other than the apache2 ProxyPass stuff with password protection?
I'm using Ubuntu Server 16.04.5 LTS with Gazebo 7.14.0 and gzweb 1.4.0.
Asked by SimLeek on 2018-11-12 16:49:41 UTC
Answers
I found it!
In /etc/apache2/sites-available, my site_blah.conf file was originally configured like this:
ProxyPass /world http://localhost:8083/
ProxyPassReverse /world http://localhost:8083/
ProxyPass /gzserv http://localhost:11345/
ProxyPassReverse /gzserv http://localhost:11345/
ProxyPass /ros http://localhost:11311/
ProxyPassReverse /ros http://localhost:11311/
ProxyPass /roswww http://localhost:8085/
ProxyPassReverse /roswww http://localhost:8085/
So gzweb showed up when I went to website.com/world, as if the whole site were a single file. So when I changed it to this:
ProxyPass /world/ http://localhost:8083/
ProxyPassReverse /world/ http://localhost:8083/
ProxyPass /gzserv/ http://localhost:11345/
ProxyPassReverse /gzserv/ http://localhost:11345/
ProxyPass /ros/ http://localhost:11311/
ProxyPassReverse /ros/ http://localhost:11311/
ProxyPass /roswww/ http://localhost:8085/
ProxyPassReverse /roswww/ http://localhost:8085/
It loaded index.html and everything else, instead of just index.html.
Asked by SimLeek on 2018-11-13 21:45:11 UTC
Comments
On the browser's network tab, can you check where it is trying to get the CSS and JS files from, and whether you're serving them on that same URL?
Asked by chapulina on 2018-11-13 13:47:55 UTC
Ah, it's expecting website.com/style/gz3d.css, but it's at website.com/gzweb/style/gz3d.css, because I'm using proxypass to set up multiple services on the server. I'll have to edit that.
Also, I may need to add some more stuff to allow web sockets through.
Asked by SimLeek on 2018-11-13 21:17:19 UTC
I'd love to edit the answer I gave so it's nice, searchable text, but I guess that's also going to have to wait for moderator approval. It should still be searchable enough though, i suppose.
Asked by SimLeek on 2018-11-13 21:48:58 UTC