Skip to content

Instantly share code, notes, and snippets.

@zdienos
Last active May 17, 2024 06:16
Show Gist options
  • Save zdienos/fd63c285e7c1b352943a73c8bcd7cb06 to your computer and use it in GitHub Desktop.
Save zdienos/fd63c285e7c1b352943a73c8bcd7cb06 to your computer and use it in GitHub Desktop.
Custom Multiple Domain on Local Host

Setup Custom Domain di Virtual Host!

Silahkan edit file /etc/apache2/apache.conf apache

sudo pico /etc/apache2/apache.conf

sesuaikan lokasi folder untuk custom domain

<Directory /home/zed/Development/customdomain>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

Selanjutnya reload config apache

sudo systemctl reload apache2
atau
sudo systemctl restart apache2

Tambahkan config baru di sites-availalble

sudo pico /etc/apache2/sites-availabe/customdomain.conf

Setting custom folder dan domainnya

VirtualHost *:443>
    ServerName kumalagroup.local.dev
    ServerAlias kumalagroup.local.dev
    DocumentRoot /home/zed/Development/customdomain
    #ErrorLog /log/error.log
    #CustomLog /log/requests.log combined

    SSLEngine on

    SSLCertificateFile "/home/zed/Development/certs/local.dev.crt"
    SSLCertificateKeyFile "/home/zed/Development/certs/local.dev.key"

</VirtualHost>

Cek hasil konfigurasi

apachectl -S

Selanjutnya reload lagi config apache,

Selesai...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment