Virtual host installation not working
5,478
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 thehosts
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 theServerName
Replace
\
with/
Quote the
DocumentRoot
andDirectory
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>
Related videos on Youtube
Author by
NewPassionnate
Updated on September 18, 2022Comments
-
NewPassionnate over 1 year
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>
-
Patrick Mevzek over 5 yearsDo 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 likesomething.dev.example.com
orsomething.internal.example.com
orsomething.private.example.com
, etc. About.DEV
: ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts
-
-
NewPassionnate over 7 yearsit is saying forbidden access
-
DavidPostill over 7 years@NewPassionnate That's a different problem. Please post a new question.