How to create a virtual host in fedora.

Solved:

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
   </Directory>
</virtualhost>

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

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

127.0.0.1 domain

Finally: Restart the httpd service

$ systemctl restart httpd

Browse the domain in browser.

Enjoy.

33 thoughts on “How to create a virtual host in fedora.

  1. Ne zamandır web sitelerim için aradığım içeriği sonunda buldum. Bu kadar detaylı ve net açıklama için teşekkürler.

  2. This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I’ve shared your site in my social networks!

  3. bu konuda bu kadar net bilgiler internette malesef yok bu yüzden çok iyi ve başarılı olmuş teşekkürler.

Leave a Reply

Your email address will not be published.