You don't have permission to /phpinfo.php [Answered]

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

You don't have permission to /phpinfo.php [Answered]

Postby barraclm » 07. March 2013 19:03

I have run out of space in the partition that holds my document root (/var/www) and have moved the contents of /var/www to /home/michael/www (which is on a different partition). I then deleted /var/www and created a symbolic link in /var called www which points to /home/michael/www. This all works and I can see the files just fine (directory listings are provided below).

After reviewing many other posts, I believe that I have all the correct permissions (see below) and appropriate entries in my default apache2 configuration file (/etc/apache2/sites-enabled/default) for SymLinks etc and point to the new location of the document root.

Please could someone help me figure out what I am doing wrong. Thank you.


SERVER RESPONSE
===============
Forbidden
You don't have permission to access /phpinfo.php on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 80

DIRECTORIES
===========
michael@The-Beast:/var$ ls -al
gives
lrwxrwxrwx 1 www-data www-data 17 Mar 6 23:37 www -> /home/michael/www

michael@The-Beast:/var$ cd /home/michael/www
michael@The-Beast:~/www$ ls -al
gives
drwxr-xr-x 5 www-data www-data 4096 Mar 6 21:05 .
drwx-w--w- 111 michael michael 12288 Mar 7 10:51 ..
drwxr-xr-x 33 www-data www-data 4096 Mar 5 14:59 joomladev
drwxr-xr-x 19 www-data www-data 4096 Dec 22 14:05 joomla-old
drwxr-xr-x 2 www-data www-data 4096 Mar 6 19:04 jooomlatest
-rwxr-xr-x 1 www-data www-data 23 Oct 20 20:54 phpinfo.php
-rwxr-xr-x 1 www-data www-data 970 Oct 21 11:33 robots.txt

APACHE2 ERROR LOG
=================
[error] [client 127.0.0.1] (13)Permission denied: access to /phpinfo.php denied
[error] [client 127.0.0.1] (13)Permission denied: access to /favicon.ico denied

CONFIGURATION FILE
==================
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /home/michael/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/michael/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>
barraclm
 
Posts: 2
Joined: 07. March 2013 18:50
XAMPP Version: 5.6.3
Operating System: Ubuntu 12.04

Re: You don't have permission to access /phpinfo.php on this

Postby JonB » 08. March 2013 11:02

Forbidden
You don't have permission to access /phpinfo.php on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 80



Ahhh - what makes you think you are using XAMPP???

Every single thing you have in your post indicates you have configured a 'built-in' LAMP Apache server that is part of the Ubuntu Server spin distribution. XAMPP and everything it does and all its configuration files are in the /opt/lampp hierarchy.

Good Luck
:)
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: You don't have permission to access /phpinfo.php on this

Postby Nobbie » 08. March 2013 11:48

barraclm wrote:Please could someone help me figure out what I am doing wrong. Thank you.


This issue has been discussed a billion times (approx.) and the reason is always the same:

The rights are insufficient, because not only the plain files must be accessable for the Apache User (i.e. www-data), but as well ALL DIRECTORIES ABOVE. that means: /home/michael/www as well as /home/michael as well as /home (and mostly this and the user directory /home/michael are not accessable for www-data).

This is basic unix/linux knowledge.
Nobbie
 
Posts: 6682
Joined: 09. March 2008 13:04

Re: You don't have permission to access /phpinfo.php on this

Postby barraclm » 08. March 2013 19:31

Thank you JonB for that explanation. I seem to recollect now that I tried to get XAMPP working but it wouldn't and I therefore had to resort to LAMP. I had forgotten that.

Thank you Nobbie for your feedback. The obtuse responses I had read elsewhere had not helped me understand that I needed to have all the directories above the document root at 755. I have made this change and I am now working :D . However, I did not find your comment that "this is basic unix/linux knowledge" to be helpful. :( I have been working with PCs since the days of CP/M (before MSDOS) and have only recently made the move to Linux. It is this sort of attitude and the inability of linux writers to explain technical matters clearly that will keep linux as a minority interest. FYI - I have 3 books which I constantly refer to: Unix For Dummies (Quick Reference), Essential System Adminsitration (Frisch) and Unix and Linux System Administration (Nemeth, Snyder, Hein and Whaley). None of these appears to provide any help on this "basic" matter.
barraclm
 
Posts: 2
Joined: 07. March 2013 18:50
XAMPP Version: 5.6.3
Operating System: Ubuntu 12.04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 4 guests