32.2. Virtual Web Hosting
32.2. Virtual Web Hosting
#vim server1.conf
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName server1.example.com
DocumentRoot /var/www/html
</VirtualHost>
<Directory "/var/www/html">
<RequireAll>
Require all granted
</RequireAll>
</Directory>
wq
systemctl restart httpd
#mkdir /usr/local/vhosts
#cd /usr/local/vhosts
:wq
<Directory "/usr/local/vhosts">
<RequireAll>
Require all granted
</RequireAll>
</Directory>
:wq
192.168.1.10 server1.example.com
192.168.1.10 vhosts1.example.com
To access your new sample website navigate your client web browser
to either
http://server1.example.com
http://vhosts1.example.com