Apache2 is delivering wrong vhost

3 posts / 0 new
Last post
#1 Wed, 05/08/2019 - 17:25
SkaFan

Apache2 is delivering wrong vhost

hi Forum, im running Virtualmin here at home on my LAN. I setup some domains ending on LAN to access software via Browser. Now Apache2 is acting strange. I want to download some APKs on my Android cell so i got to http://android.lan, but instead of it I was on the site for my local Devuan Ascii mirror.

root@atom:/etc/apache2/sites-enabled# ls -la
lrwxrwxrwx 1 root root   45 Okt 12  2018 android.lan.conf -> /etc/apache2/sites-available/android.lan.conf
lrwxrwxrwx 1 root root   43 Dez 29 00:25 ascii.lan.conf -> /etc/apache2/sites-available/ascii.lan.conf

so the site enabled/avail. should be ok.

Here is my apache2.conf, i removed all lines with #

Mutex file:${APACHE_LOCK_DIR} default
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf
<Directory />
        Options FollowSymLinks
        AllowOverride None
        Require all denied
</Directory>

<Directory /usr/share>
        AllowOverride None
        Require all granted
</Directory>

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

AccessFileName .htaccess

<FilesMatch "^\.ht">
        Require all denied
</FilesMatch>


LogFormat "%v:%p %h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" vhost_combined
LogFormat "%h %l %u %t "%r" %>s %O "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
IncludeOptional conf-enabled/*.conf
SSLProtocol ALL -SSLv2 -SSLv3
SSLCipherSuite HIGH:!SSLv2:!ADH:!aNULL:!eNULL:!NULL
Include /etc/apache2/sites-enabled

VHost conf I want to access:

root@atom:/etc/apache2/sites-enabled# cat /etc/apache2/sites-available/android.lan.conf
<VirtualHost *:80>
SuexecUserGroup "#1001" "#1002"
ServerAlias android.lan
ServerName android.lan
DocumentRoot /home/android.lan/public_html
ErrorLog /var/log/virtualmin/android.lan_error_log
CustomLog /var/log/virtualmin/android.lan_access_log combined
DirectoryIndex index.html index.htm index.php index.php4 index.php5

<Directory /home/android.lan/public_html>
Options +Indexes +IncludesNOEXEC +FollowSymLinks
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,FollowSymLinks
Require all granted
AddType application/x-httpd-php .php
</Directory>
</VirtualHost>

VHost conf I get instead:

root@atom:/etc/apache2/sites-enabled# cat /etc/apache2/sites-available/ascii.lan.conf
<VirtualHost 192.168.0.251:80>
SuexecUserGroup "#1047" "#1048"
ServerName ascii.lan
DocumentRoot /home/ascii.lan/public_html
ErrorLog /var/log/virtualmin/ascii.lan_error_log
CustomLog /var/log/virtualmin/ascii.lan_access_log combined
ScriptAlias /cgi-bin/ /home/ascii.lan/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5

<Directory /home/ascii.lan/public_html>
Options +Indexes +IncludesNOEXEC +FollowSymLinks
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,Fo$
Require all granted
</Directory>
</VirtualHost>
Wed, 05/08/2019 - 17:51
andreychek
Wed, 05/08/2019 - 20:01
SkaFan

thx... where was really a mix of *:80 and ip:80... grumpf... for me as a "normal" user it should work...

Topic locked