apachevirtualhostfedora

VirtualHost using httpd on Fedora is not showing the relative index.html content


My system (virtual machine):

NAME="Fedora Linux" VERSION="39 (Thirty Nine)"

My httpd version:

httpd -v

Server version: Apache/2.4.58 (Fedora Linux) Server built: Oct 20 2023 00:00:00

My VirtualHost file named as 00-test is located in /etc/httpd/conf.d:

<Directory /site1> 
Require all granted 
AllowOverride None 
</Directory>

<VirtualHost *:8070>
DocumentRoot "/site1"
</VirtualHost>

My index.html file is located in /site1 and both the file and directory have complete permission level chmod a+rwx).

Additional info:

systemctl disable firewalld 
systemctl stop firewalld 
systemctl reload httpd 
systemctl restart httpd

I am trying to create a VirtualHost and i am expecting to see the index.html content when I do

curl localhost:8070

but I doesn't happen.

I am restarting (I tried also reloading) httpd each time I do a change.

Chatgpt keeps iterating to me the same responses.

On /var/log/httpd/error_log I don't see related errors and checking httpd with systemctl status httpd I can see that the service is active (also like said the "main" configuration with httpd.conf is working). Hoping I gave all the useful information.


Solution

  • I found out the problem. The configuration file of the Virtual Host in the /etc/httpd/conf.d directory must end with .conf extension.

    So I did

    mv 00-test 00-test.conf
    

    and now it's working... I hope this can help someone else.