1
votes

I just installed Xampp on my Arch Linux system. What i want to do now:

My PHP working directory is located in my home-folder (at /home/luke/PHP). I want Apache to access those files two, so i followed the Xampp Installation guide on the Arch Linux Wiki and created an Alias for this Directory. This is what my httpd.conf (the Alias part) looks like:

Alias /PHP /home/luke/PHP
<directory /home/luke/PHP>
    AllowOverride FileInfo Limit Options Indexes
    Order allow,deny
    Allow from all
</directory>

After that, i changed the permissions for the home/luke/PHP-folder to 777 (using chmod). I restarted Xampp and got a 403 when i tried to navigate into http://localhost/PHP

The Apache-Server runs under the http-User (which exists) and the http-Group. So, i added the http-User in my Group (the group luke from my user, using the chown-tool). I restarted the Server, same error.

Here is (a part from) the error_log-file:

[Sun Apr 24 18:05:37 2011] [error] [client 127.0.0.1] (13)Keine Berechtigung: access to /PHP/ denied
[Sun Apr 24 18:10:30 2011] [error] [client 127.0.0.1] (13)Keine Berechtigung: access to /PHP/ denied
[Sun Apr 24 18:10:30 2011] [error] [client 127.0.0.1] (13)Keine Berechtigung: access to /PHP/ denied

So, the Alias I created should work, but what do I need to do to make my /home/luke/PHP-folder accessible to the Apache Server?

I also tried to create a Symlink in the htdocs-folder, but that didn't work neither.

2

2 Answers

2
votes

Apache needs to be able to :

  • Read from your /home/luke/PHP directory -- you already allowed that, aparently
  • Traverse the directories which are parents of that directory.


Typically, you'll have to give the execution permission to others (which means they'll be able to traverse that directory, to go to its children), on your home directory :

chmod o+x /home/luke


Of course (especially in a multi-user environment), you'll then have to make sure that other users cannot access your other directories and files -- typically by removing all privileges that group and other could have on directories/files under your home directory.

0
votes

I fixed my issue by configuring the Alias like shown above, but setting the Apache's user to my user ("luke") and leaving the Group out:

# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
User luke
#Group http

After that I changed the owner of the htdocs- and the PHP-Directory to my user (luke) and restarted LAMPP.

Now everything works fine. Also thanks to Pascal MARTIN and hornetbzz!