Forum Moderators: bakedjake
Ok I have my virtual servers working under Apache 2 on an old P3 running Ubuntu Server. I have my router set-up so that my URL points to it. Fantastic! I am hosting my own website! The problem comes when I set-up Dreamweaver on my Windows machine (my chosen development environment) for FTP to my Apache box. Now I am still learning Linux so forgive my thickness. I set-up my user as follows:-
briansnr@ubuntu:/etc/apache2$ sudo useradd -m -d /var/www/my-site -g www-data bristolcar-vanhire
briansnr@ubuntu:/etc/apache2$ sudo passwd my-site
This works fine, in that I can now use FTP to login as my-site. But anything I FTP has the wrong permissions as such
-rw------- 1 my-site www-data 26352 Mar 31 14:43 index.html
sudo chmod g+rx my-site -R
Mega thanks in advance to anyone who can help me out with this :)
For example, you have site alpha and beta, both hosted on the same server. You create a user account for each site, eg.:
# adduser alpha You will have a home directory for each, and you can create a
public_html directory within it for the site. So alpha would be hosted in: /home/alpha/public_html Then you can use user alpha's FTP account to connect and upload the site, and the files will have the permissions of user alpha instead of www-data.
From there, you can alter you virtual hosts in httpd.conf to include a
ScriptAlias for each virtual host, and then you can keep cgi scripts in: /home/alpha/cgi-bin This is a rough guide, but hopefully you should get the idea. For site beta, the situation is the same, and you can keep the FTP accounts within each site's home directory.