LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 01-17-2007, 04:02 AM   #1
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Rep: Reputation: 15
Apache 2.2 won't recognize virtual hosts


When I run Apache 2.2 (Debian Etch new instal) with its default apache2.conf, it runs fine. But when I add a virtual host to the httpd.conf file:

Code:
Listen 80
NameVirtualHost *:80

<VirtualHost *:80>
  ServerName example.hopto.org
  ServerAlias *.example.hopto.org
  DocumentRoot /var/www/example
</VirtualHost>
i get errors:

Code:
# apache2ctl restart
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Wed Jan 17 00:51:23 2007] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Jan 17 00:51:23 2007] [warn] NameVirtualHost *:0 has no VirtualHosts
[Wed Jan 17 00:51:23 2007] [warn] NameVirtualHost *:80 has no VirtualHosts
I'm used to seeing the ServerName error, but what's wrong with my virtual host setup?

Thanks for the help--I'm googled-out!

Last edited by gregmcavoy; 01-18-2007 at 01:55 PM.
 
Old 01-17-2007, 04:32 AM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 73
Is the sections that enables virtual hosts uncommented. The section should be something like
Code:
# Virtual hosts
#Include etc/apache22/extra/httpd-vhosts.conf
The paths in the example may not be the same as the ones on your system because I copied those from my FreeBSD installation.
 
Old 01-17-2007, 09:41 AM   #3
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Original Poster
Rep: Reputation: 15
It looks like this:

Code:
# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/
But I haven't done anything with sites-enabled. I'm used to working with Apache 1.3, so if 2.2 requires me to do something there, I'll need pointers. From the Apache 2.2 documentation, it looks like it just gives me the option of creating a special conf file for each virtual host, which I don't think I need.

And actually, I'm getting this sometimes, too (when trying to use the virtual host code listed above):
Code:
# apache2ctl start
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
[Wed Jan 17 15:07:04 2007] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Jan 17 15:07:04 2007] [warn] NameVirtualHost *:0 has no VirtualHosts
[Wed Jan 17 15:07:04 2007] [warn] NameVirtualHost *:80 has no VirtualHosts
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
But rebooting clears the darned sock error.

Any other ideas on getting the virtual hosts to be recognized normally?

Last edited by gregmcavoy; 01-17-2007 at 06:17 PM.
 
Old 01-17-2007, 07:44 PM   #4
gregmcavoy
Member
 
Registered: Apr 2003
Location: Northern California, USA
Distribution: Debian
Posts: 54

Original Poster
Rep: Reputation: 15
Ok, this was just because I had no knowledge of how to use Apache 2.2.
http://www.linux.com/article.pl?sid=05/09/01/186204.

I needed to not have the virtual servers in httpd.conf, but instead have them in sites-available and then ln -s them to sites-enabled.

I got this set of error messages, however:

Code:
# apache2ctl start
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
But this was because I can't include "Listen 80". That's already taken care of in ports.conf. Finally, I changed the first line of the virtual host configuration files to <VirtualHost *>, and made sure I didn't have NameVirtualHost * on any virtual host except the default. Now it's fixed.

Last edited by gregmcavoy; 01-18-2007 at 12:25 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vsftpd, web uploads, vsftpd virtual users, apache virtual hosts, home directories jerryasher Linux - Software 7 02-18-2007 07:29 AM
Virtual Hosts with Apache noripcord7 Linux - Games 1 02-22-2004 11:33 PM
Apache Virtual Hosts quozt Linux - General 3 10-15-2003 10:51 AM
Apache/Virtual Hosts Help C-Squared Linux - General 9 08-04-2003 01:45 PM
apache virtual hosts jonfa Linux - General 1 06-04-2002 02:50 AM


All times are GMT -5. The time now is 05:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration