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.

I am trying to configure my local server to host a website of mine responding to an existent domain name.

Say the domain name is www.mywebsite.com.

If I DO NOT configure Apache "extra/httpd-vhosts.conf", then everything works fine. I have correctly configure the DNS, so I see the root of my local web server.

If I DO CONFIGURE Apache "extra/httpd-vhosts.conf", well...all I get is Forbidden You do not have permission to acces / on this server.

Now...I have followed many guides and solutions, but I cannot fix it.

What am I missing? This is my "extra/httpd-vhosts.conf" file:

<Directory C:/vhosts/>
  Require all granted
</Directory>

NameVirtualHost *:80

<VirtualHost *:80>
    DocumentRoot "C:/www/htdocs/"   
    ServerAdmin admin@localhost
    ServerName  localhost

    <Directory "C:/www/htdocs/">
       Require all granted
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/vhosts/www.mywebsite.com/www/"
    ServerAdmin admin@localhost
    ServerName  www.mywebsite.com
    ServerAlias mywebsite.com
    <Directory "C:/vhosts/www.mywebsite.com/www/">
       Require all granted
    </Directory>
</VirtualHost>

I have also set the Windows "hosts" file, by inserting 127.0.0.1 mywebsite.com What's wrong?

Why getting always error 403?

Again, my enviroment is made of:

  • Windows Server 2008 R2
  • Apache 2.4

Thanks

share|improve this question
    
What are the permissions under that www folder? What does apache's error log say? –  Nathan C Jan 28 at 19:01

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.