HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   Web server offline after php4 and apache2 upgrade (http://www.howtoforge.com/forums/showthread.php?t=6687)

dfriis 6th September 2006 14:05

Web server offline after php4 and apache2 upgrade
 
I wanted to upgrade the apache and php version on my debian sarge installation and followed the instructions at http://www.howtoforge.com/forums/sho...=upgrade+mysql

I didn't change the file sources.list though, I just did an apt-get update first to check if there were any updates for me, and there was.

I'm not sure what it did upgrade though but when I try to start apache I get:

Code:

www:/var/log/httpd# /etc/init.d/apache2 restart
Forcing reload of web server: Apache2 ... failed!
You may still have some apache2 processes running.  There are
processes named 'apache2' which do not match your pid file,
and in the name of safety, we've left them alone.  Please review
the situation by hand.
Syntax error on line 48 of /etc/apache2/vhosts/Vhosts_ispconfig.conf:
Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration

The only thing I wrote was:
Code:

apt-get update
apt-get install mysql-server mysql-client libmysqlclient12-dev
apt-get install apache2 apache2-doc
apt-get install libapache2-mod-php4 libapache2-mod-perl2 php4 php4-cli php4-common php4-curl php4-dev php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt curl libwww-perl imagemagick

I've searched the forums for a while now and the only problem I think I might have is that mod_php isn't loaded. Why is that setting lost and how can I fix it?

I'm not that confident around apache, php and linux but I'm good at following instructions. It's just a pain in the behind that everything gets messed up as soon as you try to use this friggin' system...

Please help me, this server is in some sort of production and I have to get it up and running :(

Ben 6th September 2006 14:15

The first question is, why apt-get install worked, if you wand to dou an update, because the command herefore is after and apt-get update
apt-get upgrade.

It seems that mod_php is not properly installed andy that's why he's telling
Quote:

Invalid command 'php_admin_flag', pe
So I would try stop the apache if running, and afterwards take a look with
ps aux | grep apache if processes of apache are still running.

If your config still exists, backup it, then I would reinstall all things you wanted to upgrade regarding apache2 and see if that helps...

dfriis 6th September 2006 15:45

Quote:

Originally Posted by till
Have you tried what falko posted, it works!

If you run apt-get upgrade or apt-get dist-upgrade it will upgrade your system. If you use apt-get install, apt will install the package and if it is already installed apt will look if there are newer packages and makes an update.

After reading the above, quoted from the link I posted, I though it was perfectly fine to use the install command. It was fine too, untill the server tried to start the webserver again. It found a few packages to upgrade and did so, there were no errors in the installation procedure what I know of.

I've rebooted the machine now but I don't seem to get it up and running again. It's a remote server so I have to get back to you with the updates. Have to make a few calls and get people to boot it up for me :)

Is there no way to install mod_php without reinstalling everything? I just can't see the fun in reinstalling the entire server everytime some upgrade/change mess it up.

dfriis 6th September 2006 20:23

Well, the server is up and running again but there is still no working webserver.

If there is no way to just install mod_php, what is the simplest way to reinstall the packages I tried to upgrade?

What config files do I HAVE to backup before doing this? Please tell me this is doable without reinstalling the system...

till 7th September 2006 10:24

Quote:

Originally Posted by dfriis
If there is no way to just install mod_php, what is the simplest way to reinstall the packages I tried to upgrade?

run this commad as root user:

Code:

apt-get install libapache2-mod-php4 libapache2-mod-perl2 php4 php4-cli php4-common php4-curl php4-dev php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt curl libwww-perl imagemagick

fbnewtz 28th September 2006 05:36

Figured out how to solve this problem
 
Just for those people who are desperately trying to figure out what happened after they upgraded and PHP will not work.

From the /etc/apache2/mods-enabled folder run the following commands
Code:

/etc/apache2/mods-enabled# ln -s /etc/apache2/mods-available/php4.load
/etc/apache2/mods-enabled# ln -s /etc/apache2/mods-available/php4.conf


falko 29th September 2006 13:50

Quote:

Originally Posted by fbnewtz
From the /etc/apache2/mods-enabled folder run the following commands
Code:

/etc/apache2/mods-enabled# ln -s /etc/apache2/mods-available/php4.load
/etc/apache2/mods-enabled# ln -s /etc/apache2/mods-available/php4.conf


You can run
Code:

a2enmod php4
instead. It does the same.

sgrayban 5th December 2006 10:10

Mandriva 2007 & maybe other distros have this issue
 
I use mandriva and ran into this crap issue....

Mandriva likes to make modules of _everything_ for apache and I was getting the same errors and ISPConfig was not loading in new websites because httpd -t was throwing a vail but invalid error.

The problem begins when you instaall a apache2 module and it installs it into 'modules.d/70_mod_php4.conf' or something like that.

httpd -t doesn't load that in -- know why ? Cause in Mandriva atleast 1 issue is going on.
1) httpd -t doesn't check syntax with the included 'Include modules.d/*.conf' still

So what I had to do was manually add the following into httpd.conf ....

LoadModule php4_module extramodules/mod_php4.so
LoadModule suexec_module extramodules/mod_suexec.so

These two modules _MUST_ be loaded into the main httpd.conf for 'httpd -t' to work. After I did that the error 'Invalid command 'php_admin_flag' went bye bye and all was good.

The suexec_module will also throw a error if its loaded the same way the php4 module is so I had to add that as well.

Maybe 'httpd -t' just isn't a good idea until the apache people fix this bug. I already reported it.

falko 6th December 2006 16:59

Have a look at this tutorial: http://www.howtoforge.com/perfect_setup_mandriva_2007
The problem and the solution are described there, too.

sgrayban 6th December 2006 19:59

That howto for mandriva needs lots of work... Mainly remove all the useless graphics.


All times are GMT +2. The time now is 03:40.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.