1

I am trying to instal my existing local server with xampp. I setup apache to point to mywebsite.dev document root to /code/www/public. I get an error saying The webpage is not accessible. This website has the same address as an external website.

Instructions i m following:

Create a folder on your computer for the files 
Edit your host file to add the site name 
Edit httpd-vhosts to add the VirtualHost 
Restart Apache using the XAMPP Control Panel 


127.0.0.1  //Mywebsite.dev

<VirtualHost *:80>
    DocumentRoot C:\Mywebsite\trunk\www\public
    ServerName //Mywebsite.dev    
    <Directory C:\Mywebsite\trunk\www\public>
        Order allow,deny
        Allow from all
    </Directory>   
</VirtualHost>
1
  • Do not use .dev as a TLD locally you will run in all sort of problems. It is a valid generic TLD, owned by Google. You should not invent names locally and hope they will work and not create collisions. Instead create a domain name and then just name your resources locally like something.dev.example.com or something.internal.example.com or something.private.example.com, etc. About .DEV: ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts Commented Sep 5, 2018 at 15:02

2 Answers 2

1

I get an error saying The webpage is not accessible.

There are several mistakes in your configuration.

Your host file:

127.0.0.1  //Mywebsite.dev
  • Remove the // from the entry in the hosts file.

Corrected hosts file:

127.0.0.1  Mywebsite.dev

Your httpd-vhosts.conf file:

<VirtualHost *:80>
    DocumentRoot C:\Mywebsite\trunk\www\public
    ServerName //Mywebsite.dev    
    <Directory C:\Mywebsite\trunk\www\public>
        Order allow,deny
        Allow from all
    </Directory>   
</VirtualHost>
  • Remove the // from the ServerName

  • Replace \ with /

  • Quote the DocumentRoot and Directory

Corrected httpd-vhosts.conf file:

<VirtualHost *:80>
    DocumentRoot "C:/Mywebsite/trunk/www/public"
    ServerName Mywebsite.dev    
    <Directory "C:/Mywebsite/trunk/www/public">
        Order allow,deny
        Allow from all
    </Directory>   
</VirtualHost>
2
  • it is saying forbidden access Commented Dec 8, 2016 at 2:34
  • @NewPassionnate That's a different problem. Please post a new question.
    – DavidPostill
    Commented Dec 8, 2016 at 10:21
0

To solve the problem forbidenn access I changed in my httpd-conf:

<Directory>
    AllowOverride none
    Require all denied
</Directory>

by :

 <Directory>
   Options Indexes FollowSymLinks Includes ExecCGI
   AllowOverride none
   Require all granted
</Directory>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .