Submitted by lp86 on Fri, 02/14/2014 - 01:07
I had posted about this in the forum a while back. I just noticed it again today. When creating top level servers the default is fcgid for PHP. but when creating sub servers the default is mod_php. I have seen this happen on multiple installs. All on CentOS 6, both architectures.
Status:
Active
Comments
Submitted by JamieCameron on Fri, 02/14/2014 - 16:11 Comment #1
Does the sub-server template perhaps have a different setting for the default PHP execution mode?
You can see this at System Settings -> Server Templates.
Submitted by lp86 on Fri, 02/14/2014 - 16:25 Comment #2
Yes, the default is mod_php, this is on a completely clean install, every single time. The only setting that was changed besides the initial setup wizard was setting "Include domain name in usernames?" from "Always" to "Only to avoid a clash".
Submitted by JamieCameron on Fri, 02/14/2014 - 17:00 Comment #3
That is very unusual. Does the file
/etc/webmin/virtual-server/templates/1
exist on your system, and if so what does it contain?Submitted by lp86 on Fri, 02/14/2014 - 17:10 Comment #4
Yes, the time stamp is exactly when the initial setup wizard was ran. I also checked a few other systems and they are the exact same way.
Here is the contents of the file:
autoconfig=none
resources=none
dns_spf=none
domalias=none
for_users=1
user_aliases=none
skel=none
mailboxlimit=none
php5fcgi=none
disabled_web=none
defmquota=51200
name=Settings For Sub-Servers
ushell=none
avail=dns=1 mail=1 web=1 webalizer=1 mysql=1 postgres=1 spam=1 file=1 passwd=1 proc=2 cron=1 at=1 telnet=1 updown=0 change-user=1 htaccess-htpasswd=1 mailboxes=1 custom=0 shell=0 webminlog=0 syslog=1 phpini=1
php_vars=+memory_limit=32M
web_stats_pass=1
web_webmin_ssl=0
dnssec_alg=
web_ssi_suffix=
mail_on=none
othergroups=none
nodbname=0
dns_sub=yes
webmin_group=
mysql_chgrp=1
for_sub=1
spamtrap=none
ugroup=none
aliascopy=1
web_php_ini_4=
web_php_suexec=2
dnssec=none
mysql_charset=
norename=
dns_replace=
mail_subject=Virtual server created
web_sslport=443
domslimit=0
extra_prefix=none
id=1
mysql_conns=none
dbslimit=none
web_ssi=2
mysql_mkdb=1
spamclear=none
web_suexec=1
quota=1048576
status=none
namedconf_no_allow_transfer=
web_php_ini_5.5=
ranges=none
ftp_dir=
mail_bcc=
namedconf=none
logrotate=none
mysql_uconns=none
created=1392164651
mysql=${PREFIX}
web_html_perms=750
dom_aliases=postmaster=${EMAILTO} webmaster=${EMAILTO} abuse=${EMAILTO} hostmaster=${EMAILTO}
mailgroup=none
hashpass=0
web_writelogs=
uquota=1048576
sgroup=none
web_admin=0
php4cgi=none
dns_view=
hashtypes=*
web_stats_noedit=1
domalias_type=0
mysql_nouser=0
web_port=80
ranges6=none
safeunder=
mongrelslimit=4
outlook_autoconfig=none
web_webmail=0
append_style=0
logrotate_files=none
disabled_url=none
frame=
web=ServerName ${DOM} ServerAlias www.${DOM} DocumentRoot ${HOME}/public_html ErrorLog /var/log/virtualmin/${DOM}_error_log CustomLog /var/log/virtualmin/${DOM}_access_log combined ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/ DirectoryIndex index.html index.htm index.php index.php4 index.php5 <Directory ${HOME}/public_html> Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch </Directory> <Directory ${HOME}/cgi-bin> allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch </Directory>
web_phpver=5
featurelimits=none
resellers=*
web_php_ini_5.4=
mysql_collate=
quotatype=hard
mysql_nopass=0
php5cgi=none
mail_cc=
dns=
standard=1
web_ruby_suexec=-1
dns_prins=1
mysql_suffix=none
capabilities=none
ftpgroup=none
dns_ns=
forceunder=0
dns_master=none
php4fcgi=none
web_php_ini_5=
bwlimit=none
dom_aliases_bounce=0
web_usermin_ssl=0
dbgroup=none
bccto=none
web_php_ini_5.3=
for_parent=0
ftp=ServerName ${DOM} <Anonymous ${HOME}/ftp> User ftp Group ftp UserAlias anonymous ftp <Limit WRITE> DenyAll </Limit> RequireValidShell off ExtendedLog ${HOME}/logs/ftp.log </Anonymous>
owners=*
aliaslimit=none
web_php_noedit=0
mail=
ipfollow=
web_alias=1
for_alias=0
dns_ttl=
dns_records=
postgres_encoding=none
mysql_hosts=none
mysql_wild=
dnssec_single=
webalizer=none
namedconf_no_also_notify=
web_phpchildren=
file=/etc/webmin/virtual-server/templates/1
Submitted by JamieCameron on Fri, 02/14/2014 - 17:36 Comment #5
That actually looks fine - the line
web_php_suexec=2
should enable use of mod_fcgid.Do the sub-servers you are creating have home directories?
Submitted by lp86 on Fri, 02/14/2014 - 17:50 Comment #6
They don't have any users, they are websites only stored under the domains directory of the parent server. I checked the actions log, I changed the template after I discovered all of my subservers were using mod_php. Here is the same file from a server that is unmodified.
I was looking at the wrong server when I mentioned the timestamp, this one shows the initial setup was done at at "16/Dec/2013 20:58" and the timestamp is "Dec 16 20:58".
This system has only one top level site, so there was no reason to look at the subserver template.
autoconfig=none
resources=none
web_html_dir=
dns_spf=none
domalias=none
for_users=1
user_aliases=none
skel=none
mailboxlimit=none
php5fcgi=none
disabled_web=none
defmquota=51200
name=Settings For Sub-Servers
ushell=none
avail=dns=1 mail=1 web=1 webalizer=1 mysql=1 postgres=1 spam=1 file=1 passwd=1 proc=2 cron=1 at=1 telnet=1 updown=0 change-user=1 htaccess-htpasswd=1 mailboxes=1 custom=0 shell=0 webminlog=0 syslog=1 phpini=1
php_vars=+memory_limit=32M
web_stats_pass=1
web_webmin_ssl=
dnssec_alg=
web_ssi_suffix=
mail_on=none
othergroups=none
nodbname=0
dns_sub=yes
webmin_group=
mysql_chgrp=1
for_sub=1
spamtrap=none
ugroup=none
aliascopy=1
web_php_ini_4=
web_php_suexec=0
dnssec=none
mysql_charset=
norename=
dns_replace=
mail_subject=Virtual server created
web_sslport=443
domslimit=0
extra_prefix=none
id=1
mysql_conns=none
dbslimit=none
web_ssi=2
mysql_mkdb=1
spamclear=none
web_stats_hdir=
web_suexec=1
quota=1048576
status=none
namedconf_no_allow_transfer=
web_php_ini_5.5=
ranges=none
ftp_dir=
mail_bcc=
namedconf=none
logrotate=none
mysql_uconns=none
created=1387245489
mysql=${PREFIX}
web_html_perms=750
dom_aliases=postmaster=${EMAILTO} webmaster=${EMAILTO} abuse=${EMAILTO} hostmaster=${EMAILTO}
web_stats_dir=
mailgroup=none
hashpass=0
web_writelogs=
web_webmaildom=
uquota=1048576
sgroup=none
web_admin=1
php4cgi=none
dns_view=
hashtypes=*
web_stats_noedit=1
domalias_type=0
mysql_nouser=0
web_port=80
ranges6=none
safeunder=
web_user=
mongrelslimit=4
outlook_autoconfig=none
web_webmail=1
append_style=0
logrotate_files=none
disabled_url=none
frame=
web=ServerName ${DOM} ServerAlias www.${DOM} DocumentRoot ${HOME}/public_html ErrorLog /var/log/virtualmin/${DOM}_error_log CustomLog /var/log/virtualmin/${DOM}_access_log combined ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/ DirectoryIndex index.html index.htm index.php index.php4 index.php5 <Directory ${HOME}/public_html> Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch </Directory> <Directory ${HOME}/cgi-bin> allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch </Directory>
web_phpver=
featurelimits=none
resellers=*
web_admindom=
web_php_ini_5.4=
mysql_collate=
quotatype=hard
mysql_nopass=0
php5cgi=none
mail_cc=
dns=
standard=1
web_ruby_suexec=-1
dns_prins=1
mysql_suffix=none
capabilities=none
ftpgroup=none
dns_ns=
forceunder=0
dns_master=none
php4fcgi=none
web_php_ini_5=
bwlimit=none
dom_aliases_bounce=0
web_usermin_ssl=
dbgroup=none
bccto=none
web_php_ini_5.3=
for_parent=0
ftp=ServerName ${DOM} <Anonymous ${HOME}/ftp> User ftp Group ftp UserAlias anonymous ftp <Limit WRITE> DenyAll </Limit> RequireValidShell off ExtendedLog ${HOME}/logs/ftp.log </Anonymous>
owners=*
aliaslimit=none
web_php_noedit=0
mail=
ipfollow=
web_alias=1
for_alias=0
dns_ttl=
dns_records=
postgres_encoding=none
mysql_hosts=none
mysql_wild=
dnssec_single=
webalizer=none
namedconf_no_also_notify=
web_phpchildren=
Submitted by JamieCameron on Fri, 02/14/2014 - 19:45 Comment #7
Ok, that file is clearly incorrect - it has
web_php_suexec=0
which forces mod_php mode.So is the timestamp on that file when you installed Virtualmin, or when you ran the wizard?
Also, did you restore any backups (such as of global settings) after installation?
The quick fix for your current problem is to just delete the file
/etc/webmin/virtual-server/templates/1
which will force the template back to its default settings.Submitted by lp86 on Fri, 02/14/2014 - 19:51 Comment #8
I ran the post install script shortly after, this was in the action log with the same timestamp "Ran post-install script". Nothing was restored, a new site was created, a single top level server.
There is no mention of any template changes or restorations in the action log. I have seen this exact same thing happen many many times. I don't encounter it much because nobody uses subservers very much.
Submitted by JamieCameron on Sat, 02/15/2014 - 17:48 Comment #9
When you say you ran the post-install script, what command did you run exactly? The regular Virtualmin install script should run everything you need.
Submitted by lp86 on Sat, 02/15/2014 - 20:27 Comment #10
I don't know exactly what "Ran post-install script" means, but it seems to show up in the action log whenever the virtual-server module is updated.
Here is basically what I am doing, and it happens every single time.
Create server with CentOS minimal
Run install.sh
Login to Virtualmin
Change setting "Include domain name in usernames?" from "Always" to "Only to avoid a clash".
Create virtual server
look at subserver template, it wants to use mod_php
Submitted by JamieCameron on Sun, 02/16/2014 - 00:42 Comment #11
Ok, I see how - the "Ran post-install script" action is internal to Virtualmin.
Did you happen to notice if the subserver template was incorrect before creating the first virtual server?
Submitted by lp86 on Sun, 02/16/2014 - 03:43 Comment #12
I just did clean install on a test system. I installed VM using the install script, logged in and went to server templates -> subserver and apache is set to use mod_php.
Something in the installation process is creating a subserver template, here is a screenshot of the window.
No settings were changed Nothing was restored No sites were created Initial setup wizard has not been ran yet
Virtualmin was installed into the CentOS x86 minimal template provided by the OpenVZ team, using the install script. I have also seen this happen on physical installations using the CentOS minimal ISO.
Submitted by JamieCameron on Mon, 02/17/2014 - 01:14 Comment #13
The sub-server template will always exist. However, after a fresh install it should inherit everything from the "default settings" template.
If you click on it after doing a new install and then select the "Apache website" category, is the PHP execution mode set wrong?
Submitted by lp86 on Mon, 02/17/2014 - 01:44 Comment #14
Yes, it is set to mod_php, something in the install script or related packages is doing this.
Submitted by JamieCameron on Mon, 02/17/2014 - 20:10 Comment #15
Can you try running the following commands for me - I'd like to see if manually running the post-install script re-creates the template.
rm /etc/webmin/server-manager/templates/1
cd /usr/libexec/webmin
WEBMIN_CONFIG=/etc/webmin WEBMIN_VAR=/var/webmin /usr/libexec/webmin/run-postinstalls.pl virtual-server
and then check the template again.
Submitted by lp86 on Mon, 02/17/2014 - 20:29 Comment #16
[root@test ~]# rm /etc/webmin/virtual-server/templates/1
[root@test ~]# cd /usr/libexec/webmin
[root@test webmin]# WEBMIN_CONFIG=/etc/webmin
[root@test webmin]# WEBMIN_VAR=/var/webmin
[root@test webmin]# /usr/libexec/webmin/run-postinstalls.pl virtual-server
WEBMIN_CONFIG not set at web-lib-funcs.pl line 4156.
[root@test webmin]# echo $WEBMIN_CONFIG
/etc/webmin
Submitted by lp86 on Mon, 02/17/2014 - 21:06 Comment #17
I updated this test system, and it showed "Ran post-install script" in the action log, the file was no recreated.
Submitted by JamieCameron on Mon, 02/17/2014 - 22:59 Comment #18
You need to change the lines to :
export WEBMIN_CONFIG=/etc/webmin
export WEBMIN_VAR=/var/webmin
Submitted by lp86 on Mon, 02/17/2014 - 23:18 Comment #19
The template was not recreated using that command. Still happening with the 4.05 virtual-server update on a new install. Here is the Virtualmin install log, maybe there is some insight in there.
https://www.ohiointernet.net/tempo/virtualmin-install-log.txt
Submitted by JamieCameron on Tue, 02/18/2014 - 23:41 Comment #20
Ok, I think I've nailed this down. A fix will be included in the next Virtualmin release.
Thanks for your persistence!
Submitted by lp86 on Wed, 02/19/2014 - 00:25 Comment #21
Awesome! Glad I could be of some help.
So deleting "/etc/webmin/virtual-server/templates/1" will reset the subserver template back to inherit from the main template? (for any affected systems)
Submitted by Drisco on Thu, 02/20/2014 - 05:29 Comment #22
Hello both of you,
I was about to post a similar issue.
I'm runing Virtualmin GPL on Debian 7 servers and I noticed that most of the options of the Sub-Servers template are not set on default values anymore. That has been happening on every fresh install since a few months, presumably since the 4.03 version (unsure about that).
I'm glad that it has been reported and that it will be fixed in the next release, thank you :)