Tag: MacPorts/apache2
sudo port install apache2
sudo port load apache2
$ cd /opt/local/apache2/conf $ sudo cp httpd.conf.sample httpd.conf
$sudo /opt/local/apache2/bin/apachectl start
$sudo /opt/local/apache2/bin/apachectl stop
自動起動用の設定ファイルが/Library/LaunchDaemons/org.macports.apache2.plistに保存されている。
$sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
$sudo launchctl unload -w /Library/LaunchDaemons/org.macports.apache2.plist
#!/opt/local/bin/ruby require "cgi" print "Content-type: text/html\n\n" print "<html><body>Hello World</body></html>"