jivan...@poczta.onet.pl pisze:
Temat był już poruszany na pl.comp.www,
tak jak napisałeś:
> Na serwerze hostingowym działa OK, problem jest z localhostem.
> Chyba mam coś nie tak Apachem...
Poniżej konfiguracja, która powinna zadziałać:
/etc/httpd/httpd.conf
LoadModule userdir_module modules/mod_userdir.so
<IfModule mod_userdir.c>
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#UserDir disable
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#UserDir public_html
UserDir WWW
</IfModule>
Opcjonalnie można dodać (zgodnie z zakomentowanym przykładem):
<Directory /home/*/WWW>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
DirectoryIndex index.html index.html.var index.php
</Directory>
Uprawnienia dla katalogów są istotne (SELinux może spowodować 403):
drwxr-xr-x root root system_u:object_r:root_t:s0 //
drwxr-xr-x root root system_u:object_r:home_root_t:s0 /home/
drwx--x--x sp users user_u:object_r:user_home_dir_t:s0 /home/sp/
drwxr-xr-x sp users root:object_r:httpd_sys_content_t:s0 /home/sp/WWW/
-rw-r--r-- sp users root:object_r:httpd_sys_content_t:s0 /home/sp/WWW/index.php
http://example.org/~sp/
http://example.org/~sp/index.php
powyższe wywołania działają zgodnie z tym czego oczekujesz.