Gentoo Forums
Gentoo Forums
Quick Search: in
apache2 mod_php5 and lynx
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gnac
Guru
Guru


Joined: 30 Jun 2003
Posts: 302
Location: Columbia River Gorge

PostPosted: Thu Sep 06, 2007 4:21 am    Post subject: apache2 mod_php5 and lynx Reply with quote

This is getting disgusting! The past three upgrades I have performed have all caused major problems with my system. The first, libexpat, is well documented but still not really fixed, then somehow an unrelated library caused me to have to rebuild openldap because thunderbird wouldn't start. Now, I upgraded apache and php
Code:
emerge -pv php apache

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] dev-lang/php-5.2.4_pre200708051230-r2  USE="apache2 ..." 0 kB
[ebuild   R   ] www-servers/apache-2.2.4-r12  USE="ldap ssl ..." 0 kB


After parsing through all the changes in etc-update to the conf files, and figuring out on my own that all the vhosts have been moved into a new file, I tried to restart, but first I checked the status:
Code:
# /etc/init.d/apache2 status
 * status:  started
/etc/init.d/apache2: line 113: lynx: command not found

wtf is it trying to do with lynx? Well I know what its trying to do, show a server status page. Well there are no "lynx" use flags in the apache build, and lynx is not a dependency of apache. How the heck is it supposed to find it if it isn't built by the system. Anyway, minor annoyance, on to the main problem.

So I try and stop apache and get the following error:
Code:
# /etc/init.d/apache2 stop
 * Apache2 has detected a syntax error in your configuration files:
apache2: Syntax error on line 241 of /etc/apache2/httpd.conf: Syntax error on line 4 of /etc/apache2/modules.d/70_mod_php5.conf: API module structure `php5_module' in file /usr/lib/apache2/modules/libphp5.so is garbled - perhaps this is not an Apache module DSO?


Here are the offending lines
Code:
<IfDefine PHP5>
   # Load the module first
   <IfModule !mod_php5.c>
      LoadModule php5_module    modules/libphp5.so   <-- this is line 4
   </IfModule>


What does this mean? do I have to rebuild PHP perhaps?

Fortunately my server the stop command failed, so my server is still running, and php is still functional on the running processes, but I definately do not want to forcibly stop apache unless I can be assured that it will restart.
_________________
"I thought she'd steal my heart, instead she stole my kidney,
and now its for sale, on the black market in Sydney" - Better Abraham


Last edited by gnac on Thu Sep 06, 2007 8:07 am; edited 1 time in total
Back to top
View user's profile Send private message
Janne Pikkarainen
Veteran
Veteran


Joined: 29 Jul 2003
Posts: 1143
Location: Helsinki, Finland

PostPosted: Thu Sep 06, 2007 5:05 am    Post subject: Re: apache2 mod_php5 and lynx Reply with quote

gnac wrote:

So I try and stop apache and get the following error:
Code:
# /etc/init.d/apache2 stop
 * Apache2 has detected a syntax error in your configuration files:
apache2: Syntax error on line 241 of /etc/apache2/httpd.conf: Syntax error on line 4 of /etc/apache2/modules.d/70_mod_php5.conf: API module structure `php5_module' in file /usr/lib/apache2/modules/libphp5.so is garbled - perhaps this is not an Apache module DSO?


Here are the offending lines
Code:
<IfDefine PHP5>
   # Load the module first
   <IfModule !mod_php5.c>
      LoadModule php5_module    modules/libphp5.so   <-- this is line 4
   </IfModule>


What does this mean? do I have to rebuild PHP perhaps?


Yes, please re-emerge PHP. In case that didn't help, double-check if Apache is trying to load PHP module from the correct directory.
_________________
Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.".
Back to top
View user's profile Send private message
gnac
Guru
Guru


Joined: 30 Jun 2003
Posts: 302
Location: Columbia River Gorge

PostPosted: Thu Sep 06, 2007 8:02 am    Post subject: Reply with quote

Yeah, rebuilding php did the trick. Orignially I upgraded PHP and then apache. Kinda sucks it borked though. working now after mucho mucking around to get my vhosts working again with the new configuration file layout ...

ty
_________________
"I thought she'd steal my heart, instead she stole my kidney,
and now its for sale, on the black market in Sydney" - Better Abraham
Back to top
View user's profile Send private message
GWilliam
Guru
Guru


Joined: 29 Dec 2005
Posts: 350

PostPosted: Wed Sep 12, 2007 11:36 pm    Post subject: Reply with quote

#NULL

Last edited by GWilliam on Sun Jul 25, 2010 4:29 am; edited 1 time in total
Back to top
View user's profile Send private message
RosenSama
Tux's lil' helper
Tux's lil' helper


Joined: 28 Apr 2003
Posts: 98

PostPosted: Thu Sep 13, 2007 4:24 am    Post subject: Reply with quote

GWilliam wrote:
So what's up with the following error?

Code:
# /etc/init.d/apache2 status
 * status:  started
/etc/init.d/apache2: line 113: lynx: command not found


Ditto.

<useless gripe>
Do I really need to install lynx and enable mod_status to to issue a standard init.d status command? If so, how about including the dependency?
</useless gripe>
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1542
Location: U.S.A.

PostPosted: Thu Sep 13, 2007 4:26 am    Post subject: Reply with quote

Ya that stuff wasn't in the apache2 I just replaced. From what I find on the web, doesn't look like it is specific to just Gentoo though.
I find it irritating because, I just use mine for a family/friends gallery server, there is nothing you would want to use lynx for on it. When I check deps it doesn't come up with lynx as one.
Code:
[ebuild   R   ] www-servers/apache-2.2.6  USE="ldap ssl -debug -doc -mpm-event -mpm-itk -mpm-peruser -mpm-prefork -mpm-worker -no-suexec (-selinux) -static-modules -threads" 0 kB


What sucks even more is that I installed lynx just to see if it would fix the problem and doesn't still says: (found out later lynx wasn't my problem was putting PHP5 back in without the -D)
Code:
/etc/init.d/apache2 restart
 * Apache2 has detected a syntax error in your configuration files:

But if I run /usr/sbin/apache2 -t is says Syntax OK.

**Minutes Later: Use to have PHP5 in /etc/conf.d/apache2 APACHE2_OPTS="". Forgot the -D in front of it when put it back in there..



On a side note, if you use eaccelerator and remerge php you will need to do eaccelerator also.
_________________
http://webpages.charter.net/decibelshelp/
Don't assume malice for what stupidity can explain.
Always remember you're unique. Just like everyone else.
Everybody lies........but it doesn't matter since nobody listens.
Back to top
View user's profile Send private message
gnac
Guru
Guru


Joined: 30 Jun 2003
Posts: 302
Location: Columbia River Gorge

PostPosted: Thu Sep 13, 2007 4:32 pm    Post subject: Reply with quote

I agree that if apache2 expects lynx to be on the system in order to run without errors, lynx should be in the dependencies, at least with a "lynx" use flag or something.

However, I was able to get rid of the errors by replacing

Code:
# of the command line. Designed for lynx, however other programs may work.
LYNX="lynx -dump"


in /etc/conf.d/apache with

Code:
#skip lynx, and just echo
LYNX="echo check "


Now, when I run /etc/init.d/apache2 status I get

Code:
~ $ /etc/init.d/apache2 status
 * status:  started
check http://localhost/server-status


I tried to set it up so wget would get the file and pipe it to less,

eg

wget -O- $1 | less

but because of the way the command is called inside of /etc/init.d/apache2 you would need more advanced scripting than I cared to do. My guess is that a simple xargs invocation or some such would do the job nicely, or you could figure out a way to pipte it to null:

Code:
status() {
        LYNX="${LYNX:-lynx -dump}"
        STATUSURL="${STATUSURL:-http://localhost/server-status}"

        ${LYNX} ${STATUSURL} | awk ' /process$/ { print; exit } { print } '
}

fullstatus() {
        LYNX="${LYNX:-lynx -dump}"
        STATUSURL="${STATUSURL:-http://localhost/server-status}"

        ${LYNX} ${STATUSURL}
}

_________________
"I thought she'd steal my heart, instead she stole my kidney,
and now its for sale, on the black market in Sydney" - Better Abraham
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum