Webserver not properly created during sub-server creation

Hello,

I created a sub-server today for an existing domain and it seemed to work as intended. But the webserver features was not enabled afterwards, therefore i.e. the script-installers were not available.

Investigating the problem has shown, that the webserver seems to be created, but the feature is not enabled. Deleting the sub-server results in the deletion, but the created webserver in apache settings is still there and has to be deleted manually.

I found that a parameter is not set proberly in the domain config found under:

/etc/webmin/virtual-server/domains/

Parameter web=0 is set, instead of web=1.

I tried to set it manually, but found then, that there are permissions issues too (acutally I installed a Joomla 1.5.12 and I was not able to set the config because the files were not writable... this worked fine in the past). Therefore I guess that there is more to do besides setting the parameter.

I created a sub-server about 3-4 weeks ago and in the meantime there was an update to virutalmin, therefore I guess it is a new issues with this update.

Please tell me, if you need further information.

Thanks in advance for your help. Christian

Status: 
Closed (fixed)

Comments

I would suggest disabling and then re-enabling the website feature for the domain, as it appears that it may have failed part-way through. This can be done on the Edit Virtual Server page..

This will force a correct re-setup. Let us know if it helps..

As it is disabled after creation, I only can try to enable it. This results in a message (translated from german): "could not save settings: this domain is already hosted on this system (message of web server)".

Which is right, as the virtual web server is set up in the apache config...

Therefore I tried deleting the virtual apache server, then enabled the feature, all seems to be fine during the creation, but afterwards the situation is all the same... the feature is disabled, but the virtual apache server is set up :(

What is the output you get from Virtualmin when enabling the web feature? I'd like to see if there is any error or if it appears in-complete..

I switched to englisch language for better understanding.

I deleted the virtual web server then enabled the feature... this is the output:

Adding new virtual website .. .. done

.. Apache website failed! :

Updating Webmin user .. .. done

Saving server details .. .. done

Applying web server configuration .. .. done

Re-loading Webmin ..

.. done

Hmm, ... seems I have overseen the "website failed" message before...

Ok, that failure is the cause of the problem.

So that we can see what is really going wrong, try SSHing into your system as root, deleting the apache virtual host and then re-trying to enable the website feature with the command :

virtualmin enable-feature --domain whatever.com --web

and let me know what it outputs.

So, .. I removed the file /etc/apache2/sites-available/domain.conf and the link in /etc/apache2/sites-enabled/domain.conf, then restarted apache2 (which from my point of view is the same action as deleting it from within webmin, or?).

The output is all the same as in reply #4.

I should mention, that I already tried it with another subdomain, that has not existed before ... the result is all the same.

I remember 2 chances that I have done recently:

1) I installed and configured fail2ban (but I don't see how this could have an effect here) 2) I installed mod-security apache mdoule

Maybe you see an connection between that setups and the situation?

All other changes have been solely the updates done with aptitude.

Best regards

Another thing to try is turning on extended debugging of errors, at Webmin -> Webmin Configuration -> Advanced Options -> Show stack trace for error messages?. Then re-try running the enable-feature command again (after cleaning up the partial Apache config), and let me know what it outputs..

This is the output with enables extended debugging:

Updating server domain.xyz .. Adding new virtual website .. .. done

Error: Could not find any values in section PHP File: /usr/share/webmin/phpini/phpini-lib.pl Line: 115 Function: WebminCore::error File: /usr/share/webmin/virtual-server/php-lib.pl Line: 119 Function: phpini::save_directive File: /usr/share/webmin/virtual-server/feature-web.pl Line: 2510 Function: virtual_server::save_domain_php_mod e File: /usr/share/webmin/virtual-server/feature-web.pl Line: 235 Function: virtual_server::add_script_language_ directives File: virtual-server-lib-funcs.pl Line: 8316 Function: virtual_server::setup_web File: virtual-server-lib-funcs.pl Line: 8316 Function: (eval) File: virtual-server-lib-funcs.pl Line: 10068 Function: virtual_server::try_function File: /usr/share/webmin/virtual-server/enable-feature.pl Line: 150 Function: virtual_server::call_feature_func .. Apache website failed! :

Updating Webmin user ..
.. done

.. done

Applying web server configuration .. .. done

Re-loading Webmin .. .. done

Ok, now we are getting somewhere. What does that domain's etc/php5/php.ini and etc/php4/php.ini file contain? You can attach them to this bug report.

Virtualmin isn't happy if they are just empty files, or don't have a section starting with [PHP]

Ok, first thing I noticed: the /etc/ dirctory contains only a /php4 directory. Checking another already existing domain there should be also a /php5 directory and a file php.ini.

The directory /etc/php4 of the not-working sub-server does not contain any php.ini :(

Another thing I noticed, but do not know, if it is ok... checking the apache modules I only found php5 there, php4 is not set up... hmm, shouldn't it be there as you can choose which version to use for every site??

Ok, I did the following now:

  • I deleted the virtual apache webserver
  • I copied the php settings from another sub-server changing the domain name in the files
  • re-enabled the webserver feature

Seems to work.

So it comes down to php settings, that prevent the creation, ... any ideas on that?

So if you create a new test domain, do it's etc/php*/php.ini files get created? It seems like that is the issue..

The cause of this may be that your system's /etc/php5/cgi/php.ini file is not readable by the domain owner, and so cannot be copied into the domain's directory.

I just created a completely new domain "testdomain123.com" and enabled the webserver feature during creation.. afterwards is was disabled like it is on the other domains.

It's not just an issue for this domain, I created a other sub-server before and had the same problem.

The permissions are set up like this (I never changed anything there):

servername:/etc/php5/cgi# ls -l insgesamt 44 lrwxrwxrwx 1 root root 9 2008-10-08 10:21 conf.d -> ../conf.d -rw------- 1 root root 42332 2009-03-03 07:50 php.ini

I created the domain with a user, that I used always for every domain hosted within this installion. The user was created right after setup of virtualmin was completed and "root" user was never used again, except for additional user creation.

Where can I "dig deeper" to find the solution?

Ok, I see the issue .. the php.ini file is not world-readable, so it cannot be copied into new virtual servers.

Make it readable with the command :

chmod +r /etc/php5/cgi/php.ini

and all should be well.

Should, but unfortunately isn't :(

I deleted the domain testdomain123.com, I cleared up the virtual apache server, then set +r for php.ini, I even restarted apache.

Then I re-created the domain and it is all the same.. it doesn't work. :(

Adding Apache user www-data to server's group .. .. done

.. Apache website failed! :

ah... I just noticed.. .debugging is still active, but the creation does not show any more information. Strange...

Is there any chance I could login and take a look at this? I'd need SSH access as root..

I found a bug that was preventing the error messages from appearing fully in this case, so it isn't clear exactly why it is failing.

Uhm, ... sorry, is this really necessary? Not only that giving you access to the system is a security risk and I'm not really like the idea that something is changed, that I do not know... there is also some setting preventing access as root.

Is there a chance that you can pilot me throught that? Or for the start providing me a updated script or where ever the bug (preventing the error message from appearing) that I can apply to have more information afterwards?

I also can provide you every log or config file you need for a solution.

Alternately, I could send you a Virtualmin minor update that shows the error message properly. I presume you are on Debian, and so would like a .deb package?

Also, do you have the GPL or Pro version?

This is debian etch installed and it is the pro version. a .deb package would be fine.

Ok, I have emailed it to you..

So, after installation the message during creation of the virtual server was:

Performing other Apache configuration .. .. configuration failed : Failed to copy /etc/php4/cgi/php.ini to /home/testdomain123/etc/php4/php.ini : cp: »/etc/php4/cgi/php.ini« kann nicht zum Lesen geöffnet werden: Keine Berechtigung

Therefore I changed the permission of this file, too (third line is in german, don't know why, but it says "could not open for reading: no permission").

Then I cleaned up and re-created testdomain123.com and all seems to be fine. I deleted and re-created another time.

I tried all the same twice with a new subdomain and with one, that had already existed but was cleaned up before.

It works....

So thanks to your update and the debug message we could clear up this... I still wonder how this could happen.... why was the permission changed? Was it changed? Or did it work with +r for owner only work before??

Anyway... THANKS! Great support!

I'm not sure how those permissions could have been broken, as the default on all my Ubuntu and Debian systems is world-readable .. and Virtualmin doesn't touch php.ini files under /etc/ normally.

The next release will include a fix to be more resilient to this type of failure though, and not leave the domain's website in a half-setup state.

Automatically closed -- issue fixed for 2 weeks with no activity.