Tag: MacPorts/apache2
---> Some of the ports you installed have notes: apache2 has the following notes: Apache2 has been migrated from the 2.2.x to the 2.4.x branch. The install paths have been changed to no longer violate the MacPorts mtree: 1. The binaries are now under /opt/local/sbin/ (rather than under /opt/local/apache2/bin/) 2. The configure files are now under /opt/local/etc/apache2/ (rather than under /opt/local/apache2/conf/) 3. The modules are now under /opt/local/lib/apache2/modules/ (rather than under /opt/local/apache2/modules/) 4. The web root is now located under /opt/local/www/apache2/html/ (rather than under /opt/local/apache2/htdocs/) 5. The cgi-bin is now located under /opt/local/www/apache2/cgi-bin/ (rather than under /opt/local/apache2/cgi-bin/) 6. The logs are now located under /opt/local/var/log/apache2/ (rather than under /opt/local/apache2/logs/) 7. The manual is now located under /opt/local/www/apache2/manual/ (rather than under /opt/local/apache2/manual/) 8. The manual (man) pages are still at /opt/local/share/apache2/man/ You can move your htdocs and cgi-bin to the new locations, or edit /opt/local/etc/apache2/httpd.conf to point at the old locations.
sudo port install apache2
sudo port load apache2
User sora Group staff
DocumentRoot "/Users/sora/public_html" <Directory "/Users/sora/public_html">
# User home directories Include etc/apache2/extra/httpd-userdir.conf
cd /opt/local/etc/apache2/extra/ sudo cp httpd-userdir.conf.orig httpd-userdir.conf
UserDir Sites # # Control access to UserDir directories. The following is an example # for a site where these directories are restricted to read-only. # <Directory "/Users/*/Sites"> AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Require method GET POST OPTIONS </Directory>
$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>"