Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm setting up a test server for use as a web development platform, and I'd like to mimic as closely as I can a typical shared hosting setup. That is, I'd like my server to have multple user FTP accounts, each of which links to a directory containing the webroot of the site, and I'd like apache to be able to easily see and manupulate these files.

I'll admit: I'm not as familiar with Fedora as I'd like, I run Ubuntu on my home box and SElinux is giving me some grief. My initial plan was to have each user FTP into their home directory, and put the web directory there as well, but SElinux throws a hissy fit when apache tries to access anything outside of its web directory, so that plan was a no go.

Would it be wise to continue this route, and perhaps mount web directories in user home folders so that FTP could still be used to access them, even though apache saw them in var/www like it expects? Would it make more sense to set up custom FTP accounts and use a single FTP user on the server box? What's the general course of action on something like this? I'm using vsftpd right now to host web directories, which is why I'm liking the home directory approach (it's simple and secure) but of course there's bound to be a better way to go about it.

Thanks. (I'll leave other things, like restricted DB access and such, to another post. I'm interested right now with just getting FTP and apache to play nice in a multi-user environment.)

PS: For the record, an issue I ran into when doing all of this was that if apache isn't running as the same user as the FTP account is saving as, there are permissions errors when FTP creates files, requiring the remote user to chmod the files to fix it. A logical fix would be to run apache in a special group, put all web users in this group, and have FTP access default to giving this group read/write access to everything like apache would expect, but I never could figure out how to accomplish this. Bonus points and cake if you know a solution.

share|improve this question
add comment

3 Answers 3

you can install one of those

as for the ps, here's my solution

1 - all files in the web root are owned by the user apache runs as (www, for example) 2 - the ftp daemon has the chroot option set on (ie nobody can get out of their home direectory) and the right umask for creating files

if you can name what ftp daemon you intend to use, I can be more specific

share|improve this answer
add comment

The first thing I'd suggest is installing Webmin. It will do exactly what you want, and many hosting providers use it too.

share|improve this answer
    
Wow. What a useful, useful tool. For the sake of argument of course, I'm looking for how one would manually do this, but that might save me a lot of grief anyway. ^_^ –  Nicholas Flynt Aug 15 '09 at 6:32
add comment

The ISPConfig control panel is fantastic and is very typical of shared hosting platforms I'd say.

Even if just administering one website I use it to alleviate lots of repetitive tasks.

It also has great setup HowTo's in the Documenttion section.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.