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!!


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

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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