Skip to main content

how to enable name-based virtual hosting httpd

here are tutorial to enable name-based virtual hosting httpd

# /etc/httpd/conf/httpd.conf

locate Section 3 from the configuration file, uncomments few lines or create new lines parameter
 NameVirtualHost *:80

<VirtualHost *:80>
      ServerName yourfirstwebsite.domain
      DocumentRoot "/var/www/html/"
</VirtualHost>
  
<VirtualHost *:80>
      ServerName yoursecondwebsite.domain
      DocumentRoot "/var/www/html2/"
</VirtualHost>

save your configuration and please kindly restart your httpd service
     

Comments