[MacPorts] howto/Apache2 modified

MacPorts noreply at macports.org
Sat Jan 3 22:18:17 PST 2015


Page "howto/Apache2" was changed by magill at mac.com
Diff URL: <https://trac.macports.org/wiki/howto/Apache2?action=diff&version=7>
Revision 7
Comment: more updates
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: howto/Apache2
=========================================================================
--- howto/Apache2 (version: 6)
+++ howto/Apache2 (version: 7)
@@ -2,7 +2,7 @@
 
 [wiki:howto <- Back to the HOWTO section]
 
-This page describes the installation of the Apache2 Web server under OSX (Yosemite 10.10.2) via MacPorts (version 2.3).   Date 28 December 2014 
+This page describes the installation of the '''Apache2''' Web server under OSX (Yosemite 10.10.2) via MacPorts (version 2.3).   Date 28 December 2014 
 
 For information on integration '''Apache''' with '''MySQL''' and '''PHP''', see:''' [[howto/MAMP]]'''
 
@@ -92,7 +92,10 @@
 
 If desired, reboot your machine and point your browser again to http://localhost/ to confirm that Apache is again running.
 
-'''NOTE:''' If you have set "ServerName" to be anything other than "localhost" the links above to "localhost" will fail with Safari complaining "''Failed to open page. Safari can't open the page "localhost" because Safari can't connect to the server "localhost".''
+'''NOTE:''' The setting of "ServerName" to anything other than the '''Fully Qualified Domain Name''' (FQDN) of the server under Apache 2.2.x and Yosemite, does not produce the expected results.
+Using the links above to "localhost" will fail with Safari complaining "''Failed to open page. Safari can't open the page "localhost" because Safari can't connect to the server "localhost".'' 
+The simple answer is "localhost" is an "old-tyme" shortcut which should still work, but often does not for many different reasons. The "Fix" is to simply use the FQDN of your server when testing Apache or related Web services.
+
 === User directories === #userdir
 
 If you would like to be able to access web pages in the Sites directory of your home directory, edit `/opt/local/apache2/conf/httpd.conf` and locate the following line:
@@ -106,25 +109,17 @@
 {{{
 Include conf/extra/httpd-userdir.conf
 }}}
+This file:   ''"/opt/local/apache2/conf/extra/httpd-userdir.conf"'' will activate the "Sites" sub-directory for all ~users on your system. (''"/Users/*/Sites"'') and contains initial, basic restrictions for access to the contents of that directory.
 
-Then edit `/opt/local/apache2/conf/extra/httpd-userdir.conf` add the following lines to the end of the file:
+After each change to the config file, you should again verify the file syntax, and then you need to stop and restart Apache for the changes to take effect.
 
 {{{
-#
-# Include user configurations
-#
-Include /private/etc/apache2/users/*.conf
+$ /opt/local/apache2/bin/apachectl -t
+$ sudo port unload apache2
+$ sudo port load apache2
 }}}
 
-For Mac OS X 10.4 and lower:
-{{{
-#
-# Include user configurations
-#
-Include /private/etc/httpd/users/*.conf
-}}}
-
-Restart Apache using `sudo /opt/local/apache2/bin/apachectl -k restart` to make this change take effect. You can then view your personal pages by accessing http://localhost/~username/, where "username" is your Mac OS X account's short name.
+You can then view your personal pages by accessing http://localhost/~username/, where "username" is your Mac OS X account's short name.
 
 === Local Apache manual === #manual
 
@@ -140,7 +135,21 @@
 Include conf/extra/httpd-manual.conf
 }}}
 
-Restart Apache using `sudo /opt/local/apache2/bin/apachectl -k restart` to make this change take effect. You can then view the manual by accessing http://localhost/manual/.
+After each change to the config file, you should again verify the file syntax, and then you need to stop and restart Apache for the changes to take effect.
+
+{{{
+$ /opt/local/apache2/bin/apachectl -t
+$ sudo port unload apache2
+$ sudo port load apache2
+}}}
+
+You can then view the manual by accessing http://localhost/manual/.
+
+NOTE: This option expects ''"/opt/local/apache2/manual"'' to be accessible under "<Document Root>." This can be accomplished by
+{{{
+$ cd <Document Root>
+$ ln -d /opt/local/apache2/manual
+}}}
 
 === Secure Sockets (https) === #ssl
 
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/howto/Apache2>
MacPorts <https://www.macports.org/>
Ports system for OS X

This is an automated message. Someone added your email address to be
notified of changes on 'howto/Apache2' page.
If it was not you, please report to .


More information about the macports-changes mailing list