x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Trying to host HTML5 game on Apache server, failing to load blob.

We are trying to get our 4.9.2 HTML5 game online on an Apache server. We have tried to follow all instructions we could find as far as setting up the server for hosting aan HTML5 game in a production setting.

No matter what we do, we get this error:
When the browser is trying to load the url with blob:http protocol, it is failing or getting the wrong data from the file resulting in the error "SyntaxError: expected expression, got '<'"

(I am posting this on behalf of the person on the team who's actually dealing with the server. I will try to get more information from him as to how he's got the server configured. As far as I know, he has not made any changes to the files generated in the build process, so I don't know why he would be getting a syntax error of all things.)

We have already looked at this thread and it has not solved our problem.

Thanks for any help or advice.

Product Version: UE 4.9
Tags:
more ▼

asked Dec 11 '15 at 09:37 PM in Packaging & Deployment

avatar image

Aranjah
1 1 2 3

avatar image Aranjah Dec 15 '15 at 06:26 PM

I have updated information on the actual server configuration being used:


I have tried multiple configurations but the most basic is the "default" apache install, installed through apt-get, on an Ubuntu 14.04 server with .htaccess set to

 <Directory /var/www>
     AddEncoding gzip gz
 </Directory>


Have also tried .htaccess as following

 <Files .gz>
     AddEncoding gzip gz
 </Files>




avatar image Adam Davis STAFF Dec 16 '15 at 02:47 PM

HI Aranjah,

avatar image Aranjah Dec 16 '15 at 05:40 PM

It is a clean apache install on Ubuntu, with just the one .htaccess edit that is mentioned in the Readme that is generated when the project is built. We have also tried it with the

  <files *.gz>
  AddType "text/javascript" .gz
  AddEncoding gzip .gz
  </files>

that is posted as the solution in the other thread I linked in the original post, because that thread seemed to be nearly identical to the error we're getting. I suspect the solution to the problem is some other equally small configuration change, but we are at a loss as to what else to try.

We had not previously tried it with a blank project since our project worked just fine with the HTML5LaunchHelper when testing locally. Today we tried with a blank project and with the default map with the two chairs & table, and got the same problem.

The error appears to be referring to a character inside the blob file itself, as if it is downloading and unzipping the .gz correctly and then erroring on the resulting file somewhere, as far as we can tell.

I followed the linked Getting Started documentation when setting up the project initially, and the project builds and runs locally just fine, but I don't see anything in the official documentation that relates to deployment.

avatar image Adam Davis STAFF Dec 16 '15 at 06:53 PM

Did you try the full solution listed on the forum thread linked in the other answerhub post? It can be found here:

https://forums.unrealengine.com/showthread.php?87438-html5-SimpleHTTPServer-how-to-run-another-server

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi Aranjah,

We have not heard from you in several days. I am marking this as answered for tracking purposes, if you are still experiencing this error, please comment with the requested information.

more ▼

answered Dec 21 '15 at 02:44 PM

avatar image Aranjah Dec 21 '15 at 03:07 PM

We are still in the process of trying out the suggestions in the forum thread you linked and in another post I found somewhere else on the site. As of right now, this problem remains unsolved. I will be responding again with specifics once we verify whether or not any of these new solutions solved our problem.

avatar image Adam Davis STAFF Dec 24 '15 at 05:47 PM

Hi Aranjah,

Have you been able to work through all of the suggestions?

avatar image Aranjah Jan 05 '16 at 04:40 PM

Yes, we have now (finally) tried all of the listed suggestions, and none seem to have worked.

avatar image Adam Davis STAFF Jan 05 '16 at 05:48 PM

Have you tried to host the project in any other environment, or only on Ubuntu with an Apache server? It would be beneficial to know if this is limited to one specific server type.

avatar image Aranjah Jan 05 '16 at 06:35 PM

We have only tried it with Ubuntu/Apache so far. Might be worth mentioning that it is actually Ubuntu running in a virtual machine, not a separate dedicated computer. That isn't going to be our final server setup, but we wanted to get something set up to at least be able to test our game/show proof of concept, and setting up an actual, physical server isn't an option for us yet.

avatar image Adam Davis STAFF Jan 05 '16 at 09:32 PM

Hi Aranjah,

I did a bit of digging and found that the Directory directive is not used in the .htaccess file, so that can be removed. Additionally, remove AddType "text/javascript" .gz

The .htaccess file should be generated on packaging, so you should not have to create one. Additionally, in 4.10, the file extensions have been changed to the following:

.jsgz .datagz .memgz .symbolsgz

These extensions are special cased and help the browser load and run the files properly. These do not include XML encoding. A sample has been provided below:

AddType application/x-javascript .jsgz
AddType application/octet-stream .datagz

RewriteEngine on # If client accepts compressed files RewriteCond %{HTTP:Accept-Encoding} gzip # and if compressed file exists RewriteCond %{REQUEST_FILENAME}gz -f # send .ext.gz instead of .ext RewriteRule ^(.+).(mem|js|data|symbols)$ $1.$2gz

AddEncoding gzip .jsgz AddEncoding gzip .datagz AddEncoding gzip .memgz AddEncoding gzip .symbolsgz

Please let me know if this addresses your error.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question