Author Topic: [SOLVED] Apache Alias gives 403 Forbidden.  (Read 6491 times)

Offline CJ

  • Sr. Member
  • ****
  • Posts: 456
[SOLVED] Apache Alias gives 403 Forbidden.
« on: March 03, 2010, 05:20:32 AM »
Ok, I am all googled out and nearing my last hairs to pull out...  >:(

I have set up Apache and it runs smooth with the normal document root, which displays just fine.
However, when trying to set up an Alias, I get forbidden 403 on the path.

Code: [Select]
   Alias /archive/ "/mnt/q-archive/HTTP/HTTProot"
    <Directory "/mnt/q-archive/HTTP/HTTProot">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
    </Directory>

I have tried changing permission on directories and files to allow all, to just apache (the user and group). Also tried with or without the trailing / on archive.

Just to test, I set up a second Alias that just pointed to my 'normal' documentroot. Still does not work as an Alias (though fine as just 127.0.0.1):

Code: [Select]
   # Test for permissions.
    Alias /archive2/ "/mnt/n-http/HTTProot"
    <Directory "/mnt/n-http/HTTProot">
    Options Indexes
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>

The above also gives me a 403. I think, by doing this, I have ruled out that it is a permissions problem on the directories/files themselves, and suspect some sort of contradiction in httpd.conf?

error_log confirms:
Code: [Select]
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotindex.php
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotindex.phtml
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotindex.shtml
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotindex.html
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotindex.htm
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotindex.php
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotDefault.htm
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotdefault.htm
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotdefault.asp
[Wed Mar 03 12:14:37 2010] [error] [client 127.0.0.1] client denied by server configuration: /mnt/n-http/HTTProotindex.xml


I used to get this to work on my previous installations, but can't seem to get it right this time around.
Could anyone point me in the right direction?
I am on KDE4, btw.

Cheers!
CJ
« Last Edit: May 19, 2010, 12:27:38 PM by CJ »

Offline MBantz

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1318
Re: Apache Alias gives 403 Forbidden.
« Reply #1 on: March 03, 2010, 05:47:08 AM »
Hi CJ,

I'm having the exact same issue - need to dig more into Apache settings to figure this out.

My workaround is to put the files in a subdirectory under /var/www/html.

I'll just hang on to this thread if anyone have the solution :-)

cheers,
MBantz

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5383
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Apache Alias gives 403 Forbidden.
« Reply #2 on: March 03, 2010, 07:28:31 AM »
Try changing the AllowOverride None yo AllowOverride All and see if that doesn't work as expected




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline CJ

  • Sr. Member
  • ****
  • Posts: 456
Re: Apache Alias gives 403 Forbidden.
« Reply #3 on: March 03, 2010, 07:35:40 AM »
Try changing the AllowOverride None yo AllowOverride All and see if that doesn't work as expected

Tried that... sorry, no juice, still forbidden.
error_log also remains the same.

Thanks for helping!
CJ

Offline CJ

  • Sr. Member
  • ****
  • Posts: 456
Re: Apache Alias gives 403 Forbidden.
« Reply #4 on: May 19, 2010, 12:16:40 PM »
Sorry for digging up this old thing, but... time has passed and I have done a fresh 2010 install in the meantime, though the issue is still the same as previous incarnation reported above.

This time - after sorting out permissions all the way down to the location - error log is less complex and stick to this:
Code: [Select]
client denied by server configuration: /mnt/q-archive/HTTP/HTTProot.

I'm having the exact same issue - need to dig more into Apache settings to figure this out.

I'll just hang on to this thread if anyone have the solution :-)
Did you ever sort it out?


Never had trouble with this in the past... must be doing something different... If anyone has any ideas, it would help me greatly.

Cheers!
CJ
« Last Edit: May 19, 2010, 12:18:14 PM by CJ »

Offline CJ

  • Sr. Member
  • ****
  • Posts: 456
Re: Apache Alias gives 403 Forbidden.
« Reply #5 on: May 19, 2010, 12:25:47 PM »
*** STOP PRESS ***

Immediately, after bringing this post back to live, I saw it!!  :o Case is solved!

In both the alias locations, the trailing slash is very important - so regardless of you having a trailing slash in your alias*, you must also have one after the full path!

(* If you have it in your alias, you must have it in your URL, but this is irrelevant to the full path, apparently.)

Code: [Select]
Alias /archive/ "/mnt/q-archive/HTTP/HTTProot/"
...
<Directory "/mnt/q-archive/HTTP/HTTProot/">
    Options -Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Now, let's see if it still works tomorrow, ha!

Sorry for bringing this old thread to live again for such a short stay, but I am glad I did - I don't think I would have spotted it otherwise.

Cheers!
CJ