403 Forbidden while configuring apache/httpd server - apache

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.

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>

How do I grant permission on an Apache 2.4 server?

I have an Apache 2.4 server (WAMP) on my pc (running windows 10). It is fine when I connect to it on my pc (the host) but when I test it on another device it simply gives a 403 forbidden error and refuses to load. I have been trying so many solutions online with the config file but to no avail. How do I fix this?
Here is my httpd.conf file: http://pastebin.com/5B5Q31im
Please note that I am new to this.
Not a WAMP guy but a linux admin.... and your config file looks like Apache 2.2, 2.4 has some changes where it defines the top level document root directory, and the forbidden error is what usually reminds me I've copied an old config over to a new system...
DocumentRoot "${INSTALL_DIR}/www"
<Directory "${INSTALL_DIR}/www/">
Options +Indexes +FollowSymLinks +Multiviews
AllowOverride all
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Should be more like
DocumentRoot ${INSTALL_DIR}/www
<directory ${INSTALL_DIR}/www>
Options All
AllowOverride All
Require all granted
</directory>

Changing root directory in apache2 is giving 403 Forbidden error

Though there are many similar questions here but I could not fix my problem from them.
I have installed Apache/2.4.7 (Ubuntu) in my ubuntu(14.04). I have changed two configuration files to change the default DocumentRoot of apache which is /var/www
to /home/name/www. The files I have changed are /etc/apache2/apache2.conf and /etc/apache2/sites-available/000-default.conf. In apache2.conf I put
<Directory /home/name/www>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
and in 000-default.conf I changed,
DocumentRoot /home/name/www
My /home/name/www file has necessary permissions.
drwxr-xr-x 3 www-data www-data www
But when I try to access localhost from browser I receive
You don't have permission to access / on this server. error. What have i missed?
For changing the default root directory of apache from /var/www to /home/<username>/www following changes worked for me.
I edited the following values of etc/apache2/apache2.conf file like this. Before editing the file it's a good practice to keep a backup of the original.
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /home/<username>/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
Then I changed /etc/apache2/sites-available/000-default.conf file's DocumentRoot.
DocumentRoot /home/<username>/www
After that restart the apache server,
sudo service apache2 restart

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.