403 Forbidden on wamp server - apache

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.

Related

500 Internal Server Error when trying to enable use of .htaccess in Apache on Ubuntu

I am trying to get my .htaccess working on my Ubuntu-apache2-webserver.
For that I opened /etc/apache2/apache2.conf,
I removed the comment sign (#) before AccessFileName .htaccess
and replaced AllowOverride None by AllowOverride All in
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
I activated mod_rewrite via a2enmod rewrite and restarted the server.
But each time I am performing those changes and open an html-file placed inside of /var/www/html, I get a 500 Internal Server Error for Virtual Host 80.
The same thing happened to me when placing
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
before </VirtualHost> into the 000-default.conf-file instead of the /etc/apache2/apache2.conf.
Can anyone tell me what I am missing?
You're slightly off in your syntax for allowOverride. The Directory tag needs to be inside the VirtualHost tag. Like so:
<VirtualHost *:80>
DocumentRoot /var/www/html
ErrorLog /var/log/apache2/error.log
Options Includes
<Directory "/var/www/html">
AllowOverride All
</Directory>
</VirtualHost>
Also, make sure Apache has permissions to read and write to the directory /var/www/html

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>

How to allow Apache to serve files outside of the document root folder?

everybody. TIA for your help.
All of my projects are located in /var/www/html and my apache.conf points to it with the following directive:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
By mistake I created another project in ~/Development/My_Project.
And I tried to get apache to serve the files using the following directive (right after the one above):
<Directory /Development/My_Project/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
But it does not work. I get:
Forbidden
You don't have permission to access / on this server.
I appreciate any help.
Thanks

Ubuntu 14.04 Apache 2.4.7 404 Not Found

I've been reading the forums and trying to replicate their fixes, but I must be missing something on my end since it will switch from a simple 404 Error Not Found to a 403 Forbidden Error (even after chown and chmod changes).
Currently, I am experiencing the 403 error code even after a sudo apache2ctl restart
Here is what I've done so far.
- gedit apache2.conf with the following
<Directory /path/to/directory/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all denied
</Directory>
gedit sites-available/000-default.conf && sites-enabled/000-default.conf
DocumentRoot /path/to/directory
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /path/to/directory>
Options Indexes FollowSymLinks MultiViews
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
Options Indexes FollowSymLinks MultiViews
Order allow,deny
Allow from all
</Directory>
Any help is much appreciated.
First note that you have now Apache 2.4, not Apache 2.2. The style to declare permissions has changed with Apache 2.4 and you should consistently use the new ones (like require all granted).
Apache has become more strict in what files it allows to be served. Essentially, arrange the files to be served outside in your Document Root and below, and keep all other files out of this tree. Don't link to files outside the Document Root tree.
Some point of your config:
<Directory />
This is the root directory of your file system. If you declare anything for it, it should be require all denied and nothing else. Note that there is a difference between a <Directory /absolute/path/to/some/directory> directive and a <location /relative/path/to some/location/on/your/server> directive.
Configure your server in terms of <location>

apache 2.4.10 error 403 on aliases

I updated my apache server to 2.4.10 from version 2.2.x on debian7 and I have problem with multi virtual hosts. When I try to load page I have forbidden [403] error. If I enable only one alias the page works fine, when I try to enable another page, then I received 403 error. I add to all configs Require all granted.
What I doing wrong?
code of alias 1:
<VirtualHost example.com:3099>
DocumentRoot /home/ftp/example.com
alias alias1 /home/ftp/example.com/alias1/>
<Directory /home/ftp/example.com/alias1/>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
code of alias 2:
<VirtualHost example.com:3099>
DocumentRoot /home/ftp/example.com
alias alias2 /home/ftp/example.com/alias2/>
<Directory /home/ftp/example.com/alias2/>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
UPDATE 1
In /etc/apache2/apache2.conf I Have
<Directory />
Options FollowSymLinks
AllowOverride none
Require all denied
</Directory>
If I change denied to granted, error 403 disappear, but I have access to all subdirs in /home/ftp/example.com even they haven't virtual host alias.
UPDATE 2
I have error, when I write a post here, In server config I have proper directory location.
These parameters don't match, so the path is forbidden. Look at the last character:
alias alias2 /home/ftp/example.com/alias2/>
<Directory /home/ftp/example.com/alias1/>