Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Changing Apache Document Root Directory
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Ian
l33t
l33t


Joined: 28 Oct 2002
Posts: 834
Location: Somerville, MA

PostPosted: Thu Apr 03, 2003 8:27 pm    Post subject: Changing Apache Document Root Directory Reply with quote

Got Apache2 to come up, and the default Document Root directory (/home/httpd/htdocs) works fine. Except, I had Apache running in a Debian server (which has been replaced with a Gentoo server), and the Document Root dir was on a 120 gig hard drive that acted as a fileserver/webserver storage space. So, that's /dev/hdg2 and it's mounted into /arch (for archives, i know i should change it, but i've been lazy :p). my Document Root dir for Apache is "/arch/gen/www" and i'd like it to be that again. The problem is that when I change the Document Root, I get an error saying that "You don't have permission to access / on this server."

I'm not sure why, but I think it's because Gentoo applies superstrict permissions to Apache, and I don't know how to change those. This is the only thing keeping me from getting my server back up, and it's getting very annoying very fast :p.
Back to top
View user's profile Send private message
magnet
Guru
Guru


Joined: 16 Mar 2003
Posts: 582
Location: france

PostPosted: Thu Apr 03, 2003 8:34 pm    Post subject: Reply with quote

you need to set the perm on the full path ,
for exemple if you set DocumentRoot to /mnt/mydisk/htdocs/
you'll need to chmod 755 /mnt /mnt/mydisk /mnt/mydisk/htdocs. 8)
_________________
every step aim at glory.
Back to top
View user's profile Send private message
Ian
l33t
l33t


Joined: 28 Oct 2002
Posts: 834
Location: Somerville, MA

PostPosted: Thu Apr 03, 2003 8:55 pm    Post subject: Reply with quote

i tried that, yet it doesn't seem to work :/

would the exact command be "chmod 755 /mnt /mnt/mydisk /mnt/mydisk/htdocs" or seperate for each directory?

also, after i do that, it should just work? cause i tried that, and either it doesn't like me, or i'm doing something wrong :p.
Back to top
View user's profile Send private message
OoAzzAoO
n00b
n00b


Joined: 03 Apr 2003
Posts: 9

PostPosted: Mon Apr 07, 2003 3:46 am    Post subject: check the config for apache Reply with quote

when u moved the doc root..

check the commonapache.conf and look for these lines:

Code:

#un-comment this line
<Directory />
    Options -Indexes FollowSymLinks
    AllowOverride None
</Directory>

# COMMENT this out
#Restricted set of options
#<Directory />
#  Options -All -Multiviews
#  AllowOverride None
#  Order deny,allow
#  Deny from all
#</Directory>


that should get you rolling... chmod -R 755 it all as said above and you should be cool... apachectl is your friend... check your config ... good? great... now create some content!

-sorry it's sketchy but it's sooo late!!!
[/b]
_________________
------------------
witty sigs are just not my specialty
Back to top
View user's profile Send private message
gigel
Guru
Guru


Joined: 14 Jan 2003
Posts: 370
Location: .se/.ro

PostPosted: Mon Apr 07, 2003 10:33 am    Post subject: Reply with quote

dunno if it works(for me is working but i have linked to /tmp/apache) but atleast try it

do not change the root directory leave it /home/httpd/htdocs
and than do
Code:
ln -sf /arch/gen/www /home/httpd/htdocs



regards
_________________
$emerge sux
:D
Back to top
View user's profile Send private message
Ian
l33t
l33t


Joined: 28 Oct 2002
Posts: 834
Location: Somerville, MA

PostPosted: Mon Apr 07, 2003 6:39 pm    Post subject: Reply with quote

i tried both things, and i didn't get either of them to work. my computer is having some problems though (it's freezing up, I think I need to add that 128 MB of RAM my dad just gave me :P). i'm going to keep trying, hopefully a combination of the two will work?
Back to top
View user's profile Send private message
magnet
Guru
Guru


Joined: 16 Mar 2003
Posts: 582
Location: france

PostPosted: Mon Apr 07, 2003 10:05 pm    Post subject: Reply with quote

Quote:

would the exact command be "chmod 755 /mnt /mnt/mydisk /mnt/mydisk/htdocs" or seperate for each directory?


try like that :

Code:

chmod 755 /mnt/mydisk
chmod 755 /mnt/mydisk/htdocs

_________________
every step aim at glory.
Back to top
View user's profile Send private message
khel
Tux's lil' helper
Tux's lil' helper


Joined: 07 Mar 2003
Posts: 80

PostPosted: Tue Apr 08, 2003 2:42 pm    Post subject: Reply with quote

Did you change "DocumentRoot" only in apache2.conf?? If so, you'll need to change it in commonapahche2.conf as well.
Look for
Quote:
###This should be changed to whatever you set Document root to.
###
<Directory /home/httpd/htdocs>



And in case you're planning on using SSL, don't forget to change DocumentRoot in
/etc/apache2/conf/modules.d/41_mod_ssl.default-vhost.conf

At least it worked for me :-)
Back to top
View user's profile Send private message
gigel
Guru
Guru


Joined: 14 Jan 2003
Posts: 370
Location: .se/.ro

PostPosted: Tue Apr 08, 2003 4:20 pm    Post subject: Reply with quote

magnet wrote:
Quote:

would the exact command be "chmod 755 /mnt /mnt/mydisk /mnt/mydisk/htdocs" or seperate for each directory?


try like that :

Code:

chmod 755 /mnt/mydisk
chmod 755 /mnt/mydisk/htdocs


or
Code:

chmod -cR 755 /mnt/mydisk

_________________
$emerge sux
:D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum