Problem userdir ~username on apache

i have problem user cannot add or edit file on their directory
i mean /home/user/public_html

i have httpd.conf like this :

................

# UserDir
Include etc/apache22/extra/httpd-userdir.conf

and httpd-userdir.conf

................
#
UserDir public_html
UserDir disabled root toor daemon operator bin tty kmem games news man sshd bind proxy _pflogd _dhcp uucp pop www nobody mail
null smmsp
#
# Control access to UserDir directories. The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>

and permision user at home directory

before:

sipitung# ls -ll
total 18
-rw-r--r-- 1 moslemovic www 758 Jul 12 05:24 .cshrc
-rw-r--r-- 1 moslemovic www 258 Jul 12 05:24 .login
-rw-r--r-- 1 moslemovic www 167 Jul 12 05:24 .login_conf
-rw------- 1 moslemovic www 379 Jul 12 05:24 .mail_aliases
-rw-r--r-- 1 moslemovic www 339 Jul 12 05:24 .mailrc
-rw-r--r-- 1 moslemovic www 773 Jul 12 05:24 .profile
-rw------- 1 moslemovic www 284 Jul 12 05:24 .rhosts
-rw-r--r-- 1 moslemovic www 980 Jul 12 05:24 .shrc
drwxr-xr-x 2 root www 512 Jul 12 06:22 public_html

after owner i change to public_html

-rw------- 1 moslemovic www 284 Jul 12 05:24 .rhosts
-rw-r--r-- 1 moslemovic www 980 Jul 12 05:24 .shrc
drwxr-xr-x 2 www www 512 Jul 12 06:24 public_html

test via browser is running :
Index of /~moslemovic

but when i try to edit

test.txt

hhahhahhhahhahhhaha

Error: test.txt: Permission denied.

Ask:
what can i do about this configure to httpd.conf and user directory owner, i make home because i wan give access ftp to home user.

thanx for your repply

Moslemovic

Yow can't change public_html to www and not give group write on the file to the user if you want to be able to edit the file.

As root,

cd ~moslemovic
chown -R moslemovic ./public_html
chgrp -R www ./public_html
chmod -R 755 ./public_html

That way moslemovic can edit any file in the folder and www can read/execute anything in the folder.