Apache 2 - am I doing it wrong?

Chris Janton face at CentosPrime.COM
Thu Sep 10 16:17:59 PDT 2009


On 2009-09-10 , at 10:28 , Scott Haneda wrote:

> First issue, reloading I use apachectl. Often times I forget to cd  
> to the macports area and enable Apples distro. Is chmod -x apachectl  
> sufficient to solve that?
>
> I can move, rename, symblink, or alias, but wanted opinions on the  
> suggested way.

mac 2 # ps -axww | grep [h]ttpd
   237 ??         0:03.47 /opt/local/apache2/bin/httpd -k start
  8657 ??         0:02.64 /opt/local/apache2/bin/httpd -k start
  8755 ??         0:02.42 /opt/local/apache2/bin/httpd -k start
  8844 ??         0:00.80 /opt/local/apache2/bin/httpd -k start
  8903 ??         0:00.68 /opt/local/apache2/bin/httpd -k start
  8904 ??         0:01.14 /opt/local/apache2/bin/httpd -k start
  8917 ??         0:00.56 /opt/local/apache2/bin/httpd -k start
  8918 ??         0:00.18 /opt/local/apache2/bin/httpd -k start
  8921 ??         0:00.82 /opt/local/apache2/bin/httpd -k start
  8939 ??         0:00.58 /opt/local/apache2/bin/httpd -k start
  8978 ??         0:00.17 /opt/local/apache2/bin/httpd -k start
mac 3 # sudo /opt/local/apache2/bin/apachectl graceful
mac 4 # ps -axww | grep [h]ttpd
   237 ??         0:03.63 /opt/local/apache2/bin/httpd -k start
  9015 ??         0:00.00 /opt/local/apache2/bin/httpd -k start
  9016 ??         0:00.00 /opt/local/apache2/bin/httpd -k start
  9017 ??         0:00.00 /opt/local/apache2/bin/httpd -k start
  9018 ??         0:00.00 /opt/local/apache2/bin/httpd -k start
  9019 ??         0:00.00 /opt/local/apache2/bin/httpd -k start

mac 7 # ps -axww | grep [a]pache
    69 ??         0:00.37 /opt/local/bin/daemondo --label=apache2 -- 
start-cmd /opt/local/etc/LaunchDaemons/org.macports.apache2/ 
apache2.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/ 
org.macports.apache2/apache2.wrapper stop ; --restart-cmd /opt/local/ 
etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart ; -- 
pid=none
   237 ??         0:03.64 /opt/local/apache2/bin/httpd -k start
  9015 ??         0:00.00 /opt/local/apache2/bin/httpd -k start
  9016 ??         0:00.23 /opt/local/apache2/bin/httpd -k start
  9017 ??         0:00.00 /opt/local/apache2/bin/httpd -k start
  9018 ??         0:00.00 /opt/local/apache2/bin/httpd -k start
  9019 ??         0:00.00 /opt/local/apache2/bin/httpd -k start
  9031 ??         0:00.00 /opt/local/apache2/bin/httpd -k start

launchctl is starting process 69 (and keeping an eye on it), not the  
httpd processes.

You could always do

  sudo kill -SIGHUP 69

which is how you get daemondo to issue the "restart" command.

I use apachectl graceful a *lot* and have not ever had difficulty with  
launchctl (mysql, a different story)

If you change permissions on /usr/sbin/apachectl like this

mac 11 # sudo chmod -x /usr/sbin/httpd
mac 12 # apachectl
/usr/sbin/apachectl: line 119: /usr/sbin/httpd: Permission denied

you will get the reminder you need to actually execute /opt/local/ 
apache2/bin/apachectl

or you could just put this in your profile

alias apachectl=/opt/local/apache2/bin/apachectl

8)
----------------------------------
Chris Janton  - face at CentosPrime dot COM
Netminder for Opus1.COM




More information about the macports-users mailing list