Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
Setting up an FTP user account and permissions FTP user permissions CaptainCandy msg:3298336 2:43 pm on Mar 31, 2007 (gmt 0) Setting up an FTP user account and permissions
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 Now I have found I can fudge things by post FTP issuing; sudo chmod g+rx my-site -R on the my-site directory. Which works. But there must be a correct way of doing this, and as yet I have been unable to find out what it is.
Mega thanks in advance to anyone who can help me out with this :)
encyclo msg:3298511 7:17 pm on Mar 31, 2007 (gmt 0)
The best way of organizing multiple virtual hosts is to create a user for each site, then host the site in the home directory of the user.
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
directory within it for the site. So alpha would be hosted in:
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
for each virtual host, and then you can keep cgi scripts in:
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.