Sunday, December 4, 2022
Rocky Linux

Membuat virtual host Apache pada Rocky Linux

virtual

Pada kesempatan kali ini saya akan membahas cara Membuat virtual host Apache pada Rocky Linux.

Berikut langkah nya :

- config apache
nano /etc/httpd/conf.d/yourdomain.com.conf

<VirtualHost *:80>
    ServerName www.yourdomain.com
    ServerAlias yourdomain.com
    DocumentRoot /var/www/yourdomain.com
    ErrorLog /var/www/yourdomain.com/error.log
    CustomLog /var/www/yourdomain.com/requests.log combined
</VirtualHost>

- buat direktori

mkdir /var/www/yourdomain.com
nano /var/www/yourdomain.com/index.html

<html>
  <head>
    <title>This is a test page</title>
  </head>
  <body>
    <h1>It works!</h1>
  </body>
</html>

- setup permission file

chown -R apache:apache /var/www/yourdomain.com/*
chmod -R 755 /var/www

- restart service
systemctl restart httpd

- setup local host
nano /etc/hosts
192.168.3.54 yourdomain.com

- akses your domain.com
(Visited 174 times, 1 visits today)
Baca Juga :  Cara Install GitHub Desktop pada AlmaLinux / CentOS 8 / Rocky Linux / Redhat 8

Similar Posts