본문으로 바로가기

Unity 3D WebGL 배포시 Apache 설정(2.4기준)

category JAVA/TIP 2021. 4. 21. 12:09

여기저기 구글링 하다가 잘 되길래 다음에 써먹고자 흔적을 남김..
웹어셈블리 기술이 점점 확대되어 가는거 같네요..C++로 배포하는 샘플도 있던데 C# 으로 짠 소스들도 안되나;;
오랜만에 두뇌 회전시키려니 부하가;;

  1. Apache 2.4 기준 ( 2.2는 안됨..왜 안될까요?)
  2. gzip 설정
    https://www.playnexacro.com/#show:techtip:182 에서 아래 내용 설정

    Apache httpd.conf 파일의 LoadModule 영역에서 아래내용에 주석처리 되었으면 해제합니다.
    ​LoadModule dir_module modules/mod_dir.so
     아래 2줄을 주석처리 되어있으면 해제합니다.
    AddEncoding x-compress .Z AddEncoding x-gzip .gz .tgz
      아래 2줄을 주석처리 합니다.
    #AddType application/x-compress .Z
    #AddType application/x-gzip .gz .tgz
 

play nexacro:플레이 넥사크로

Play Nexacro is a community site for nexacro platform. 넥사크로 플랫폼 사용자 커뮤니티

www.playnexacro.com

    3. .htaccess 아래 설정 참조해서 Build 폴더에 추가 한다.
         Unity - Manual: WebGL: Server configuration code samples (unity3d.com)

 

Unity - Manual: WebGL: Server configuration code samples

WebGL: Compressed builds and server configuration WebGL Browser Compatibility WebGL: Server configuration code samples The code samples below show how to configure your server when working with WebGLA JavaScript API that renders 2D and 3D graphics in a web

docs.unity3d.com

아래 이미지와 같이 잘 나오는지 확인 한다.