Message: Forbidden You don't have permission to access / on this server - apache

I get this message.
I have 4 applications of which 3 work fine and the fourth not.
hosts file looks like this (* used to sensor application names)
127.0.0.1 Out*****Series
::1 Out*****Series
127.0.0.1 M****Us
::1 M****Us
127.0.0.1 Paed
::1 Paed
127.0.0.1 Me****AQ
::1 Me****AQ
httpd-vhosts.conf setup like this
<VirtualHost *:80>
DocumentRoot "E:\WEB\Out*****"
ServerName Out*****Series
<Directory "E:\WEB\Out*****">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:\WEB\M****Us"
ServerName M****Us
<Directory "E:\WEB\M****Us">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
>>>>>>>>>>>>>THIS IS THE ONE GIVING ME THE FORBIDDEN MESSAGE -> OTHERS WORK
<VirtualHost *:80>
DocumentRoot "E:\WEB\Paed"
ServerName Paed
<Directory "E:\WEB\Paed">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "E:\WEB\Me****AQ"
ServerName Me****AQ
<Directory "E:\WEB\Me****AQ">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
What am I missing.
I did the net stop dnscache and net start dnscache.
I did restart all services in Wamp.
I restarted the machine. Still other 3 apps work, this one not.
Please help the blind to see again.

Related

Virtual Hosts on WAMP causing 403 forbidden on 192.168.1.6… other aliases still work

recently modified httpd.conf and httpd-vhosts.conf to add vhosts...
#IncludeOptional "E:/wamp/vhosts/*"
Include "E:/wamp/alias/*"
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "e:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "e:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Require local
Require ip 192.168.1
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot E:/activeWork/projects
ServerName projects.local
<Directory "E:/activeWork/projects">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot E:/activeWork/projects
ServerName www.projects.local
<Directory "E:/activeWork/projects">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot E:/activeWork/projects
ServerName api.projects.local
<Directory "E:/activeWork/projects">
Options Indexes FollowSymLinks
AllowOverride All
Require local
</Directory>
</VirtualHost>
after that when i try to load 192.168.1.6 or 127.0.0.1 , gives me :
Forbidden
You don't have permission to access / on this server.
i've tried to solve it whit this answer but not works for me
and by recommandation in answers i check my access.log and this is the result:
192.168.1.6 - - [03/Oct/2016:11:03:00 +0330] "GET / HTTP/1.1" 403 288
127.0.0.1 - - [03/Oct/2016:11:00:55 +0330] "GET / HTTP/1.1" 403 286
if you are sure that your wamp Installation path is inside E:
then I suggest you to check your access log and error log to collect more information.
I assume you are using Apache 2.4 or later on your Wampserver? If so, then replace the require rules with "Require all granted" in your vhosts, like this:
<VirtualHost *:80>
DocumentRoot "e:/wamp/www"
ServerName localhost
ServerAlias localhost
<Directory "e:/wamp/www">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
If it still doesn't work, check if your firewall is blocking your access.
my problem is to define 3 vhost point to same directory and this confused apache...finally tnx to riggsfolly i fixed that...beside of this i make changes from this guide to define VHost to have setup things in a right way

Apache 2.4.9 Virtual Host on WAMP port 100 On Windows 10 503 error

I keep getting a 503 error when I try to set up a virtual host. I can set up an aliased folder just fine, but no luck on the virtual host setup.
My hosts file looks like this:
127.0.0.1 localhost
::1 localhost
127.0.0.1 appmarket.local
::1 appmarket.local
My vs-hosts file looks like this:
<VirtualHost *:100>
DocumentRoot "C:/nanomarketvhost/local"
ServerName appmarket.local
ServerAlias appmarket.local
ErrorLog "logs/appmarket-error.log"
CustomLog "logs/appmarket-access.log" common
<Directory "C:/nanomarketvhost/local">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
<VirtualHost *:100>
DocumentRoot "c:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<Directory "C:/wamp/www">
AllowOverride All
Options Indexes FollowSymLinks
Require local
</Directory>
</VirtualHost>
I have commented out the lines in the httpd.conf to load virtual hosts.

dns points to wrong directory

I'm trying to setup two virtual hosts in windows using xampp. From what I've read one have to alter the windows hosts file and xampp's httpd-vhosts.conf file.
hosts file:
127.0.0.1 gholizadeh
127.0.0.1 doostr
127.0.0.1 localhost
vhosts file:
NameVirtualHost *:80
<VirtualHost gholizadeh>
DocumentRoot "E:\xampp\htdocs\lowkey\pappa"
ServerName gholizadeh.se
ServerAlias www.gholizadeh.se
<Directory "E:\xampp\htdocs\lowkey\pappa">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost doostr>
DocumentRoot "E:\xampp\htdocs\lowkey"
ServerName doostr.com
ServerAlias www.doostr.com
<Directory "E:\xampp\htdocs\lowkey">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost localhost>
DocumentRoot "E:\xampp"
ServerName localhost
<Directory "E:\xampp">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
But I'm having problem accessing these files. When I try it from my own LAN I get prompted to the xampp site and when get access denied when trying to enter it from extern network. What am I doing wrong?
You got the VirtualHost command wrong. Use it like this instead:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName gholizadeh.se
ServerAlias www.gholizadeh.se
DocumentRoot "E:\xampp\htdocs\lowkey\pappa"
<Directory "E:\xampp\htdocs\lowkey\pappa">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName doostr.com
ServerAlias www.doostr.com
DocumentRoot "E:\xampp\htdocs\lowkey"
<Directory "E:\xampp\htdocs\lowkey">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName localhost
DocumentRoot "E:\xampp"
<Directory "E:\xampp">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Some more things:
* you should add a ServerAdminto each host
* the entries in the host file are just for internal debugging purposes, I assume?
And a side remark:
you don't plan to serve real web pages in the internet from this MS-Windows system, do you?

XAMPP Windows Apache VirtualHost 403 Forbidden

I had XAMPP running fine with virtual hosts on my winodws 8 machine until I was forced to restart my computer (windows update). After restarting I've noticed my virtual hosts weren't working any more. Instead of trouble shooting too much I decided to reinstall XAMPP (currently have XAMPP 3.1.0 running. Which is runnign Apache v 2.4.3)
I have my windows host file edited to redirect sitename.localhost to 127.0.0.1 and this is what I have in my httpd-vhost.conf:
NameVirtualHost *
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "C:\Users\USER\Documents\sitename"
ServerName sitename.localhost
<Directory "C:\Users\USER\Documents\sitename">
Order deny,allow
Allow from all
</Directory>
</VirtualHost>
Every time I try to access http://sitename.localhost I get a 403 Access Forbidden error. Any idea what I'm doing wrong?
Try adding Require all granted to the Directory configuration:
NameVirtualHost *
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "C:\Users\USER\Documents\sitename"
ServerName sitename.localhost
<Directory "C:\Users\USER\Documents\sitename">
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
Also, try to set reading permissions to the web site folder for Authenticated users.
This will list out as index.
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\Users\USER\Documents\sitename"
ServerName projectname.dev
ServerAlias projectname.dev
<Directory "C:\Users\USER\Documents\sitename">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
could you test this code pls instead of yours?
<VirtualHost *:80>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:\Users\USER\Documents\sitename"
ServerName sitename.localhost
<Directory "C:\Users\USER\Documents\sitename">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
btw, do you have index.html/php file in folder "C:\Users\USER\Documents\sitename", don't you?

Configuring Apache vhost: sites having inner sites. possible?

i am wondering if i am doing some thing wrong
i have http://localhost pointing to the directory D:\Projects\Websites
then i want to create a inner site http://learningzf in D:\Projects\Websites\php\ZendFramework\LearningZF\public. this is so that i can use URL's like /users/login instead of specifying the full url
i find that if i add the entry in vhosts to point http://learningzf to D:\Projects\Websites\php\ZendFramework\LearningZF\public, localhost will also point to D:\Projects\Websites\php\ZendFramework\LearningZF\public
<VirtualHost *:80>
DocumentRoot "D:/Projects/Websites/php/ZendFramework/LearningZF/public"
ServerName localhost
</VirtualHost>
<Directory "D:/Projects/Websites/php/ZendFramework/LearningZF/public">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
<VirtualHost *:80>
DocumentRoot "D:/Projects/Websites"
ServerName localhost
</VirtualHost>
<Directory "D:/Projects/Websites">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
i noticed if i move the entries for learningzf below localhost, both learningzf &localhost will point to D:/Projects/Websites
UPDATE
following #KikoV answer, i have modified it to make it work ...
NameVirtualHost 127.0.0.1:80
<VirtualHost localhost:80>
ServerName localhost
DocumentRoot "D:/Projects/Websites"
<Directory "D:/Projects/Websites">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
</VirtualHost>
<VirtualHost learningzf:80>
ServerName learningzf
DocumentRoot "D:/Projects/Websites/php/ZendFramework/LearningZF/public"
<Directory "D:/Projects/Websites/php/ZendFramework/LearningZF/public">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
</VirtualHost>
You should use NameVirtualHost directive.
If host "learningzf" is pointing to localhost, (127.0.0.1), you could use:
Note: In _default _ , last underscore should go togheter.
NameVirtualHost 127.0.0.1:80
<VirtualHost _default _:80>
ServerName localhost
<Directory "D:/Projects/Websites">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
</VirtualHost>
<VirtualHost learningzf:80>
ServerName learningzf
<Directory D:/Projects/Websites/php/ZendFramework/LearningZF/public">
AllowOverride All
Options All
Order allow,deny
Allow from 127.0.0.1
</Directory>
</VirtualHost>
This way you could access to http://localhost and http://learningzf and Apache will know which should use.
(By default, it will go to D:/Projects/Websites).
Note2: remember to add "127.0.0.1 learningzf" line to c:/windows/system32/drivers/etc/hosts file in order to get hostname resolved.