"client denied by server configuration" after password protection setup in apache2 - apache

I created .htaccess and .htpassword for password protection in apache. Then, I modified https.conf.
<Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
#AllowOverride None
AllowOverride AuthConfig All
Order allow,deny
Allow from all
</Directory>
After the setting, password protection works fine, but the issue is that the webpage cannot load image file which is in subdirectory of "/Library/WebServer/Documents". Executing tail /var/log/apache2/error_log gives me this error message.
[error] [client 127.0.0.1] client denied by server configuration: /Library/WebServer/Documents/moniwiki/data/cache/gnuplot/wikipagesetupMacBookProTask]-wikipages.png, referer: http://localhost/moniwiki/wiki.php/setupMacBookProTask
When I make AllowOverride AuthConfig None, the error is gone, then there is no password protection.
What's wrong with this? How can I access the subdirectory with password protection?

Following the instruction on this wiki, I added
<Directory "/Library/WebServer/Documents/moniwiki/data/cache/gnuplot">
Order allow,deny
Allow from all
</Directory>
to the https.conf, and it works fine.

Related

Forbidden You don't have permission to access /dashboard/ on this server

I was able to reach http://myip, it is redirecting me to apache page.
But when am trying to reach var/www/html/dashboard am having this problem forbidden dont have permissions.
My httpd.conf is as below:
<Directory />
Options Indexes FollowSymLinks
AllowOverride none
Require all granted
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride All
# Allow open access:
Require all granted
</Directory>
# Further relax access to the default document root:
<Directory "/var/www/html">
I have already disabled the SELinux:
SELINUX=disabled
I have also tried:
sudo restorecon -r /var/www/html
Nothing is helping me to solve my problem, can somebody please help me:
Allow the apache user read and execute permissions at every level of your DocumentRoot using chown or chmod at each level that is restricting the apache user.
Or, FollowSymLinks Option must be enabled for your directory in httpd configuration.
<Directory "/var/www/html/dashboard">
Options Indexes FollowSymLinks
</Directory>
Or, to diagnose, check file permissions using namei:
namei -l /var/www/html/dashboard

Amazon EC2 Ubuntu with Apache "Forbidden" 403

I am setting up an AWS Ubuntu server.
I installed apache2, mysql, php and phpmyadmin.
I can access files under /var/www
but not under /var/www/othersubfolder...
It will say: Forbidden.
I updated apache2.conf with:
<Directory /var/www/>
Allow from all
</Directory>
What am i missing?
If you're using apache 2.4+ you'll need to add this into your allow/deny rules:
Require all granted
So it would be
<Directory /home/user/path>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>

403 Forbidden while configuring apache/httpd server

I have installed httpd in my rhel6 with "yum install httpd"
after starting the server with "service httpd start", I am trying to access the test page with wget http://localhost:8080 (this i have configured in my httpd.conf), I am getting 403 Access forbidden. Can any1 help me why i am getting this error?
Check directory permissions in httpd.conf:
<Directory "/var/www/html">
Options +Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>
where "/var/www/html" is your document root.

403 Forbidden on wamp server

I setup my wamp server and can access phpMyAdmin directory on the local host.
I'm trying to access a file from my directory but it gives me error 403 Forbidden yet I've tried to change my httpd.conf to
DocumentRoot "c:/wamp/www/"
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks ExecCGI
Order allow,deny
Allow from all
AllowOverride All
</Directory>
And I've also changed my phpadmin.conf to
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks ExecCGI
AllowOverride all
Order Deny,Allow
Allow from 127.0.0.1
Allow from MACHINE_IP
And I still can't access some files on my server
Here is the exact message:
Forbidden
You don't have permission to access
/php_sandbox/e-commerce/4-full-mvc-framework/views/login/index.php on
this server.
In your phpadmin.conf these lines are your problem:
Allow from 127.0.0.1
Allow from MACHINE_IP
change this to
Allow from all
and it should work.

Apache 403 Error WampServer 2

I have WampServer 2 installed and I have created an alias on my computer called test which points to directory g:/test/.
However I keep getting a 403 error when I try and access localhost/test/
Which is being caused by these lines in my httpd.conf (if I comment these lines out it loads)
<Directory />
AllowOverride none
Require all denied
</Directory>
My conf for test is as follows:
Alias /test/ "g:/test/"
<Directory "g:/test/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
How do I override the Require all denied in my test.conf file to stop the 403 errors?
Error Log reads:
[Sun Dec 09 18:51:23.757803 2012] [authz_core:error] [pid 5128:tid 884] [client ::1:50622] AH01630: client denied by server configuration: G:/test/
Access Log reads:
::1 - - [09/Dec/2012:18:51:23 +0000] "GET /test/ HTTP/1.1" 403 207
Try to replace deprecated:
Order allow,deny
Allow from all
By:
Require all granted
Concerns only Apache >= 2.4. However, I recommand to disable mod_access_compat (line LoadModule) to avoid Order/Allow/Deny conflicts with Require.
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Allow from all
#Require local
Require all granted
above file comment #Require local
add extra Require all granted
solved