non www domain gives "Apache is functioning normally"

Boxerke

Verified User
Joined
Dec 5, 2018
Messages
7
Hi all,

I have a problem on my VPS. All non WWW domains are giving me a "Apache is functioning normally" page. I'v already tried a few thing.
Like: https://help.directadmin.com/item.php?id=242 after doing whats explained I do not get: Include /usr/local/directadmin/data/users/username/httpd.conf in my directadmin-vhosts.conf file.

I'm using Apache 2.4.37

Code:
<VirtualHost 37.97.144.29:80 >
	ServerName www.domain.com
	ServerAlias www.domain.com domain.com 
	ServerAdmin [email protected]
	DocumentRoot /home/domain/domains/domain.com/public_html
	ScriptAlias /cgi-bin/ /home/domain/domains/domain.com/public_html/cgi-bin/
	UseCanonicalName OFF
	<IfModule !mod_ruid2.c>
		SuexecUserGroup domain domain
	</IfModule>
	<IfModule mod_ruid2.c>
		RMode config
		RUidGid domain domain
		#RGroups apache access
		RGroups @none
	</IfModule>
	CustomLog /var/log/httpd/domains/domain.com.bytes bytes
	CustomLog /var/log/httpd/domains/domain.com.log combined
	ErrorLog /var/log/httpd/domains/domain.com.error.log
	<Directory /home/domain/domains/domain.com/public_html>
		<FilesMatch "\.(inc|php|phtml|phps|php72)$">
			AddHandler "proxy:unix:/usr/local/php72/sockets/domain.sock|fcgi://localhost" .inc .php .phtml .php72
		</FilesMatch>
	</Directory>
</VirtualHost>

Can someone help me out please?
Thanks
 
Hi,

I have this:

lookup…

www.domain.com -> 37.97.144.29

lookup...

domain.com -> 2a01:7c8:aabd:63f:5054:ff:fe49:40e6, 37.97.144.29


So no IPv6 for www?
 
You tell us ;) I don't know your domain...

So in this case you have IPv6 2a01:7c8:aabd:63f:5054:ff:fe49:40e6 on your network interface, but it's not in used in VirtualHost. You need to link it in Directadmin to IPv4. Or remove IPv6 from your domains.


related:
https://www.directadmin.com/features.php?id=1377
 
You tell us ;) I don't know your domain...

So in this case you have IPv6 2a01:7c8:aabd:63f:5054:ff:fe49:40e6 on your network interface, but it's not in used in VirtualHost. You need to link it in Directadmin to IPv4. Or remove IPv6 from your domains.


related:
https://www.directadmin.com/features.php?id=1377

Yeah I don't know if it is allowed, its for domain www.bi-mannen.com
And second, Can the IPv6 cause that the site isn't accessible with non www adres?
 
If you connect to internet via IPv6, then IPv6 has a precedence over IPv4 for you. So you will connect to a server via IPv6, and if it's not added into VirtualHost you will see "Apache is functioning normally".
 
I see the both versions have IPv6:


Code:
# host www.bi-mannen.com
www.bi-mannen.com has address 37.97.144.29
www.bi-mannen.com has IPv6 address 2a01:7c8:aabd:63f:5054:ff:fe49:40e6

# host bi-mannen.com
bi-mannen.com has address 37.97.144.29
bi-mannen.com has IPv6 address 2a01:7c8:aabd:63f:5054:ff:fe49:40e6
bi-mannen.com mail is handled by 10 mail.bi-mannen.com.


You should add IPv6 as mentioned earlier.

"Apache is functioning normally" is shown via IPv6.

Code:
# curl -6 http://bi-mannen.com/ -s | head
<html>Apache is functioning normally</html>

# curl -6 http://www.bi-mannen.com/ -s | head
<html>Apache is functioning normally</html>





And your site is shown over IPv4.
 
Back
Top