Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a small dedicated server at home which runs Apache/2.2.22 on Fedora Linux 16 with Webmin. I have setup 3 Virtual Hosts using Webmin, which produces the following configuration in /etc/httpd/conf/httpd.conf
Code:
<VirtualHost *:80>
DocumentRoot /home/domain1.sytes.net/www/
ServerName domain1.sytes.net
<Directory "/home/domain1.sytes.net/www/">
allow from all
Options +Indexes
</Directory>
ServerAlias www.domain1.sytes.net
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /home/domain2.sytes.net/www/
ServerName domain2.sytes.net
<Directory "/home/domain2.sytes.net/www/">
allow from all
Options +Indexes
</Directory>
ServerAlias www.domain2.sytes.net
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /home/domain3.sytes.net/www/
ServerName domain3.sytes.net
<Directory "/home/domain3.sytes.net/www/">
allow from all
Options +Indexes
</Directory>
ServerAlias www.domain3.sytes.net
</VirtualHost>
For some reason the first 2 virtual hosts are working fine, but the third one I just added is not working and redirects traffic to the default apache server page. Does anyone have any suggestions as to why the 3rd host may not be working? The settings are identical to one another and I restarted apache several times without any luck.
httpd: Could not reliably determine the server's fully qualified domain name, using fe80::213:72ff:fe0d:2760 for ServerName
[Sat Dec 22 13:26:55 2012] [warn] NameVirtualHost XXX.YYY.ZZZ.KKK:0 has no VirtualHosts
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server domain1.sytes.net (/etc/httpd/conf/httpd.conf:1009)
port 80 namevhost domain1.sytes.net (/etc/httpd/conf/httpd.conf:1009)
port 80 namevhost domain2.sytes.net (/etc/httpd/conf/httpd.conf:1018)
port 80 namevhost domain3.sytes.net (/etc/httpd/conf/httpd.conf:1027)
Syntax OK
I am using NO-IP.com Dynamic DNS Service to point to my home Server. The first two do resolve fine with the existing configuration, just not domain3.sytes.net.
I am using NO-IP.com Dynamic DNS Service to point to my home Server. The first two do resolve fine with the existing configuration, just not domain3.sytes.net.
I don't know how NO-IP can assign the same dynamic IP to more than one hostnames, but maybe you have a typo in NO-IP configuration, so your IP does not actually resolve to domain3.sytes.net
I double checked the host name, and verified that domain3.sytes.net does resolve to the correct IP and makes it as far as my server. So the problem must be on my server! I just don't see it somehow.
I double checked the host name, and verified that domain3.sytes.net does resolve to the correct IP and makes it as far as my server. So the problem must be on my server! I just don't see it somehow.
Pete
If the hostname resolves to your IP and apache has a vhost with that ServerName, then you should see that instead of the default. That's why we think there is a discrepancy between the No-IP hostname and the vhost ServerName.
BTW to get rid of:
Quote:
[Sat Dec 22 13:26:55 2012] [warn] NameVirtualHost XXX.YYY.ZZZ.KKK:0 has no VirtualHosts
search httpd.conf (and perhaps the included apache config files) for a second "NameVirtualHost .." definition and delete it. According to your vhosts configuration there should be only a "NameVirtualHost *:80" directive.
If the hostname resolves to your IP and apache has a vhost with that ServerName, then you should see that instead of the default. That's why we think there is a discrepancy between the No-IP hostname and the vhost ServerName.
I tipple checked the no-ip setting and it is resolving to my server fine. There really isn't a whole lot of settings on the no-ip end, and I re-checked the few there is and confirmed there is no difference between the settings of the 3 sub domains. I also re-checked and made sure there is no difference between the way the sub domains are entered into no-ip and the way I have them in my configuration file. I even double checked the file system permission of the folder where domain3 is pointing and it has the identical file system permission as the others. It makes no sense! I am open to any other suggestions anyone may have in this regard.
Quote:
Originally Posted by bathory
BTW to get rid of:
search httpd.conf (and perhaps the included apache config files) for a second "NameVirtualHost .." definition and delete it. According to your vhosts configuration there should be only a "NameVirtualHost *:80" directive.
I did find a second IP Specific NameVirtualHost entry and commented it out, which got rid of the warning:
Quote:
httpd: Could not reliably determine the server's fully qualified domain name, using fe80::213:72ff:fe0d:2760 for ServerName
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server domain1.sytes.net (/etc/httpd/conf/httpd.conf:1009)
port 80 namevhost domain1.sytes.net (/etc/httpd/conf/httpd.conf:1009)
port 80 namevhost domain2.sytes.net (/etc/httpd/conf/httpd.conf:1018)
port 80 namevhost domain3.sytes.net (/etc/httpd/conf/httpd.conf:1027)
Syntax OK
I also don't see any relevant error messages in the error_log or access_log.
By the way, the Default Server has the following configuration:
Address: Any
Port: Any
Server Name: Automatic
Document Root: /var/www/html
Would that effect the settings for domain3 in any way?
By the way, the Default Server has the following configuration:
Address: Any
Port: Any
Server Name: Automatic
Document Root: /var/www/html
Would that effect the settings for domain3 in any way?
Dunno how webmin works, but since the other 2 vhost work, it shouldn't matter.
What happens if you manually move the 3rd vhost stanza before the 1st one in httpd.conf, so it becomes the default vhost?
In Apache 2.4 directive NameVirtualHost no need because Apache's development had removed it.
I already had "Listen 80" in my config file, and removing NameVirtualHost directive not only didn't help but it broke the other two domains, and generated the following two errors on restart of apache:
Code:
[Sun Dec 23 14:23:52 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Sun Dec 23 14:23:52 2012] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
As far as the other suggestion:
Quote:
Originally Posted by bathory
Dunno how webmin works, but since the other 2 vhost work, it shouldn't matter.
What happens if you manually move the 3rd vhost stanza before the 1st one in httpd.conf, so it becomes the default vhost?
I moved the 3rd vhost up to the beginning and restarted apache, but it made no difference.
I am posting my complete httpd.conf file here as an attachment in hope that someone can point out what the actual problem may be.
I'm baffled. Your config looks ok, so I cannot tell what the problem really is.
I still suspect some typo in the vhost definition, as the hostname resolves correctly to your apache IP, but apache does not know that vhost name, so it gives the default server.
Have you tried to use both domain3.sytes.net and www.domain3.sytes.net?
Also try to use telnet and see what you get:
Code:
telnet x.x.x.x 80
GET / HTTP/1.1
host: domain3.sytes.net
<Enter>
<Emter>
I'm baffled. Your config looks ok, so I cannot tell what the problem really is.
I still suspect some typo in the vhost definition, as the hostname resolves correctly to your apache IP, but apache does not know that vhost name, so it gives the default server.
Have you tried to use both domain3.sytes.net and www.domain3.sytes.net?
Also try to use telnet and see what you get:
Code:
telnet x.x.x.x 80
GET / HTTP/1.1
host: domain3.sytes.net
<Enter>
<Emter>
The www.domain3.sytes.net doesn't resolve at all (brings up a blank page). Only domain3.sytes.net goes to the test page of apache.
I tried and telnet to the server from another machine and still got the html of the apache test page.
I get this response for both my other domains too though, so I don't think that's the problem.
Quote:
Originally Posted by bathory
What happens if you replace the default "/home" in DocumentRoot with "/home/domain3.sytes.net/www"?
I still get the apache test page for domain3. I even tried adding a 4th domain "domain4.no-ip.info" and the 4th domain shows the same apache test page, even though everything is correct! I have to admit this is one of the strangest problems I have had in my 20 years of work!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.