# Lost with Vhosts

## Hellzone

Im completely lost with apache vhosts. whenever i try and add 

```
NameVirtualHost *
```

 apache fails to start and at current my vhosts.conf looks like this:

```
<VirtualHost cevo.co.uk>

        ServerName www.cevo.co.uk

        DocumentRoot /mnt/Cevo

        TransferLog logs/Cevo_access_log

</VirtualHost>

<VirtualHost cevo.org.uk>

        ServerName www.cevo.org.uk

        DocumentRoot /mnt/HC

</VirtualHost>
```

I've read the manuals but they have me completely flumexed im running apache 2.045 and gentoo 1.4

-james

----------

## slartibartfasz

 *Hellzone wrote:*   

> Im completely lost with apache vhosts. whenever i try and add 
> 
> ```
> NameVirtualHost *
> ```
> ...

 

what is the errormsg? what is the output of 'apachectl -configtest'? any clues in the logfiles? (tail -n 100 /var/log/apache/error_log)

----------

## Hellzone

Config Test spurts out:

```
Syntax OK
```

but loading apache spurts out

```
 * Starting apache2...

[Sun Jun 08 19:27:07 2003] [warn] module php4_module is already loaded, skipping

[Sun Jun 08 19:27:07 2003] [error] VirtualHost _default_:443 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
```

thanks

-James

----------

## slartibartfasz

i guess u have only one (1) IP address for your box - if so replace the star '*' in NameVirtualHost with your IP and try again...

----------

## Hellzone

Ok ive done that now whenever someone trys to get on www.cevo.org.uk

it says / permission to this file is denied even though i have a index.htm in the folder and it's readable and excutable by world...

But www.cevo.co.uk works?

whats going on..

```
NameVirtualHost 192.168.0.3

<VirtualHost 192.168.0.3>

        ServerName www.cevo.co.uk

        DocumentRoot /mnt/Cevo

        TransferLog logs/Cevo_access_log

</VirtualHost>

<VirtualHost 192.168.0.3>

        ServerName www.cevo.org.uk

        DocumentRoot /mnt/HC

</VirtualHost>
```

-James

----------

## Hellzone

Ok now the website works, but only when i hash out the following

```
<Directory />

  Options -All -Multiviews

  AllowOverride None

  <IfModule mod_access.c>

    Order deny,allow

    Deny from all

 </IfModule>

</Directory>
```

from commonapache2.conf

any sugestions?

----------

## slartibartfasz

u should add a default virtual server for the box itself (if it is not already one of the two)

are there any symlinks involved? in my experience, if apache simply says permission denied - this is indeed the case - if i was u i would triple check permissions and ownership...

if u look at the error log u can determine if access is forbidden due to file permissions or due to apache rules... perhaps u forgot to add a <Directory /mnt/whatever> container...

----------

## darktux

My Vhost.conf:

```

Port 80

ServerRoot /etc/apache

ResourceConfig /dev/null

AccessConfig /dev/null

 

NameVirtualHost *

 

<VirtualHost *>

ServerName tuxslare.org

DocumentRoot /home/httpd/htdocs

</VirtualHost>

                                                                                                                            <VirtualHost *>

ServerName g0sh.tuxslare.org

DocumentRoot /home/g0sh/public_html

</VirtualHost>

```

etc etc

and I also proxy to internal machines (you'll have to uncomment some stuff on your commonapache.conf.

```

<VirtualHost *>

ServerName open.tuxslare.org

        ProxyRequests on

        ProxyPass       / http://192.168.168.170/

        ProxyPassReverse        / http://192.168.168.170/

        ProxyVia On

        NoCache *

</VirtualHost>

```

etc etc

Hope this helps, I only have one ip, just like you   :Wink: 

----------

## BlinkEye

i do have the same problem.

replacing 

```
NameVirtualHost *
```

with

```
NameVirtualHost *:80
```

gets rid of the problem

----------

