Auto-Deploy Files w/Account Creation

6 posts / 0 new
Last post
#1 Fri, 08/25/2006 - 20:11
TonyDilado

Auto-Deploy Files w/Account Creation

I was wondering if someone coudln't verify or clarify the necessary steps to automatically deploy certain files with each account creation. Specifically, I want to deploy a hardlink to php-fcgi in fcgi-bin/ along with a default index.html in public_html/

I looked to /etc/skel expecting I would see the default template there but the directory is empty. Is it necessary to recreate the files like fcgi-bin/ and public_html/ in order for files to be properly placed when accounts are created?

Is there a directory where virtualmin stores its own default account template?

Any information regarding this topic would be immensely helpful

Thanks in advance, Ciphex

Tue, 09/05/2006 - 15:50
Joe
Joe's picture

Hey Tony,

Virtualmin creates some of the directory structure itself, and then pulls in /etc/skel (by default--you can create your own skels anywhere you want, and select them based on the Server Template being used, for example). You do have to recreate the path where you'd like things to appear in whatever skel directory you're using...so, if you want a default index page to drop into every new domain, you'd do:

mkdir /etc/skel/public_html
cp my-new-index.html /etc/skel/public_html/index.html

Virtualmin's default directories are predominantly created programmatically, rather than from an existing template directory. Any additions you want to do can usually be done in the skel.

Also, I'll point out that the fcgi stuff isn't working yet. I'm switching over to mod_fcgid (after a long, ornery, and finally failed attempt at using mod_fastcgi) this week, and I expect it to all in the repository quite soon. You won't have to add anything to your skel for this to work (and even if you add something to your skel now, it won't work, unless you do a lot of building and poking and reconfiguring yourself).

--

Check out the forum guidelines!

Mon, 10/02/2006 - 19:55
TonyDilado

Hey Joe,

Thank you for replying.

I run Mandriva 2006 with Apache 2.0.54 w/mod_suexec and mod_fastcgi. So far the setup has been real nice , but its a very low production server used primarily for development so this is all at face value. I've heard more than once that mod_fcgid is the way to go, and I will probably migrate that way too here in the near future.

I did manage to setup some default files for the initial environment of new users using /etc/skel. I'm experiencing an issue now though where public_html/ is chmodded 750 upon account creation which inhibits apache from delivering content. I can either chmod it back to 755 or chown it userid.apache, but what I'd like to do is have everything working upon account creation. Is there a way from within Virtualmin to alter the default permissions on these directories, is it a mandriva issue or virtualmin? I have gone through the Server Template options a few times now looking for relevant material but to no avail.

Regards,
Tony

PS> I've been documenting my server setup for howtoforge, your welcome to have a look if your interested. What flavor are you running with?

Mon, 10/02/2006 - 22:47 (Reply to #3)
Joe
Joe's picture

Hey Tony,

In our default install, all of your new domain groups should be added to the apache user as secondary groups. So 750 should be sufficient for Apache to serve everything--if it isn't, something isn't quite right in the configuration.

Check to be sure that in the Templates you're using the option labeled "Add Apache user to Unix group for new servers?" in the "Apache website" section is configured correctly. Specifically, it ought to be "Yes" and the apache user needs to be whatever user the apache process runs as. On Red Hat based systems it is "apache", on others it may be "nobody" or "apache2", perhaps...I'm not sure off-hand what it is for Mandrake.

If this is a Virtualmin Professional installation and you haven't changed this, let me know, as I'd like to make sure there isn't something broken in the Mandrake virtualmin-base package.

--

Check out the forum guidelines!

Mon, 10/02/2006 - 22:49 (Reply to #4)
Joe
Joe's picture

Oh, yeah, to correct the problem on existing domains, you can just add the apache user to the domain groups in the /etc/group file. Like so:

testdomain:x:508:apache

--

Check out the forum guidelines!

Tue, 10/03/2006 - 19:42
TonyDilado

Hey Joe,

You are indeed correct, enabling "Add Apache user to Unix group for new servers?" fixed everything. I'm running the Mandrake virtualmin-base package, not the professional version though it does look like an attractive alternative.

Thanks again!
Tony