> For the complete documentation index, see [llms.txt](https://docs.cloudeka.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cloudeka.ai/deka-gpu-documentations/panduan-untuk-enterprise/deka-box/create-static-web-in-s3.md).

# Membuat situs web statis di S3

Dokumen ini menjelaskan cara membuat situs web statis di S3. Fitur Static Web Hosting memungkinkan Anda menghosting situs web statis di Deka Box. Ikuti langkah berikut untuk membuat situs web statis di Deka Box.

Anda perlu membuat dan mengunggah dokumen indeks untuk situs web statis. Dokumen indeks adalah halaman web yang disebut sebagai halaman bawaan.

Buat file `index.html`. Jika belum memiliki file `index.html`, gunakan HTML berikut untuk membuatnya:

```
<!doctype html>
<html>
  <head>
     <title>This is the title of the webpage!</title>
  </head>
  <body>
     <p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p>
  </body>
</html>

```

Simpan file indeks secara lokal.

Unggah file `index.html` ke bucket. Setelah itu, konfigurasi bucket policy untuk mengizinkan akses anonim ke situs web statis. Buka S3 Browser di komputer Anda.

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXf1dcP15qN_QR11dnaLgPzTVT293xXDCv-QLJJeiszVdyTcxFg_cylS7xTk-klRi7GfyZBu7yi-djkrbg0m94suT-jfnA6TmT7Kt5s8ZPGMZJ6VRjuolLduq3mXaferJWjnyvFB0xBY9yeg1nnJrBkF1b2V?key=eSucCgatcev0YHFI_1aohA" alt=""><figcaption></figcaption></figure>

Di S3 Browser, klik ***Bucket***, lalu pilih ***Edit Bucket Policy**.* Izinkan pengguna anonim mengakses situs web statis.

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXdRBclycQVSwtGZCe-rzJSNBurTHsBZCrzF717aPpJ6ozMT2tkwY40sgO97qjjipsX4xkXnaBQxlQbA6pJH4MoDYJfypBRkKO4hbGt9al8Hi5jrbwHWub2SeP2149igFMYH9oz09p85LkDmDYi7LIdqx9in?key=eSucCgatcev0YHFI_1aohA" alt=""><figcaption></figcaption></figure>

Pada ***Bucket Policy Editor***, buat sintaks kebijakan seperti contoh berikut.

```
{ 
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": "*",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "urn:sgws:s3:::bucket-ubuntu",
        "urn:sgws:s3:::bucket-ubuntu/*"
      ]
    }
  ]
}
```

{% hint style="warning" %}
Sesuaikan `ubuntu-bucket` dengan nama bucket Anda.
{% endhint %}

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXffZ9DFIUM2BWNJFwbJfwhtphRz4fsNeLE_M5TiJXc--xcfNiKI_68BDsDdxUvBMzmZZUXxSOoVcgKrW5n2jkKv-ERF0S_LNw1yQWq0SbVqk455xxP6LEpUakZhlkKGQBFxbJZDzEDIcYeE15e8DOWc3nfD?key=eSucCgatcev0YHFI_1aohA" alt=""><figcaption></figcaption></figure>

Uji akses situs web statis menggunakan URL berikut sebagai contoh:

```
https://bucket.cloud.lintasarta.co.id:8082/bukcket-ubuntu/index.html
```

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXdTPIwu3w3KjI0IqCHQemtDhPvhNk-g3axzGB86pP2BLhl86ifnj7LhulwQ9xxbxAast9v7GbDxl38x3ckZ2J6a5R6zbWf3vFmHNel_vBYDHSxFdJ3Zll1kHrmB7Zlw13QxGV1TqWUMTbopQB5J85I9j_kU?key=eSucCgatcev0YHFI_1aohA" alt=""><figcaption></figcaption></figure>

Bucket kini menghosting situs web statis Anda.
