Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-16-2007, 07:19 AM   #1
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453
Blog Entries: 3

Rep: Reputation: 40
Forbidden 403 error with my apache


Well I'm facing yet another annoying problem which i can't understand why it's happening.


downloaded and installed apache 2.2.6 from the sources
tar ...etc
./configure (default with no extra flags)
make install

then : $ APACHEDIR/apachectl start

now so far everything is working fine , and server handles request from the default DocumentRoot.

So Where is the Problem?
Well , shows up when i want to change the DocumentRoot to anything else than the default one , where i get a Forbidden 403 error.

so far I've checked all possible causes that i know of including the insertion of the directory which lifts the restriction from the new DocumentRoot
<Directory "/root/Desktop">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
and of course i've added (actually it's before the first)
DocumentRoot "/root/Desktop"
and yes I've also set the required access permissions for the directory

and another thing that i've noticed is that changing the DocumentRoot works only when it lies within the ServerRoot.

nonetheless , I've seen other config files on working servers where DocumentRoot lies outside the ServerRoot .
also noting that the default apache docs don't mention anything specifiec about this particular issue.

So basically I'm totally lost right now because i can't understand what I've left out in order to do such a trivial configuration.

P.S Yes I'm offering public access to MY OWN DESKTOP , OHH WEEE !!
but don't be so eager to look what's inside cuz the whole box is firewalled from the outside XD

Old 12-16-2007, 08:31 AM   #2
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453

Original Poster
Blog Entries: 3

Rep: Reputation: 40

you can ignore this unless you want to learn from my experience .

well I found out that not only the document root directory has to have correct permissions but all directories above it as well !!

so if you doc is /your/root/doc

then having access restrictions on "your" would mess everything up even if
"root" and "doc" have 777 permission wildcards.

i think the best way to test whether the whole path is readable and accessible is to assume httpd process point of view by typing
$ su apache-user-account

that would log you in as the same user account that apache uses , then browse the Doc path and if you get blocked then you know where to fix

so that's all

Good Fight Good Night
Old 12-17-2007, 05:33 PM   #3
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
That's why Linux is so safe (Although even Windows uses this hierarchical approach)

However, isn't it better to keep your web files somewhere below /var/www anyway? To avoid making errors and inadvertently opening something up you did not want to open?

You also have /home/yourname/public_html as a good place to store web files, and access them thru /localhost/~yourname. You have to enable this access in apache.conf though.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache: 403 Forbidden Error daemonkl Linux - Newbie 4 10-14-2007 12:15 PM
Apache/1.3.34 Server - Forbidden 403 error njoyzrd Linux - Server 2 06-19-2007 07:51 PM
Error 403 Forbidden access in Apache anoop_cn Linux - Software 1 09-21-2004 09:32 AM
apache error, 403 forbidden afrodocter Linux - Software 6 08-09-2004 08:35 PM
apache 403 error forbidden? bulliver Linux - General 4 01-31-2003 07:47 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:11 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration