Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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

Error:

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
add comment

1 Answer

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
    </Location>

</VirtualHost>
share|improve this answer
add comment

Your Answer

 
discard

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.