Hi,
Just to help the community because I have searched few days in godot docs, and on the web.... 🙂
About
1) how to configure apache server in order to contains html5 export godot project
2) how to configure apache server in case of cross domain http requests that exits with 401 error code
1) in case of this message when lauching GODOT4 html5 project on Apache Server
"Error
The following features required to run Godot projects on the Web are missing:
Cross Origin Isolation - Check web server configuration (send correct headers)
SharedArrayBuffer - Check web server configuration (send correct headers)"
you can add in the .htaccess of your server
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
Header set Cross-Origin-Embedder-Policy "require-corp"
Header set Cross-Origin-Opener-Policy "same-origin"
</IfModule>
2) And in order to be able of doing Cross domain request on server that is protected by basic auth
I had to add also in .htaccess
SetEnvIfNoCase Request_Method OPTIONS noauth
<RequireAny>
<RequireAll>
Require env noauth
Require all granted
</RequireAll>
<RequireAll>
AuthType Basic
AuthName "Restricted Access"
AuthUserFile /home/..../.htpasswd
Require valid-user
</RequireAll>
</RequireAny>
This is needed because preflight htpp requests sended with OPTIONS method (that are launched in case of http requests in cross domains) exited with 401 error code.
This OPTIONS http requests are automatically sent by thepolicy when we code GET or POST 'complex" http request. These OPTIONS http requests do not contain authenticate header...
So this code indicate that the basic auth is not needed for http requests that used the OPTIONS method.