I trying to set up a local webserver on a Raspberry. I get the LAMP installation up and running, the hosts and vhosts are ok when I open pages directly on the server, but all incoming traffic from other device on the network goes to the "other_vhosts_access.log".
What I did
On my computer, the /etc/hosts file contains the line to redirect www.webfantasy.test to the server:
192.168.1.78 www.webfantasy.test
On the server, the /etc/hosts file contains the line to redicrect www.webfantasy.test to localhost (needed, the vhost wasn't loaded is I didn't add it):
127.0.1.1 www.webfantasy.test
The 000-default.conf has been remove from sites-enabled using the commands "a2dissite" and apache service has been reload.
The specific domain vhost file is activated:
<VirtualHost www.webfantasy.test:80>
ServerName www.webfantasy.test
ServerAlias www.webfantasy.test
DocumentRoot /var/www/webfantasy
DirectoryIndex index.php
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/webfantasy_error.log
CustomLog ${APACHE_LOG_DIR}/webfantasy_access.log combined
</VirtualHost>
apache2ctl -t -D DUMP_VHOSTS
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
127.0.1.1:80 www.webfantasy.test (/etc/apache2/sites-enabled/webfantasy.conf:1)
What I get
- From the server, the www.webfantasy.test answers with the correct page ( /var/www/webfantasy/index.php) and is logged in the webfantasy_access.log file
- From my computer, the www.webfantasy.test answers with the default Debian/Apache page ( var/www/html/index.html ) and is logged in the other_vhosts_access.log file
Did someone knows what I could modify in order for to work properly?
nslookup www.webfantasy.test
return192.168.1.78
?