Create Virtual Sub-Server

I have been having a problem when creating Sub-Servers that I want to bring to your attention. I think I have narrowed it down. This problem only happens when I use the combination of “Create Virtual Sub-Server” and Server configuration template “Default Setting For Sub-Servers”.

Explanation

Goto Virtualmin> System Settings> Server Templates> Default Settings For Sub-Servers> form “Edit template section:” select “Apache website”. The first option is “Directives and settings for new websites” with two radio button choices “From default settings” and “Apache directives below ”. The radio button next to “From default settings” is selected and most of the page is greyed out. Which I assumed meant that the information on the Sub-Servers Apache website page was replaced with the information from Apache website default template settings page.

My question is, is that assumption supposed to be correct?

Because what happens is when you got to Virtualmin> Create Virtual Server> Sub-server> Server configuration template dropdown box> and select “Default Setting For Sub-Servers” then click the create server button, the server is created using all the greyed out features mentioned above.

I have run this test several times now and am sure this is what is happening. I would have thought that if features were greyed out they were not to be used.

Status: 
Active

Comments

Yes, the default behavior is for setting for a sub-server to come from the template for a top-level server.

What specific feature or setting are you seeing is being used incorrectly when the server is created?

In the Default Settings template the “Default PHP execution mode” is set to “FCGId (run as virtual server owner)” but when a Sub-Server is created as mentioned above the mode that is used is “Apache mod_php (run as Apache's user)” which is the mode selected but greyed out on the “Default Settings For Sub-Servers” “Virtual server template details (Apache website)” page.

Odd, I can't re-produce this on my system .. and actually, those settings are how Virtualmin is by default.

Apart from the PHP mode, is there anything else that doesn't get properly inherited from the default settings template?

To be honest I am not really sure. This is what I know. I wrote a php program that I want virtualmin to copy into each virtual server that I create. One of the first things that this program does is to check exec('whoami') to find who apache is running as, then it checks the setup folder and files in the setup folder to confirm they are owned by the same. If they are not the same the program will not go any further until they are because when the setup process is finished all the setup files are deleted by apache to prevent them being run again. In order for these files to be deleted by apache the apache user and the files owner have to be the same.

When I create a Virtual Sub-Server using the Default Setting For Sub-Servers the php program sais that the apache user is www-data and the files owner are the first part of the Sub-Server name. Yet on the “Virtual server template details (Apache website)” page the “Default PHP execution” mode is greyed out, but the radio button next to “Apache mod_php (run as Apache's user)” is selected and that is, what is happening.

I have found a better solution to using the “Default Setting For Sub-Servers” template any way. I created my own template from the “Default Settings” template. I point this out so you know there is no rush to find and fix this problem, however if I can send you any files to assist with tracking it down let me know.

Allan

You are on Ubuntu 10.04, right? Because the default Apache configs for that distro have a setting that forces use of mod_php , no matter what Virtualmin does :-(

The work-around is to edit /etc/apache2/mods-available/php5.conf and comment out the SetHandler lines, then restart Apache.

Let me know if that helps for you.

You are on Ubuntu 10.04, right?

My current server is actually Ubuntu 8.04. But the new one which I want to switch to soon is Ubuntu 10.04. The Ubuntu 10.04 is the server I am discussing in this thread.

Because the default Apache configs for that distro have a setting that forces use of mod_php , no matter what Virtualmin does :-(

What possessed them to do that? (Rhetorical)

Will virtualmin be able to fix it in the future?

The work-around is to edit /etc/apache2/mods-available/php5.conf and comment out the SetHandler lines, then restart Apache.

Is this something that I will have to set for each new machine or is it necessary now because Ubuntu 10.04 is so new and you guys have not had a chance to get everything working properly yet?

Will the work-around fix any virtual servers that have already been created or only new virtual servers?

When you say

comment out the SetHandler lines

Do you mean

#
# SetHandler application/x-httpd-php
#
#
# SetHandler application/x-httpd-php-source
#

Or just the lines that commence with SetHandler

I know I have said it before but thanks for the great help and I am amazed at how fantastic Virtualmin is.

Allan

You only really need to comment out the lines starting with SetHandler .

I'm not sure why Ubuntu made this change, but the next release of the Virtualmin installer will handle it by doing that commenting-out for you.