No access to user directory

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

No access to user directory

Postby 39er » 16. November 2008 04:45

Hello all,

Essentially I am using Xammp as a test server to test web pages.
For some reason a previous installation, which worked, disappeared. Perhaps I deleted it. These things happen.

To come to the point. I am using WinXP with SP2. The Xampp version is 1.6.8 and it is the installer exe version.
As before, I modified file httpd-xampp.conf file located in the extra folder and used an alias to point to my test site documents. They are not located in the xampp root folder.

When I call up the alias I get this 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. Error 403

The whole thing is really perplexing since Xampp runs OK on my laptop and I can check web documents by way of the alias module.

I initially installed xampp in C:/xampp but then reinstalled it in C:/Program Files, both with the same results.

Thank you for reading all this.

-39er
39er
 
Posts: 2
Joined: 16. November 2008 04:22

Postby Sharley » 16. November 2008 05:22

Can you paste the alias entry you made here if you want it checked for errors?

403 access denied usually will apply if a directory is trying to be accessed outside the htdocs folder without the required allow permissions that override the restrictive deny defaults set in the httpd.conf file.
httpd.conf wrote:# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>


http://httpd.apache.org/docs/2.2/mod/mod_alias.html
The Docs wrote:if you are creating an Alias to a directory outside of your DocumentRoot, you may need to explicitly permit access to the target directory.
Example:

Alias /image /ftp/pub/image
<Directory /ftp/pub/image>
Order allow,deny
Allow from all
</Directory>
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Postby 39er » 16. November 2008 18:56

Thank you very kindly Sharley for replying.

After discovering and correcting a simple spelling mistake in a directory name of the alias script, it is working just fine. I should have slept over the issue, as I usually do, but this time impatience got the better of me. :oops:

Accordingly, the matter is closed. Thank you again.

Regards,
-39er
39er
 
Posts: 2
Joined: 16. November 2008 04:22

Re:

Postby crashwave » 05. January 2011 20:10

Sharley wrote:Can you paste the alias entry you made here if you want it checked for errors?

403 access denied usually will apply if a directory is trying to be accessed outside the htdocs folder without the required allow permissions that override the restrictive deny defaults set in the httpd.conf file.
httpd.conf wrote:# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>


http://httpd.apache.org/docs/2.2/mod/mod_alias.html
The Docs wrote:if you are creating an Alias to a directory outside of your DocumentRoot, you may need to explicitly permit access to the target directory.
Example:

Alias /image /ftp/pub/image
<Directory /ftp/pub/image>
Order allow,deny
Allow from all
</Directory>


So Ok I know this is an old post but you saved my butt. I have been going at it for hours. Was about to uninstall and restart the whole process. THAN YOU :D
that should be written in the httpd
one Q if anyone has the answer
I wrote my <Directory ....> inside the <IfModule alias_module> will that screw anything up later???
crashwave
 
Posts: 4
Joined: 05. January 2011 00:10

Re: Re:

Postby Sharley » 05. January 2011 22:51

crashwave wrote:...I wrote my <Directory ....> inside the <IfModule alias_module> will that screw anything up later???
That is where the complete individual Aliases have to reside and this will not in anyway screw things but it would if you put the <Directory> directive outside it. :)

Best to follow the examples already contained within the various .conf files in XAMPP.

Good luck.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Alias and Error 403 Re: No access to user directory

Postby albertodg » 10. February 2011 13:32

Hello,

I made different aliases both in httpd-xampp.config and httpd.config files, following instructions and, apparently, they work. Calling http://localhost/myalias do find the folder pointed by the alias, but I get an Error 403, Access forbidden!

The aliases do work. I tried several Directory settings, for instance:

Alias /myalias /myaliasedfolder
<Directory / myaliasedfolder>
Order allow,deny
Allow from all
</Directory>

All cases give the same result.

I found this solution in a linux forum
https://bbs.archlinux.org/viewtopic.php?pid=840539
I understand that this is a problem with the access permissions of the directory but I don’t know if it is solved form apache or from the operating system, and I don’t know how to translate the linux instructions to my windows environment.

Thaks in advance.

Alberto
albertodg
 
Posts: 3
Joined: 20. January 2011 18:31

Re: No access to user directory

Postby Sharley » 11. February 2011 02:28

Access forbidden means your directory directive is incorrect in either your httpd.conf file or your httpd-xampp.conf file or both - read the \xampp\apache\logs\error.log file for clues.


In XAMPP the only place to put an Alias is in the user config file httpd-xampp.conf and not in the httpd.conf file

So it would be best to return the httpd.conf file back to the defaults as the httpd-xampp.conf file will override the httpd.conf file any way.

Please read this topic for more info on the Alias directive and it's correct placement and syntax.
viewtopic.php?f=16&t=44454

Your Alias contains errors and may look like this with the spaces in the correct locations but your absolute path is also incorrect unless your folder is in the \xampp\htdocs folder - anywhere else will give a 403 access denied error:
Code: Select all
Alias /myalias /myaliasedfolder
<Directory /myaliasedfolder>
Order allow,deny
Allow from all
</Directory>


You may need to include the full path to your myalisedfolder, for example if your folder is located in the root of the C drive
Code: Select all
Alias /myalias "C:/myaliasedfolder/"
<Directory "C:/myaliasedfolder">
Options Indexes +FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>

BTW the link you posted was incorrect *nix permissions which do not apply to Windows XAMPP as the permissions are set with the Order, Allow and Deny directives - also when trying to cross reference *nix configuration with Windows based configurations you will get many errors unless you are very familiar with how both paths and syntax work.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: No access to user directory

Postby albertodg » 11. February 2011 12:01

Many thanks, Sharley.

The white space was a typo in the post, bot it was correct in the conf file.

I didn't include the C:/ drive in the path because it is a portable installation. I keep XAMPP in an USB drive.

Everythig was correct (except the alias made in httpd.conf). The two included in httpd-xampp.conf did work. I just didn´t include the Options Indexes, and there was no index.htm file in the folder.

I modified the directory directive as you indicate and everything works perfect.

Thanks again,

Alberto
albertodg
 
Posts: 3
Joined: 20. January 2011 18:31


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 134 guests