Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

My client site is: xyz.com.br

I have created a demo.xyz.com.br (DNS Record A) pointing to the ip address of my server.

The request is reaching my server.

The problem:

How do I setup Virtual Host on appache to hit the root directory of the 2nd level domain, if the domain is not hosted on my server?

The target folder: demo.xyz.com.br -> Document Root /home/xyz/public_html/public


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

Apache doe's not resolve de domain name like a normal domain!!

share|improve this question

1 Answer 1

If you've got the A-record set up and the request is reaching your server, then all you need is to set up Apache. Assuming that:

Error: You don't have permission to access / on this server

is being returned by your server (and it should give you the address in the footer) then you probably just need to add a Location clause to your VirtualHost:

<VirtualHost *:80>
    ServerName demo.xyz.com.br
    # ... other directives ...

    # Add this bit:
    <Location />
        Order allow,deny
        Allow from all

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.