Permission Denied - Error 403

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Permission Denied - Error 403

Postby esender » 14. August 2012 04:19

I am having a problem in that certain files in my /opt/lampp/htdocs folder cannot be accessed with a web browser:
Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

192.168.1.107
Mon 13 Aug 2012 07:02:33 PM PDT
Apache/2.2.21 (Unix) DAV/2 mod_ssl/2.2.21 OpenSSL/1.0.0c PHP/5.3.8 mod_apreq2-20090110/2.7.1 mod_perl/2.0.5 Perl/v5.10.1


My Set up:
- VirtualBox on a Windows 7 Pro
- GuestOS: CentOS 6.3
- Lampp 1.7.7 in /opt/lampp
- Installed Virtualbox Guest Addons (includes the shared folder feature)
- My share is on /media/sf_PHP_Workspace
- The files in it have permissions that are stuck as -rwxrwx---. 1 root vboxsf 9 Aug 12 00:22 index.html and I can't seem to change that...
- I symlink that folder to /opt/lampp/htdocs/PHP so I can view them at http://localhost/PHP
- Note: http://localhost/xampp works fine
- Only http://localhost/PHP gives Error 403


Here is my end goal:
1- Create a virtual linux web server with VirtualBox + CentOS
2- On my Host PC, edit my PHP & HTML files with eclipse in a workspace directory that is shared with my Guest OS
3- Symlink that shared folder to a spot in my /opt/lampp/htdocs folder
4- Be able to view my progress on any computer in my LAN with http://192.168.1.X/MyPage

I have done #1 and #4, partial #2 and #3. I just can't set the permissions right.

Oh, and chmod doesn't do anything. Even tried 777. It doesn't edit the files or folders at all... It stays at 755 (I believe its 755) As an aside, at my work computer where I use VMWare Player, each file has 777 on them. Appreciate any help!
esender
 
Posts: 10
Joined: 15. January 2009 00:40

Re: Permission Denied - Error 403

Postby JonB » 14. August 2012 05:53

I have no idea how you expect to set Linux filesystem permissions on a virtual share. (which it appears is the issue - as I expected before I read through) The Guest Additions do all that work.

I run Virtualbox and I don't know a way to do that. probably best answered over on Vbox:

https://www.virtualbox.org/

Google: Virtualbox can you change the permissions on a virtual share

https://forums.virtualbox.org/viewtopic ... 8&start=15

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Permission Denied - Error 403

Postby esender » 14. August 2012 09:18

Solved it!

The virtualbox method was going about it all wrong.

What I had to do what

1 - Set up samba with the following command yum install samba samba-common samba-client
-- Note, the required me to update the file /etc/yum.repos.d/dropbox.repo and take the word $release and replace it with the number 13 (searched online for it. if you have the problem of the yum not working, try googling and you may see it. I think this issue was specific to CentOS
2 - On windows, share the wanted folder
3 - Type in this command: mount -t cifs //192.168.1.222/PHPWorkspace /media/PHPMount/ -o user=Eric

That last step tripped me up, I had to supply my username to the windows share. Anyway, doing all that now gives me a share that I was able to symlink to my htdocs folder and view the pages just fine on my web browser! Thank you google, I think I went through 50 different pages before finding the right combination of commands to get this going! Funny how simple it turns out...
esender
 
Posts: 10
Joined: 15. January 2009 00:40

Re: Permission Denied - Error 403

Postby JonB » 14. August 2012 14:13

Thanks very much for sharing your solution. I will probably try that out and see if I can get it to work.

I do have a question, what mode is your Vbox network adapter in; Bridged, NAT or something else?

Good Luck with your project.
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Permission Denied - Error 403

Postby esender » 15. August 2012 03:15

It is in bridged mode, and unfortunately, my main goal of Symlinking the shared folder to my /htdocs/ folder is not working entirely. When I try to do sophisticated tasks, like installing Drupal, it fails for various cryptic reasons.

Putting this little project on hold for now... Eventually as I get better at Linux, I'll figure out how to do this the right way I am sure.
esender
 
Posts: 10
Joined: 15. January 2009 00:40

Re: Permission Denied - Error 403

Postby JonB » 15. August 2012 16:25

OK - Thanks for the info.

To be honest, I don't think there is a way to do this for anything that is dependent on filesystem privileges. That was my original thought. The problem is the underlying file system mount. The native permissions systems of the two OS's (guest/host) are totally incompatible. NTFS incorporates CIFS, as do almost all Unix/Linux filesystems including the Mac OS. Its built around a Microsoft protocol, and has what amounts to 'extended' Netbios support, but it doesn't support sophisticated file access controls. That's the 'cifs' in your mount for Samba. All the 'complicated stuff' requires EITHER NTFS or a descendant of UFS (Unix File System) where things like ACL's group/user permissions can be set/maintained in the filesystem itself. CIFS doesn't have that. The permissions/ownership cannot be maintained when the device is unmounted as the needed FS infrastructure does not exist. That is also why Guest Additions 'forces' those permissions and ownership- those settings come closest to the level of control you get with CIFS. Also why to do 'many things' (such as store large files) with removable drives, you have to decide on formating them to a NTFS or UFS variant. The 2 GB filesize limit on CIFS is a function of the fact its a 32bit Filesystem.

Crux issue - CIFS filesystem
The CIFS filesystem doesn't directly support chmod or chown.

http://www.ibm.com/developerworks/linux ... ic3-314-1/

Notice - AFAIK. even with unix extensions set to on - 'chown' is not supported. Therefore Unix/Linux processes that need ownership of a file will likely fail. Thinking forward - it would appear to be impossible to make correct settings for configuration files, as they rely on a combination or permissions AND ownership (they need to know are you the owner, or a member of a group or 'other') in order to apply the chmod permissions correctly.

http://www.qnx.com/developers/docs/6.3. ... imits.html

This is all "AFAIK" - :mrgreen:

Good Luck and thanks for working on this stuff..
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Linux

Who is online

Users browsing this forum: Gorham and 3 guests