> 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/guideline-for-enterprise/panduan-untuk-enterprise/deka-metal/deka-metal-deka-box/create-static-web-in-s3.md).

# Buat 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*.

Buat dan unggah dokumen indeks untuk situs web statis Anda. Dokumen indeks adalah halaman web yang berfungsi sebagai halaman default.

Buat file `index.html`. Jika Anda belum memilikinya, 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* Anda. Kemudian, konfigurasikan kebijakan *bucket* 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>

Pada *S3 Browser*, klik ***Buckets***, lalu pilih ***Edit Bucket Policy***. Konfigurasi ini mengizinkan 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" %}
Ganti `bucket-ubuntu` 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, misalnya:

```
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* Anda sekarang menghosting situs web statis.
