Answer the question
In order to leave comments, you need to log in
Weird Apache behavior. virtual hosts?
There is a server (debian, there is an ISPConfig 3 panel ) with Apache. I create a virtual host trace. content:
<b>$ cat /etc/apache2/sites-enabled/example.com.vhost </b><br/>
<Directory /var/www/example.com><br/>
AllowOverride None<br/>
Order Deny,Allow<br/>
Deny from all<br/>
<b>$ cat /etc/apache2/sites-enabled/default</b><br/>
<VirtualHost *:80><br/>
ServerAdmin [email protected]<br/>
<br/>
DirectoryIndex index.php index.htm index.html<br/>
<br/>
DocumentRoot /var/www/<br/>
<Directory /><br/>
Options FollowSymLinks<br/>
AllowOverride None<br/>
Answer the question
In order to leave comments, you need to log in
Try adding some ServerName for the default virtual host. From documentation:
If no ServerName is specified, then the server attempts to deduce the hostname by performing a reverse lookup on the IP address.
yes, nothing suspicious,
the only suspicious thing is that there is no such problem with example.org - it comes in with and without www. Virtual host configs are exactly the same. But dns is definitely useless here)
I had this on someone else's VDS with ISP Manager. He wrote some hosts not in sites-enabled as it should, but at the end of apache2.conf (or httpd.conf) because of which subdomains broke.
check if all the letters in the alias are written in English
usually, if there is an inexplicable problem, then an extra move was made.
When everything seems to work for me, but it doesn’t work, then I create a new entity and it usually works (create a virtual host on test.com), and then turn test.com into example.com step by step, line by line, checking the correctness of work on each iterations. Thus, it is almost possible to solve almost any problem, if it has already completely reached a dead end.
"NameVirtualHost *" is there exactly?
Let's check where example.com goes www.example.com - ping from your machine where you open them. Same way?
And in general it is strange that ServerName works in one virtualhost and ServerAlias does not. I suspect that it's not Apache and virtual hosts, but somewhere a blunder.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question