$ sudo port install apache2 Password: ---> Fetching pcre ---> Attempting to fetch pcre-7.7.tar.bz2 from ftp://ftp.fu-berlin.de/unix/misc/pcre/ ---> Verifying checksum(s) for pcre ---> Extracting pcre ---> Configuring pcre ---> Building pcre with target all ---> Staging pcre into destroot ---> Installing pcre 7.7_0 ---> Activating pcre 7.7_0 ---> Cleaning pcre ---> Fetching apache2 ---> Attempting to fetch httpd-2.2.9.tar.bz2 from http://www.apache.org/dist/httpd ---> Verifying checksum(s) for apache2 ---> Extracting apache2 ---> Configuring apache2 ---> Building apache2 with target all ---> Staging apache2 into destroot ---> Creating launchd control script ########################################################### # A startup item has been generated that will aid in # starting apache2 with launchd. It is disabled # by default. Execute the following command to start it, # and to cause it to launch at startup: # # sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist ########################################################### Warning: apache2 requests to install files outside the common directory structure! ---> Installing apache2 2.2.9_1+darwin_9 ---> Activating apache2 2.2.9_1+darwin_9 ---> Cleaning apache2
メッセージにある通り、自動起動を設定。
$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
httpd.confを添付されているサンプルからコピーする。
$ sudo cp /opt/local/apache2/conf/httpd.conf.sample /opt/local/apache2/conf/httpd.conf
apachectlなどへのパスを通すため、.bash_profileなどで$PATHに
/opt/local/apache2/bin
を追加しておく。