On my VPS, at the moment, I'm hosting multiple websites on different virtual hosts using apache2.
The creation process of each new website is as following:
adduser websitename
su websitename
mkdir ~/public_html
mkdir ~/logs
exit
chmod g+s ~/public_html/
chown www-data:websitename ~/public_html/
Then, I add the websitename.com virutal host file to /etc/apache2/sites-available/
and run the a2ensite
command and restart the apache2 process.
I have 2 questions:
- At the moment,
www-data
has no real permissions to edit the files on/public_html/
for some reason, how can I fix this? - Is there anything else you would add to the process of creating the vhost?
P.S: I'm using Ubuntu 10.04 hosted on Linode.