HTTP Configure a Virtual Host Flashcards

1
Q

Create a HTTP Virtual Host

A

vim /etc/httpd/conf.d/vhost.conf

{VirtualHost *:80}
  ServerAdmin admin@vhost.example.com
  DocumentRoot /var/www/html/vhost
  ServerName vhost.example.com
  ErrorLog logs/vhost-error_log
  CustomLog logs/vhost- access_log  combined 
{/VirtualHost}

mkdir /var/www/html/vhost

echo “Vhost Virtual Host” > /var/www/html/vhost/index.html

httpd -D DUMP_VHOSTS

vim /etc/hosts

10.1.152.34 vhost.example.com

systemctl restart httpd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly