View previous topic :: View next topic |
Author |
Message |
Ian l33t
Joined: 28 Oct 2002 Posts: 834 Location: Somerville, MA
|
Posted: Thu Apr 03, 2003 8:27 pm Post subject: Changing Apache Document Root Directory |
|
|
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 |
|
|
magnet Guru
Joined: 16 Mar 2003 Posts: 582 Location: france
|
Posted: Thu Apr 03, 2003 8:34 pm Post subject: |
|
|
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. _________________ every step aim at glory. |
|
Back to top |
|
|
Ian l33t
Joined: 28 Oct 2002 Posts: 834 Location: Somerville, MA
|
Posted: Thu Apr 03, 2003 8:55 pm Post subject: |
|
|
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 |
|
|
OoAzzAoO n00b
Joined: 03 Apr 2003 Posts: 9
|
Posted: Mon Apr 07, 2003 3:46 am Post subject: check the config for apache |
|
|
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 |
|
|
gigel Guru
Joined: 14 Jan 2003 Posts: 370 Location: .se/.ro
|
Posted: Mon Apr 07, 2003 10:33 am Post subject: |
|
|
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
|
|
Back to top |
|
|
Ian l33t
Joined: 28 Oct 2002 Posts: 834 Location: Somerville, MA
|
Posted: Mon Apr 07, 2003 6:39 pm Post subject: |
|
|
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 ). i'm going to keep trying, hopefully a combination of the two will work? |
|
Back to top |
|
|
magnet Guru
Joined: 16 Mar 2003 Posts: 582 Location: france
|
Posted: Mon Apr 07, 2003 10:05 pm Post subject: |
|
|
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 |
|
|
khel Tux's lil' helper
Joined: 07 Mar 2003 Posts: 80
|
Posted: Tue Apr 08, 2003 2:42 pm Post subject: |
|
|
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 |
|
|
gigel Guru
Joined: 14 Jan 2003 Posts: 370 Location: .se/.ro
|
Posted: Tue Apr 08, 2003 4:20 pm Post subject: |
|
|
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
|
|
Back to top |
|
|
|