# [solved] Apache2 problem

## Match

Hi,

Whenever apache2 starts or stops it gives me this warning:

```
/etc/init.d/apache2 restart

 * Stopping apache2 ...

[Mon Feb 06 12:20:36 2006] [warn] NameVirtualHost *:80 has no VirtualHosts  [ ok ]

* Starting apache2 ...

[Mon Feb 06 12:20:37 2006] [warn] NameVirtualHost *:80 has no VirtualHosts  [ ok ]
```

The relevant bit of my httpd.conf file:

```
NameVirtualHost *:80

<VirtualHost *:80>

    DocumentRoot "/var/www/localhost/htdocs"

    <Directory "/var/www/localhost/htdocs">

        Options All +ExecCGI

        AllowOverride All

        Order allow,deny

        Allow from all

    </Directory>

</VirtualHost>

Include /etc/apache2/vhosts.d/*.conf
```

My vhost file:

```
<VirtualHost *:80>

    ServerName wiki

    DocumentRoot /var/www/localhost/htdocs/wiki

    <Directory "/var/www/localhost/htdocs/wiki">

        Options All

        AllowOverride All

        Order allow,deny

        Allow from all

    </Directory>

</VirtualHost>

```

Now everything works perfectly, I just get this warning. Removing the port from the NameVirtualHost directive and VirtualHost sections stops the warning but breaks my virtual hosts (I have http://wiki/ set up to a localhost Mediawiki installation). Any ideas why?

Thanks in advance guys,

Matthew

----------

## gentleman

Match,

remove 

```
NameVirtualHost *:80 
```

 completely from httpd.conf and assure that there is no entry like that in the vhosts file. After that try again.

----------

## Match

I thought it would be something simple, but I didn't think to try something that simple! Thankyou!  :Smile: 

----------

## gentleman

Your welcome  :Wink: . Now change your topic name to [solved] and everything's gonna be allright  :Wink: !

----------

## Match

Ah yes  :Smile: 

----------

## MetalEdge

 *gentleman wrote:*   

> Match,
> 
> remove 
> 
> ```
> ...

 

I have the same problem, and tried the above... but did not have anything related to NameVirtualHost in either config file.  What else can I try?

----------

## gentleman

Yes, that MUST be the problem. Its quite for sure that the apache which you are executing does not use the httpd.conf you expect it to. Change something else in the config file, e.g. the listening port or the document root, to check whether its really the right config file.

----------

## Sodki

 *MetalEdge wrote:*   

>  *gentleman wrote:*   Match,
> 
> remove 
> 
> ```
> ...

 

Check out the /etc/apache2/vhosts.d/vhosts.conf file. Maybe there's your problem.

----------

## leon_73

 *Sodki wrote:*   

>  *MetalEdge wrote:*    *gentleman wrote:*   Match,
> 
> remove 
> 
> ```
> ...

 

try to commente the same tring in the following file

```
/etc/apache2/vhosts.d/default_vhost.conf
```

have fun..

Leo

----------

## MetalEdge

 *leon_73 wrote:*   

>  *Sodki wrote:*    *MetalEdge wrote:*    *gentleman wrote:*   Match,
> 
> remove 
> 
> ```
> ...

 

Thanks, that did the trick.  Thanks guys (gals?).  For the record the file was: 

```
/etc/apache2/vhosts.d/00_default_vhost.conf
```

PZ

----------

