I desperately try to setup a name based virtual host for use in my local network, for hours.
This is my configuration, the path is correct
/etc/apache2/vhosts.d/hausfux.conf
<VirtualHost 192.168.40.44:80>
ServerName hausfux.dev
DocumentRoot "/srv/www/htdocs/hausfux/devLocal"
ErrorLog /var/log/apache2/hausfux_error.log
CustomLog /var/log/apache2/hausfux_access.log common
</VirtualHost>
I informed myself here.
Then I added this line to my /etc/hosts file.
192.168.40.44 hausfux.dev
I also added the same line on my windows clients hosts file.
Then I restarted apache2 with systemctl restart apache2
.
If I enter http://hausfux.dev
in my windows clients browser, then it automatically changes to https://hausfux.dev
and it fails.
If I try to open the project as I used to,with the full absolute link, e.g. http://192.168.40.44/hausfux/devLocal
then I get Status Error Code 500 (server internal error) now. If I remove my virtual host and restart apache2 then the site works again.
What am I doing wrong?
PS: There are no errors in /var/log/apache2/hausfux_error.log
Update
If I use the following configuration, then it works if I type in the servers IP Adress in the browser at my windows client (http://192.168.40.44).
NameVirtualHost *:80
<VirtualHost *:80>
ServerName hausfux.dev
DocumentRoot "/srv/www/htdocs/hausfux/devLocal"
ErrorLog /var/log/apache2/hausfux_error.log
CustomLog /var/log/apache2/hausfux_access.log common
<Directory "/srv/www/htdocs/hausfux/devLocal">
Require all granted
</Directory>
</VirtualHost>
But my goal is, to just enter a name, e.g. http://hausfux.dev
instead of the ip address. Is this possible in OpenSUSE or should I use another OS, e.g. Ubuntu?
Update:
Response from pinging my DNS-Server:
PING 192.168.40.20 (192.168.40.20) 56(84) bytes of data. 64 bytes from 192.168.40.20: icmp_seq=1 ttl=64 time=0.126 ms 64 bytes from 192.168.40.20: icmp_seq=2 ttl=64 time=0.149 ms