client denied by server configuration for amazon ec2 - php

I am using apache 2.4 on amazon ec2.
I have server configuration in httpd.conf as below.
<Directory />
AllowOverride none
Require all denied
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
But I am getting error AH01630: client denied by server configuration: in apache log console.
Also referfed too many article. They are giving same solution as above.
Please give me solution if any

Related

Attempting to host a website through LAN with WAMP

I am attempting to access a website through a computer that is hosted on another computer on the same wifi network. The host has Windows 10. All WAMP services are turned on, the site is in the www directory with a site name of index.php, and I have allowed access by changing httpd.conf and httpd-vhosts.conf as per youtube tutorials:
httpd.conf changes:
Listen 0.0.0.0:80
Listen [::0]:80
Listen HostsIPAddress:80 ----------- (added this line)
...
<Directory />
AllowOverride none
Require all granted ------------ (changed from denied to granted)
</Directory>
...
<Files ".ht*">
Require all granted ------------ (changed from denied to granted)
</Files>
...
<Directory "${SRVROOT}/cgi-bin">
AllowOverride None
Options None
Require all granted ------------ (changed from denied to granted)
</Directory>
httpd-vhosts.conf changes:
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted ------------ (changed from denied to granted)
</Directory>
but when I type in HostsIPAddress:80 on other devices' browsers (all devices use chrome), the connection times out. I can access the site with localhost:80 on the host computer, getting the site on another computer is where the issue is.

Set up a local server on an external hard drive - Forbidden error

I have a Mac OSX El Capitan operating system. Since my laptop has limited space, I am trying to set up a local server on my 1TB external hard drive with the url http://media.database/, and that uses PHP. I have set it up the best I know how, but when I go to the page, it says "Forbidden You don't have permission to access /index.php on this server."
I have set apache and host files as best I know how, but I'm still pretty new to this sort of thing. I have listed my updates to those files below and restarted the apache server using sudo apachectl restart, which has gotten me this far. Can someone enlighten me on what I might be missing. All help is greatly appreciated.
/etc/apache2/httpd.conf
<VirtualHost *:80>
ServerName media.database
DocumentRoot "file:///Volumes/DBTARA/media/"
<Directory "file:///Volumes/DBTARA/media/">
DirectoryIndex index.php index.html
AllowOverride all
Options -MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
/etc/hosts
127.0.0.1 media.database
/etc/apache2/users/vmbmacintosh.conf
<Directory "file:///Volumes/DBTARA/media/">
AllowOverride All
Options Indexes MultiViews FollowSymLinks
Require all granted
</Directory>
/etc/apache2/httpd.conf
I attempted to add the following DocumentRoot after the one I already have, but that made my other local servers inaccessible and kept the external one as forbidden.:
DocumentRoot "file:///Volumes/DBTARA/media"
<Directory "file:///Volumes/DBTARA/media">
Options FollowSymLinks Multiviews
MultiviewsMatch Any
AllowOverride None
Require all granted
</Directory>
Thanks again in advance for any assistance.

WampServer 3.0.0 AH01630: client denied by server configuration:

Setting up a new dev server to work on PHP7 and get some training in and run across an impasse.
I can access the server from localhost, 127.0.0.1 no problem. However when I go to another computer on the LAN. I get the dreaded:
Forbidden
You don't have permission to access /dev/lab.php on this server.
So just to be on the safe side I used the new interface to see how the new setup would create a vhost. The vhost works fine locally but not from another PC on the LAN. The apache_error.log shows:
[authz_core:error] [pid 3408:tid 928] [client 192.168.1.38:54761] AH01630: client denied by server configuration: C:/wamp64/www/dev/lab.php
From everything I was reading it should have been a simple change of this
<VirtualHost *:80>
ServerName dev
DocumentRoot c:/wamp64/www/dev
<Directory "c:/wamp64/www/dev/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Which you can see I changed the Require local to Require all granted.
No JOY!
Still getting Forbidden access on the other LAN PC.
Once I changed the localhost to all granted. The sub-directories started working. Then I could get to http://192.168.1.36/dev with no problem.
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Thanks for the tips. i was stuck with WampServer Version 3.0.6 64bit access (Apache Version 2.4.23) and this code worked.
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp64/www
<Directory "c:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
in case if you have changed port no of apache server you have to give same port no in below configuration. for example if your apache port no is 8080 then it you need to replace existing code in httpd-conf file
<VirtualHost *:8080>
ServerName dev
DocumentRoot c:/wamp64/www/dev
<Directory "c:/wamp64/www/dev/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>

access forbidden xampp in mac php

there is the error infomation:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.12 (Unix) OpenSSL/1.0.1m PHP/5.6.8 mod_perl/2.0.8-dev Perl/v5.16.3
I have setting httpd.conf file as follw:
Alias /myspace "/volumes/myspace/workspace/phpworkspace"
<Directory "/volumes/myspace/workspace/phpworkspace">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
#Require all granted
</Directory>
"/volumes/myspace/workspace/phpworkspace" this place is my location of code. I have tried many methods:
Xampp Access Forbidden php
New xampp security concept: Access Forbidden Error 403 - Windows 7 - phpMyAdmin
I have solve the problem .
in file "httpd.conf",there has another default Directory configuation like follow:
<Directory />
AllowOverride none
Require all denied
</Directory>
you can delete this directory or change is as follow:
<Directory />
AllowOverride all
Require all granted
</Directory>
The Order directive should be Allow first, then Deny.
Set Allow from all and don't set anything for Deny.
Change your Directory directive to this and it should work
<Directory "/volumes/myspace/workspace/phpworkspace">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
#Require all granted
</Directory>

127.0.0.1 not working on wamp server

I have installed WAMP in my system and http://localhost is working nicely.
but when i got 127.0.0.1 then it gives Forbidden error:
Forbidden
You don't have permission to access / on this server.
I don't know what is this error for
in httpd.config i have give permission to allow all:
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Allow from all
Allow from 127.0.0.1
</Directory>
and if i set in my host file
127.0.0.1 localhost
127.0.0.1 test
and access test it gives same error. Any suggestion would be appreciated.thanks
The correct syntax for Apache 2.4.x is
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
Now if you did not actually want to give access to your site while you develop it to the whole internet a better method would be
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Require local
</Directory>
The require local covers localhost, 127.0.0.1 and ::1. ::1 is the IPV6 equivalent of 127.0.0.1
If you want to be able to access the WAMPServer (Apache) from other PC's on your local network then you can include this line as well
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks
AllowOverride all
Require local
Require ip 192.168.0
</Directory>
Note: I used only the first 3 quartiles of the normal 4 quartile set, this gives access to any ip on your internal subnet.
You will have to check what your actual subnet is as 192.168.0.x is a default but not for all home routers.
Can i suggest you read this document and make the required fixes for the WAMPServer 2.4 release. Make each change one by one and make sure that Apache and MySQL start again after each change so you can know where you make any mistakes, as they happen, rather than doing them all in one go!

Categories