LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Apache Virtual Hosts (strange warning error when starting) (http://www.linuxquestions.org/questions/linux-software-2/apache-virtual-hosts-strange-warning-error-when-starting-452852/)

Maeltor 06-08-2006 10:47 AM

Apache Virtual Hosts (strange warning error when starting)
 
Hi everyone,

I have Apache 2.2.0 running on Suse 10.1 and I am having some weird problems when running "apache2ctl configtest"

Here is the error and command syntax:
Code:

web:/etc/apache2/vhosts.d # apache2ctl configtest
[Thu Jun 08 09:26:13 2006] [warn] NameVirtualHost 66.213.158.38:0 has no VirtualHosts
[Thu Jun 08 09:26:13 2006] [warn] NameVirtualHost 127.0.0.2:0 has no VirtualHosts
Syntax OK

The contents of vhosts.d:
Code:

web:/etc/apache2/vhosts.d # ls
vhost-ssl.template  vhost.template

The relevant section of httpd.conf:
Code:

### 'Main' server configuration #############################################
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
Include /etc/apache2/default-server.conf


# Another way to include your own files
#
# The file below is generated from /etc/sysconfig/apache2,
# include arbitrary files as named in APACHE_CONF_INCLUDE_FILES and
# APACHE_CONF_INCLUDE_DIRS
Include /etc/apache2/sysconfig.d/include.conf


### Virtual server configuration ############################################
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
Include /etc/apache2/vhosts.d/*.conf
NameVirtualHost 66.213.158.38
NameVirtualHost 127.0.0.2


# Note: instead of adding your own configuration here, consider
#      adding it in your own file (/etc/apache2/httpd.conf.local)
#      putting its name into APACHE_CONF_INCLUDE_FILES in
#      /etc/sysconfig/apache2 -- this will make system updates
#      easier :)

I'm not sure why i'm getting those two NameVirtualHost errors and I can't find matches anywhere for those addresses.
Any ideas?

-Josh

bathory 06-08-2006 12:25 PM

According to your httpd.conf you have defined 2 vhost IP addresses:
Quote:

NameVirtualHost 66.213.158.38
NameVirtualHost 127.0.0.2
If you want a vhost to listen to any of those IPs you should create a vhost.conf file inside /etc/apache2/vhosts.d (that's where apache looks for vhosts config files due to the "Include /etc/apache2/vhosts.d/*.conf" line in httpd.conf). You can use vhost.template that already exists in that dir. You can also change the above 2 lines in one:
Code:

NameVirtualHost *

Maeltor 06-08-2006 02:48 PM

Holy crap you must think i'm stupid.
I didn't even look at the config file close enough to realize those two were in there! Dammit all.

After spending hours working on apache2 with SSL and a self signed certificate (which I gave up on after a while for now anyways), I didn't even pay enough attention to the file to see the lines there.

Bah. Thanks for pointing it out.


All times are GMT -5. The time now is 07:44 PM.