# [SOLVED] apache - virtual host not working

## Joseph_sys

I've copied server config files from one computer to another.

I used "meld" to be sure most changes are accurate but when try to access virtual host:

I get:  *Quote:*   

> Forbidden
> 
> You don't have permission to access / on this server.

 

I don't know where else to look. 

In /etc/hosts I have:

127.0.0.1	localhost.localdomain localhost mydomain.ca syscon5

10.0.0.100      www.mydomain.ca

If I comment out: #10.0.0.100  www.mydomain.ca

I can access this domain.  

in: modules.d/00_default_settings.conf

```

# We configure the "default" to be a very restrictive set of features.

<Directory />

   Options FollowSymLinks

   AllowOverride None

   Order deny,allow

   Deny from all

</Directory>

# added below

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

        AllowOverride All

        Order allow,deny

        Allow from all

</Directory>

<FilesMatch "^\.ht">

   Order allow,deny

   Deny from all

</FilesMatch> 
```

I don't know where else to look.  I can not access virtual domain on port 80 nor on 443

The server is working perfectly on my other computer running the same version of apache.  As stated earlier I've compare configuration file with meld so I'm sure there are no mistakes. 

Where else to look?

Is there any official documentation for Virtual Host setup for Gentoo so I can check my settings?Last edited by Joseph_sys on Mon Dec 12, 2011 2:10 pm; edited 1 time in total

----------

## cach0rr0

do you have an index file in /var/www/localhost/htdocs ?

```

echo '<html></html>' >> /var/www/localhost/htdocs/index.html

```

----------

## Joseph_sys

Yes, I do. Though no index file would cause this kind of permission error.

I went for easy way out, tar.gz /var/* directory, copy it to another machine.

Mistake #1

Extracted the file on the other machine as user (mistake #1) all the ownership of the files got changed to joseph:joseph

Mistake #2 

I use "meld" to compare the directors and copy missing files / directories to the destination machine. 

Meld - does not preserve ownership either.

The reason it didn't work as .htaccess file were changed to ownership root:root and it should be apache:apache.

So the solution was to use "rsync -av" it preserver ownership and permission :-/

Another lesson learned!

----------

