How to create a virtual host in fedora.


First: Create a file at /etc/httpd/conf.d/ location with .conf extension and insert the following code block.

<virtualhost *:80>
   DocumentRoot “/var/www/project-folder”
   ServerName domain-name

   <Directory “/var/www/project-folder”>
       Options Indexes FollowSymLinks
       AllowOverride All
       Require all granted

Second: create a project under /var/www/     named “project-folder” as virtualhost DocumentRoot.

Insert the domain in hosts file at /etc/hosts as domain

Finally: Restart the httpd service

$ systemctl restart httpd

Browse the domain in browser.


Leave a Reply

Your email address will not be published. Required fields are marked *