You are not logged in.

#1 2008-10-22 03:35:46

qianli
Member
Registered: 2008-06-10
Posts: 8

[SOLVED]HELP! Can't change Apache default documentRoot!

hi, everyone, I encountered a weired apache problem.

Environment:
     Archlinux 2.6.27
     Apache 2.2.9-4

Problem:
     I changed apache default DocumentRoot (/srv/http) to another place (/home/qianli/WWW/http), but I got Error 403 unless I used default. My httpd.conf below:

DocumentRoot "/home/qianli/WWW/http"
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "/home/qianli/WWW/http">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html index.htm index.php
</IfModule>

My files permissions:

qianli ~/WWW/http $  ll
total 32
drwxr-xr-x  6 qianli qianli 4096 2008-10-22 10:04 .
drwxr-xr-x  3 qianli qianli   80 2008-10-22 11:03 ..
drwxr-xr-x 10 qianli qianli 4096 2008-10-10 00:17 acquia
drwxr-xr-x  2 qianli qianli    1 2008-10-20 17:20 cgi-bin
-rw-r--r--  1 qianli qianli  101 2008-10-22 10:04 index.html
drwxr-xr-x  2 qianli qianli   16 2008-10-21 17:26 logs
-rwxrwxrwx  1 qianli qianli   22 2008-10-21 14:19 phpinfo.php
lrwxrwxrwx  1 qianli qianli   20 2008-10-21 12:46 phpmyadmin -> /srv/http/phpMyAdmin
drwxr-xr-x  2 qianli qianli   24 2008-10-21 14:54 test
-rw-r--r--  1 qianli qianli  113 2008-10-21 14:22 test.html
-rw-r--r--  1 qianli qianli    8 2008-10-21 14:42 test.txt

Log:

[Wed Oct 22 10:43:32 2008] [error] [client 127.0.0.1] (13)Permission denied: access to / denied, referer: http://localhost/
[Wed Oct 22 10:43:33 2008] [error] [client 127.0.0.1] (13)Permission denied: access to / denied, referer: http://localhost/
[Wed Oct 22 10:51:15 2008] [error] [client 127.0.0.1] (13)Permission denied: access to / denied, referer: http://localhost/

I tried to change permission to 777, but I still got 403!

Last edited by qianli (2008-10-24 04:29:38)

Offline

#2 2008-10-22 05:49:14

mycow
Member
From: Athens / Greece
Registered: 2008-09-28
Posts: 10
Website

Re: [SOLVED]HELP! Can't change Apache default documentRoot!

Have you tried changing your /home/qianli/WWW/http to /home/qianli/public_html/http to see if it works?

Offline

#3 2008-10-22 06:26:59

qianli
Member
Registered: 2008-06-10
Posts: 8

Re: [SOLVED]HELP! Can't change Apache default documentRoot!

@mycow,
       Thanks. As you said, I changed /home/qianli/WWW/http to /home/qianli/public_html/http, but I still got 403 error.

Offline

#4 2008-10-22 07:35:50

mycow
Member
From: Athens / Greece
Registered: 2008-09-28
Posts: 10
Website

Re: [SOLVED]HELP! Can't change Apache default documentRoot!

have you enabled userdir or not? Can you send me your httpd.conf to check it out?

Offline

#5 2008-10-22 12:42:00

qianli
Member
Registered: 2008-06-10
Posts: 8

Re: [SOLVED]HELP! Can't change Apache default documentRoot!

mycow wrote:

have you enabled userdir or not? Can you send me your httpd.conf to check it out?

@mycow,
      OK, I will paste my httpd.conf tomorrow because it is in my another pc. Thank you smile

Offline

#6 2008-10-23 02:47:32

qianli
Member
Registered: 2008-06-10
Posts: 8

Re: [SOLVED]HELP! Can't change Apache default documentRoot!

hello, mycow, you can see my httpd.conf at here: http://qianli.me/wp-content/uploads/httpd.conf.txt

Offline

#7 2008-10-23 05:44:38

mycow
Member
From: Athens / Greece
Registered: 2008-09-28
Posts: 10
Website

Re: [SOLVED]HELP! Can't change Apache default documentRoot!

Change the following
DocumentRoot "/home/qianli/WWW/http" to DocumentRoot "/home/qianli/public_html"
<Directory "/home/qianli/WWW/http"> to <Directory "/home/qianli/public_html">
ScriptAlias /cgi-bin/ "/home/qianli/WWW/http/cgi-bin/" to ScriptAlias /cgi-bin/ "/home/qianli/public_html/cgi-bin/"
<Directory "/home/qianli/WWW/http/cgi-bin"> to <Directory "/home/qianli/public_html/cgi-bin">

Create the folder public_html and tell me what errors do you get

Offline

#8 2008-10-23 08:55:58

qianli
Member
Registered: 2008-06-10
Posts: 8

Re: [SOLVED]HELP! Can't change Apache default documentRoot!

@mycow, thanks. I did it as you said, but nothing changes:

Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
localhost
Thu Oct 23 16:54:49 2008
Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8i DAV/2 mod_python/3.3.1 Python/2.5.2

Offline

#9 2008-10-23 10:07:54

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [SOLVED]HELP! Can't change Apache default documentRoot!

Your home directory is likely to have 700 permissions. See here.

Offline

#10 2008-10-24 04:32:03

qianli
Member
Registered: 2008-06-10
Posts: 8

Re: [SOLVED]HELP! Can't change Apache default documentRoot!

foutrelis wrote:

Your home directory is likely to have 700 permissions. See here.

OMG, foutrelis, you are right! I never found my home directory is 700 permissions, now I change it and everything is OK! Thank you, foutrelis, thanks mycow, too

Offline

Board footer

Powered by FluxBB