If you want to have a “www” folder in your home directory and not to use the default: /var/www, you need to use a Virtual Directory within the Apache HTTP Server
Virtual Directories use a module called “mod_alias” wich redirects request to folders outside the server root.
Lets create a virtual directory that will be located in: /home/user/www and will be accessed via: http://url/user
1.- Edit the configuration file (as root)
$ vi /etc/httpd/conf/httpd.conf
Look for the section “Aliases” we’ll write the following lines:
Alias /user “/home/user/www/” <Directory "/home/user/www"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory>
Save and close the file.
2.- Restart the service with:
(as root) $ /etc/init.d/httpd restart
3.- Create the folder “www” in: /home/user and a file to test.
$ mkdir /home/user/www $ cd ~/www $ vi index.html
Now we should be able to access the fies of the folder: “/home/user/www” via “http://url/user”