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 rebooted the system.
About httpd.conf located in /etc/httpd/conf: Listens to port 80. I created an Index.html in the directory specified (/var/www/html) and it works.
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.
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.