Problems starting apache 1.3 with mysql
I抳e been working on a project to replace one of the my group抯 primary NIS servers. It also runs mysql and apache, as it is the host for the our team抯 hardware tracking database and website. Its running apache 1.3, and for some odd reason, I can抰 get apache to start on system boot. The original system, prince, used a startup script in /etc/rc3.d called S98hits. It was as follows:
#!/bin/sh
/usr/local/mysql/bin/safe_mysqld &
sleep 30
/usr/local/apache/bin/apachectl start
This script works fine on prince, but on the new system, serenity, nothing I do will run that apachectl start at boot time. I抳e tried pretty much everything I can think of. From what I抳e seen, if you try to execute apachectl start from a bourne shell, I get a mysql library error, which I抳e tracked down and fixed, yet the fix won抰 work. If you run it from a c-shell, the program executes every time, with no errors, but it won抰 start automatically. The latest iteration of my scripts has a startup script in rc3.d, which reads the following:
#!/bin/sh
/usr/local/apache/bin/startup
startup is a script that I created that contains the following:
#!/bin/csh
/usr/local/apache/bin/apachectl start
I saw somewhere that scripting in csh without adding a 杅 after the first line can sometimes cause problems, but after trying it, it didn抰 work.
Now, I抦 totally stumped on why nothing is working here. Any ideas?
[1463 byte] By [
godspunk32] at [2007-11-26 9:43:41]

# 1
Just a followup with some more information for you gurus. When I run the apachectl start from a command line, in a bourne or korn shell, I get the following error about the LD_LIBRARY:
ld.so.1: httpd: fatal: libmysqlclient.so.6: open failed: No such file or directory
Killed
/usr/local/apache/bin/apachectl start: httpd could not be started
The libmysqlclient.so.6 file is located in /usr/local/mysql/lib/mysql.
I've edited the global .cshrc file to include the following:
setenv LD_LIBRARY_PATH /usr/openwin/lib:usr/local/lib:/usr/lib:/usr/local/mysql/lib/mysql:/usr/local/m ysql/lib:/usr/sfw/lib
Still, I'm stumped.
# 2
try this... use the crle command to look at your run time linking path.
as root.. just do this at a prompt:
crle <enter>
this will show you your current LD path.
then.. to update it.. and add the mysql lib folder.. do the following:
crle -u -l /usr/local/mysql/lib/mysql
then run crle with no arguments again to make sure it updated your LD path...
then try to run apache again.
Let me know if that helps.
# 3
Thanks for the info...
I tried the command, and the second time I ran the crle command, it seemed to show the link.
I then tried to start apache.
# /usr/local/apache/bin/apachectl start
Syntax error on line 224 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/libphp4.so into server: ld.so.1: httpd: fa
/usr/local/apache/bin/apachectl start: httpd could not be started
I then hopped into a c-shell, and poof, apache started with no problems.
Now, line 224 reads:
LoadModule php4_modulelibexec/libphp4.so
libphp4.so does exist in /usr/local/apache/libexec, but its a compiled file, so I can't more it out.
Any further ideas?
Thanks again!
Joe