httpd from system prefs (fink installs)

alligatorTim

Registered
hi guys. i've been getting a lot of help on archived topics here on this forum, and i've gotten through installing and configuring mysql, apache, and php. i installed and used the fink package handler for the apache and php part (though i still can't get it to work from bash -- had to change back to tcsh). everything seems to be working great except i have to manually start and stop httpd through the command line. like %apachetcl start

here's what ive' tried so far:

i deleted /usr/sbin/apachetcl and replaced it with
%ln -s /sw/sbin/apachetcl /usr/sbin/apachetcl

(fink put apachetcl in sbin rather than bin)

then for the httpd.pid location i did:

%rmdir /sw/var/httpd/run/
%ln -s /private/var/run /sw/var/httpd/run

i still can't start and stop httpd from the system preferences, which isn't a huge deal, but i'ld like to. it's such a nice interface.

also, i don't know if this is normal but in my processes it shows three entrys for httpd:

root 405 0.0 0.7 17924 1828 ?? Ss 0:00.42 /sw/sbin/httpd
nobody 406 0.0 0.8 17940 2096 ?? S 0:00.14 /sw/sbin/httpd
nobody 408 0.0 0.8 17940 2056 ?? S 0:00.11 /sw/sbin/httpd

thanks in advance.
-alligator
 
you almost have it...

when the system starts it calls apachectl
which must be in the path
/usr/bin /bin /usr/sbin

see /System/Library/StartUpItems/Apache

and /private/etc/hostconfig

as far as what the system is doing to stop the server. I have seen this info somewhere, but...

anyway, you can call httpd directly
you can call apachectl which is a perlscript

or you can call the process directly and kill the process.

in the event httpd is searched for along those paths, then you original installation will be found in /usr/sbin near apachectl

so you will have to hide that original.

as far as linking to a pid file sorry, doesnot work
why did you remove the directory before linking???


see httpconfig

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
PidFile "/private/var/run/httpd.pid"

if you have a link there, it will probably get overwritten. or the server won't start.

1. move all of your original httpd rlated install to another safe folder.

2. make sure apachectl is the one which will start your new httpd.

3. make sure apache ctl can be found at startup

4. adjust your PID location in the correct httpd.conf file.

/sw/etc/httpd ???

I use fink, but I just compiled my own apache and php on my own because the default locations make more sense to me.

if you were to have a need for a second server, installing the fink version makes for an excellent alternative.

additionally you can add to hostconfig and startupitems any number of things to be run at startup.

It is hard for me to realize why everyone wants to customize before they understand how the basic installation is working.
 
Back
Top