LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-19-2005, 11:23 PM   #1
webgovernor
LQ Newbie
 
Registered: Jun 2004
Distribution: Ubuntu 8.04 LTS, Gentoo (various)
Posts: 28

Rep: Reputation: 15
Apache 403 when changin document root.


Hi guys!

Ummm, I know this has been covered, but
every post I've reads deals with something
other then simply changing the document root.

What I've read, The httpd man pages, some apache documentation,
3 guides, and about 20 posts here.

My system: When I installed mandrake 10.1 I automatically installed Apache 2 along with it.
I can't find a httpd.conf, but I have an httpd2.conf (under etc/httpd/conf)... the default root
is "var/www/html" and the access domain is "localhost" (I didn't set up any users.)

My problem: when I edit httpd2.conf (the DocumentRoot) from /var/www/html to home/user/http I recieve a 403 error, (I'm assuming that means wrong permissions) but
I changed the http folders permissions to 755... (manually without using chmod)

It runs when I use DocumentRoot /var/www/html...
I added index.html index.php to DirectoryIndex, but
it still won't load the index.html file in the home/user/http dir.

So, I'm assuming that I'll have to change something else?
SHould I just copy the whole var/www/html dir to home/user/http?

My question is "What else do I need to change besides the DocumentRoot?"

Oh, and I know this is a really stupid question, maybe I'm reading stuff wrong, and I know
the problem is my fault somehow.

I'll keep messing with it until I atleast get something other then a 403...

Well, thanks a lot!
 
Old 04-20-2005, 12:37 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
You need to change ALL the directories above the document root so that the user Apache runs as can read them. You've changed /home/user/html to 755 but /home/user is probably still 700, thus prohibiting Apache from reading it.
 
Old 04-20-2005, 01:10 AM   #3
webgovernor
LQ Newbie
 
Registered: Jun 2004
Distribution: Ubuntu 8.04 LTS, Gentoo (various)
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks bt!

But... um...

Well here's my original:
Code:
ServerRoot /etc/httpd/2.0
#ServerName localhost
#LockFile /etc/httpd/httpd.lock
PidFile /var/run/httpd.pid
ErrorLog logs/error_log
LogLevel warn
DocumentRoot /var/www/html
And to modify it i'd have to do this:
Code:
ServerRoot /etc/httpd/2.0
#ServerName localhost
#LockFile /etc/httpd/httpd.lock
PidFile /var/run/httpd.pid
ErrorLog logs/error_log
LogLevel warn
DocumentRoot /home/aaron/http
Now, If I change the ServerRoot, PidFile, and ErrorLog... I'd have to copy them to
the /home/aaron/http folder?

Ok, I'll give it a try.

Thanks for the reply!
 
Old 04-20-2005, 01:54 AM   #4
webgovernor
LQ Newbie
 
Registered: Jun 2004
Distribution: Ubuntu 8.04 LTS, Gentoo (various)
Posts: 28

Original Poster
Rep: Reputation: 15
Hey, I got it!


Here was my problem, the following wasn't in my httpd2.conf file:
Code:
<Directory />
   Options FollowSymLinks
   AllowOverride None
</Directory>

<Directory "/home/user/http">DocumentRoot "
   Options Indexes FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>
I can't believe it!

Anyway, thanks!
 
  


Reply


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 - change document root? squall14716 Linux - Software 2 01-20-2010 11:16 AM
Apache 403 access denied outside of document root freedo5 Linux - Software 2 09-21-2005 09:06 PM
Apache 2: won't allow document root to be changed, plus more QtCoder Linux - Networking 1 11-06-2004 05:44 PM
Document Root in Apache Hal Linux - Newbie 2 10-28-2003 07:10 AM
Apache Document Root Path bowen Linux - General 8 11-29-2002 03:13 AM


All times are GMT -5. The time now is 04:35 AM.

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