Problems with Apache2 starting up

Bill Hernandez ms at mac-specialist.com
Wed Jan 28 22:22:43 PST 2009


On Jan 27, 2009, at 10:14 PM, Jeff Stubbs wrote:

> Greetings,
>
> I've used MP to build an Apache2/MySQL/PHP5 server for spouse's  
> employer last November. Since startup then, everything has worked  
> fine. However, late yesterday afternoon, I got a call that the sites  
> weren't accessible. Since I was a work, I told them just to restart  
> the machine. Machine restarted fine, but Apache2 didn't start up on  
> boot. SSH'd in and ran 'top', no httpd processes were running.  
> Launchctl showed that the plist file was already loaded. Using the  
> apachectl command (MP's, not Apples), the server started up. Just  
> for kicks, this evening I restarted the machine, Apache2 wasn't  
> heard from, but will start from the command line. Anyone one  
> experiencing the same problem?

I've been experiencing the same problem for several months now on two  
out of three machines. The one still working correctly is a G4 running  
Tiger, the two not working are an iMac G5 Intel, and a PowerBook Pro  
17 Intel ( both running the latest Leopard). I've tried re-installing,  
and still have the problem, so finally I just wrote the shell script.

Here's what I run everytime I reboot :

Best Regards,

Bill Hernandez
Plano, Texas



#!/bin/bash

# +---------+---------+---------+---------+---------+--------- 
+---------+---------+
# [2007.22.08](10:43AM) -> [roscoe] ~
# $ apache_startup
# +---------+---------+---------+---------+---------+--------- 
+---------+---------+

function pause(){
read -p "$*"
}

echo "This script will start (apache, mysql, pgsql)..."
echo
echo "Please enter your admin password..."
sudo echo

sudo /opt/local/apache2/bin/apachectl start

sleep 5
# pause 'Press any key to continue…'

sudo /opt/local/lib/mysql5/bin/mysqld_safe --user=mysql &

sleep 5
# pause 'Press any key to continue…'

PGSQL_DIRNAME="postgresql83"
sudo chown -R postgres:admin /opt/local/var/db/${PGSQL_DIRNAME}
sudo chown -R postgres:admin /opt/local/lib/${PGSQL_DIRNAME}

sudo su - postgres -c "/opt/local/lib/${PGSQL_DIRNAME}/bin/pg_ctl -D / 
opt/local/var/db/${PGSQL_DIRNAME}/data -l logfile start"

sleep 5
	
echo "Check Apache..."
echo
echo "\$ ps aux | grep httpd"
echo $divider
ps aux | grep httpd
echo $divider
echo "Check PgSQL..."
echo
echo "\$ ps aux | grep postgres | sed 's/ *$//g'"
echo $divider
ps aux | grep postgres | sed 's/ *$//g'
echo $divider
echo "Check MySQL..."
echo
echo "\$ ps aux | grep mysql"
echo $divider
ps aux | grep mysql
echo $divider

exit





More information about the macports-users mailing list