Hi all,
After updating the Apache server Virtualmin send me back the following message. (See under)
Then the web servers does not work anymore. I had to restart it manually but then
when accessing the web page it always ask to open PHTML file.
After investigate on google I also discover that my httpd.conf file was totally empty
(gloups..! no backup !).
Is there anyway to recreate / regenerate this configuration file ?
If not is there a way to install again without breaking the existing site and mail server ?
Tks for any help on this matter
CedSha
Now updating apache2 ..
Installing package(s) with command apt-get -y install apache2 ..
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
apache2-mpm-worker apache2.2-common
The following packages will be REMOVED:
apache2-mpm-prefork libapache2-mod-php5
The following NEW packages will be installed:
apache2-mpm-worker
The following packages will be upgraded:
apache2 apache2.2-common
2 upgraded, 1 newly installed, 2 to remove and 8 not upgraded.
Need to get 1115kB of archives.
After this operation, 6173kB disk space will be freed.
Get:1 http://software.virtualmin.com virtualmin-hardy/main apache2 2.2.8-12vm.ubuntu0.14 [45.0kB]
Get:2 http://software.virtualmin.com virtualmin-hardy/main apache2.2-common 2.2.8-12vm.ubuntu0.14 [816kB]
Get:3 http://software.virtualmin.com virtualmin-hardy/main apache2-mpm-worker 2.2.8-12vm.ubuntu0.14 [254kB]
Fetched 1115kB in 5s (215kB/s)
(Reading database ... 67995 files and directories currently installed.)
Preparing to replace apache2 2.2.8-10vm (using .../apache2_2.2.8-12vm.ubuntu0.14_all.deb) ...
Unpacking replacement apache2 ...
(Reading database ... 67992 files and directories currently installed.)
Removing libapache2-mod-php5 ...
Module php5 disabled; run /etc/init.d/apache2 force-reload to fully disable.
dpkg: apache2-mpm-prefork: dependency problems, but removing anyway as you request:
mailman depends on apache2 | httpd; however:
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
Package httpd is not installed.
Package apache2-mpm-prefork which provides httpd is to be removed.
virtualmin-base depends on apache2; however:
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
mailman depends on apache2 | httpd; however:
Package apache2 is not configured yet.
Package apache2-mpm-prefork which provides apache2 is to be removed.
Package httpd is not installed.
Package apache2-mpm-prefork which provides httpd is to be removed.
Removing apache2-mpm-prefork ...
* Stopping web server apache2
...done.
(Reading database ... 67983 files and directories currently installed.)
Preparing to replace apache2.2-common 2.2.8-10vm (using .../apache2.2- common_2.2.8-12vm.ubuntu0.14_amd64.deb) ...
Unpacking replacement apache2.2-common ...
Selecting previously deselected package apache2-mpm-worker.
Unpacking apache2-mpm-worker (from .../apache2- mpm-worker_2.2.8-12vm.ubuntu0.14_amd64.deb) ...
Setting up apache2.2-common (2.2.8-12vm.ubuntu0.14) ...
Installing new version of config file /etc/apache2/mods-available/disk_cache.conf ...
Installing new version of config file /etc/apache2/mods-available/autoindex.conf ...
Setting up apache2-mpm-worker (2.2.8-12vm.ubuntu0.14) ...
* Starting web server apache2
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
...fail!
invoke-rc.d: initscript apache2, action "start" failed.
Setting up apache2 (2.2.8-12vm.ubuntu0.14) ...
Howdy,
If you're an Ubuntu user, your httpd.conf file should be empty :-)
In Ubuntu, it uses /etc/apache2/apache2.conf, and the individual VirtualHosts go in /etc/apache2/sites-enabled.
The error you're getting though -- is that for all domains on your server, or just one of them?
Also, was it your intention to switch from Apache's prefork mode to mpm-worker? It looks like that occurred during your update. That should, in theory, be okay, but it's a possible thing to look into :-)
However, what I'd suggest doing is looking in the Apache logs after you attempt to view your website... look in /var/log/apache2/error_log, and $HOME/logs/error_log, for any clues as to why you're seeing that problem. There may be some relevant error messages showing up in the logfiles.
-Eric
Hi Eric,
Tks for fast answer ...!
Yes Ubuntu (Hummm seem I did not search enough about this httpd.conf...)
The error comes on all domain of the server, however I try to display a simple HTML page without any php/mysql stuff and this one work well. As far as I understand Apache now cannot run PHP script.
I had no intention to switch prefork all this append automatically while updating Apache. This is during package update suggested by Virtualmin. I try to back to
apache2-mpm-prefork and libapache2-mod-php5
but without any success.
The logs files do not send informations when accessing these pages !
I try to add in the the /etc/apache2/apache2.conf file :
AddType application/x-httpd-php .php .phtml
AddHandler cgi-script .pl
Also without success.
-CedSha
Hi again,
I noticed the module PHP5 to be unchecked on
WEBMIN>Servers>Apache Web Server>Global configuration>Configure Apache modules
which should not be the case as I use PHP. I try to check back then I get an error message :
httpd not running, trying to start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down.
I was already having this message at the end of Apache update. According to
http://seanbehan.com/apache/fun-with-apache2-httpd-not-running-trying-to... it should be related to some SSL problem but I do not use SSL.
Then I restart Apache again without any change this time it start well
I am still wondering what happens during this Apache update as it was very usual update.
Many thanks Eric for your support. Knowing someone is behind me help me more than you could never imagine.
-CedSha
I had a similar problem with Ubuntu 8.04 LTS today, updating to the latest apache from within virtualmin but, in my case, it actually wiped out the php module entirely. I found this message on the Ubuntu boards and was successful in fixing it up:
http://ubuntuforums.org/showthread.php?t=1439483&highlight=apache2+php+p...
Not sure if the problem was at all webmin/virtualmin related but, the other poster mentions having updated apache from within webmin as well.
When you check the log of the installation (see 1st original message) you will find the following
Removing libapache2-mod-php5 ...
So to be sure there is a problem at this step. I have also installed back this module before my recovery.
-- CedSha
www.lineaire.net
www.exalibur.com.cn
I had the exact same problem. PHP5 was removed after upgrading Apache2 on Debian Lenny through webmin. I had to reinstall PHP5 and libapache2-mod-php5.
It only seems to happen to people who use webmin.
Is this a bug in webmin?
Or would it also have happened if I used aptitude instead?
Jan Derk
Well, I had to shutdown my whole server because of this. Since apache wasn't responding to /etc/init.d/apache2 stop.
This is a serious security problem... because all the PHP source code is downloaded as HTML. Anyone can easily get our mysql passwords, private code, etc... ... now that the server is shutdown, this means my e-mail is also down!!! this is very frustrating.
I have been unsuccessful and resolving this. I reinstalled libapache2-mod-php5 ... restarted apache2 ... with no luck. Since the server is offline, I can't even try things out ... I have to figure out a solution before I can put it online and then apply it as quickly as possible and hope that no one tries to access the site during that time... wow, this is a good lesson. Never run an update without making a manual backup first.
You can imagine how frustrated my clients are right now, I have about 20 sites hosted on this server including my own.
What worked for you guys? Any help will be so greatly appreciated! I'm running debian 4 x64.
:( :( :( This really sucks!!!!!
Edit: manually killed apache2 process using killall so I can try to fix this.
The problem you're describing is much different than the other folks in this thread... the other folks had a problem where mod_php was disabled upon upgrading, which causes Apache to fail to start.
That particular problem is fixable by re-enabling mod_php.
The problem you're describing is one where PHP is not executing PHP scripts. When did the problem start? Had anything changed around that time? And do any errors show up in the Apache error logs?
-Eric
Hi Eric,
Thanks for the reply, I didn't realize that apache failed to start for the others. My case is certainly very different in that case.
Apache2 ran and worked fine for me after the update. Only the php problem was observed. The only other thing I meddled around with on the server was a BIND DNS setting, and is completely unrelated.
I looked in the apache2 logs. Nothing related was there, just some 403 errors from me trying to access domains that I had not put index files into.
Basically, in my case the php module was not only disabled, it was removed altogether. In addition, APACHE2-MPM-PREFORK was also removed. I installed this and LIBAPACHE2-MOD-PHP5 twice, and manually added a config file to parse php scripts in the apache conf.d area. I had to enable to php5 module again as well. I couldn't stop apache2 using the init.d scripts, so I had killed the process so that my PHP scripts were not directly downloaded as HTML in plain text. Anyway, after doing all this the problem was solved earlier today. After doing the final reboot, it worked fine.
Then my squid3 proxy had cached the PHP scripts as HTML textfiles so I had to completely wipe the cache as well. This recent problem has made me feel very uncomfortable with my server. Why did this happen?
Here is my apt log by the way:
The problem you're describing is much different than the other folks in this thread... the other folks had a problem where mod_php was disabled upon upgrading, which causes Apache to fail to start.
I had the same problem as eagleon. In my case Apache worked just fine. The problem was that php5 was removed when upgrading through virtualmin, causing PHP scripts to be downloaded as text.
I had to reinstall in php5 and libapache2-mod-php5.
Help~!
I have the same problem. PHP is not parsed. I tried sudo aptitude install php5 libapache2-mod-php5 apache2-mpm-prefork and still it's not working. I have the config back-up but restoring it's not helping. What do I do??
So you're getting what error specifically?
There's a few different problems described in this thread, with a few different ways of solving each of them :-)
The issue with PHP directives being in the Apache config should certainly be fixed by enabling mod_php though. If that's the problem you're having, and installing mod_php didn't fix it, it may mean mod_php isn't being enabled when Apache starts up. You may want to verify that the module is both installed as well as enabled.
-Eric
Older thread, but I thought I would share how I got mine working again. This should work if your running apache2 on any version of linux.
Connect to your server via SSH and type
a2enmod php5
OR if your using php4
a2enmod php4
Then restart apache with
/etc/init.d/apache2 force-reload
Worked for me, and if you get an error, that would probably be easier to find answers if you google the error message direct from the server, and not from a web based server admin system.