I have been searching for hours now and I cant find a solution. I have tried much to many things to even start listing the things. So please any assistance would be appreciated.
I have changed the htdocs folder location in httpd.conf because I have all my files sync to cloud storage. This works perfectly on my windows machine but on linux not so much. Every thing runs perfectly but when I try to access my htdocs folder (new location) I get a message:
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.48 (Unix) OpenSSL/1.1.1k PHP/8.0.10 mod_perl/2.0.11 Perl/v5.32.1
But When I change the location back to the normal location it works perfectly.
I have already gave full access to the folder.
Think of a directory structure as a series of security doors:
/var
/www
/htdocs
If you give someone a key to htdocs (i.e. set the permissions to give a user access) then they can open that door… but only if they can get to it.
If you don't also give them keys to www and var then they can't get into htdocs.
Related
I want to move moodle lms from local server to live server, I moved moodeldata to httpdocs and tired to figure out httpdocs directory path on shared Linux based Plesk server. I appreciate any one helps me!
I tried like this
$CFG->dataroot='\httpdocs\moodledata';
but the result is
Fatal error: $CFG->dataroot is not configured properly, directory does
not exist or is not accessible! Exiting.
On Linux, they should be forward slashes
$CFG->dataroot = '/moodledata';
Also, its a really bad idea to put the data root in a web directory (httpdocs) that's publicly available - put the data root in a directory that's outside of the web root
https://docs.moodle.org/401/en/Installing_Moodle#Create_the_.28moodledata.29_data_directory
If you are migrating, then you probably need to backup the old data root too
https://docs.moodle.org/401/en/Moodle_migration#Copy_moodledata_from_the_old_server_to_the_new_server
Thanks all for your help! And now I changed as
$CFG->dataroot ='/data/www/example.com/moodledata'; then
I moved moodledata from httpdocs to home-directory and it worked correctly.
I am facing below error while running laravell project first time on my local xamp server
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.25 (Win32) OpenSSL/1.0.2j PHP/7.1.4
This is nothing todo with Laravel, its the folder permissions, you need to make the root folder readable and make sure .htaccess is readable. As its local I would suggest setting the root folder to readable by everyone and try again.
Also it could be because you are not pointing your server to the public folder of your Laravel application
Xampp is installed on my local windows machine.
I downloaded WordPress 4.5.2, unzipped it and put the contents in a folder called wptest which is in htdocs.
Xammp has php 7.0.6
The error I am getting is:
Access forbidden!
You don't have permission to access the requested directory. There is either
no index document or the directory is read-protected.
Error 403
If I type localhost into the browser I am taken to the localhost/dashboard
and if I type in localhost/wptest I get the access denied error.
When I first copied the wp files into the wptest folder I took the following steps:
Created a DB called wptest (same as the folder with the wp files in).
Renamed wp-config-sample.php file to wp-config.php.
Inside wp-config.php I Replaced “database_name_here” with wptest,
Replaced “username_here” with “root” and Left the “password_here” blank.
I have tried several suggestions from forum posts regarding the access denied error but am getting nowhere.
As I have little experience with phpMyAdmin & XAMMP it may be a simple permissions setting I have missed.
Did you try with a older version on php?
I have the 5.6.3 version and it works fine.
http://mallinson.ca/post/osx-web-development/
I was following the above guide for setting up the OS X Mavericks local development environment on my new mac and originally everything worked out. Not really sure what happened afterwards, but after leaving my computer for sometime, working on other stuff, and maybe rebooting, I now get a Forbidden -- You don't have permission to access / on this server. (403 Forbidden in title bar) when I try to go to ANYTHING.dev, localhost, 127.0.0.1, etc. Since I didn't change any of the files mentioned in the article since it was last working, my guess is this is some sort of permissions issue.
The only file from this entire setup that is different than what is in the guide is httpd-vhosts.conf found in /private/etc/apache2/extra/, which was simply changed to match my directories rather than the author's. Just in case, you can view the file here -- http://pastebin.com/wcr1fdZe (I have 2 hard drives, SSD boot and HDD for storage and named storage, so I found it reasonable to put the www directory on the HDD)
By the way, that directory is as follows /Volumes/Storage/www/sites/home/wwwroot where sites is the only folder in www and home is the only folder in sites and wwwroot is empty.
Can someone please help me fix this?
Note: I actually also tried going through this guide earlier and it worked originally and then it failed randomly with the same 403, so I reinstalled OS to see and it worked and failed again in a similar manner. I have tried flushing dns cache and restarting apache server via terminal. I'm new to this stuff so please provide specific commands, paths, etc. when something needs to be done, and ask if you need more details.
> UPDATE: so #matanco has got this figured out for me if you look below, but there's still ONE problem... localhost is working, BUT home.dev, me.dev, anything.dev,etc. still has 403
just follow those steps this is simple permission issue:
cd /usr/local/apache2/htdocs/ (if you changed it navigate to your folder)
chmod 644 .
chmod +x .
hope that will solve your problem.
EDIT::
add this to your httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot /Library/WebServer/Documents/
</VirtualHost>
I am doing PHP development using Linux OS ,Lampp Apache server.I changed the default root folder htdocs to another folder PHP on my desktop. When I create a hello.php file in the folder ,I can see it in browser and works well.
But I have another folder inside this root folder called 'front_end'.When I try to see it in browser using http://localhost/front_end ,i get access forbidden.
Firebug shows 'Access forbidden'
How can I get access to this folder using localhost?
Another user asked a similar question on stackoverflow ,but it didn't help.
Ubuntu/Apache2/ Forbidden/Permission error
Assuming you have followed the advice regarding the file permissions.
Have you got an index.php file in the front_end directory?
If not that may be why you get 'Access forbidden'. See Apache 403 Forbidden Error and Solution Try accessing the spesific php file in the directory e.g. /front_end/test.php
Permissions on the folder
Check the permissions of the folder.
Use sudo to create the folders.