Changes between Version 6 and Version 7 of howto/Apache2


Ignore:
Timestamp:
Jan 4, 2015, 6:18:15 AM (10 years ago)
Author:
magill@…
Comment:

more updates

Legend:

Unmodified
Added
Removed
Modified
  • howto/Apache2

    v6 v7  
    33[wiki:howto <- Back to the HOWTO section]
    44
    5 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
     5This page describes the installation of the '''Apache2''' Web server under OSX (Yosemite 10.10.2) via MacPorts (version 2.3).   Date 28 December 2014
    66
    77For information on integration '''Apache''' with '''MySQL''' and '''PHP''', see:''' [[howto/MAMP]]'''
     
    9393If desired, reboot your machine and point your browser again to http://localhost/ to confirm that Apache is again running.
    9494
    95 '''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".''
     95'''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.
     96Using 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".''
     97The 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.
     98
    9699=== User directories === #userdir
    97100
     
    107110Include conf/extra/httpd-userdir.conf
    108111}}}
     112This 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.
    109113
    110 Then edit `/opt/local/apache2/conf/extra/httpd-userdir.conf` add the following lines to the end of the file:
     114After 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.
    111115
    112116{{{
    113 #
    114 # Include user configurations
    115 #
    116 Include /private/etc/apache2/users/*.conf
     117$ /opt/local/apache2/bin/apachectl -t
     118$ sudo port unload apache2
     119$ sudo port load apache2
    117120}}}
    118121
    119 For Mac OS X 10.4 and lower:
    120 {{{
    121 #
    122 # Include user configurations
    123 #
    124 Include /private/etc/httpd/users/*.conf
    125 }}}
    126 
    127 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.
     122You can then view your personal pages by accessing http://localhost/~username/, where "username" is your Mac OS X account's short name.
    128123
    129124=== Local Apache manual === #manual
     
    141136}}}
    142137
    143 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/.
     138After 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.
     139
     140{{{
     141$ /opt/local/apache2/bin/apachectl -t
     142$ sudo port unload apache2
     143$ sudo port load apache2
     144}}}
     145
     146You can then view the manual by accessing http://localhost/manual/.
     147
     148NOTE: This option expects ''"/opt/local/apache2/manual"'' to be accessible under "<Document Root>." This can be accomplished by
     149{{{
     150$ cd <Document Root>
     151$ ln -d /opt/local/apache2/manual
     152}}}
    144153
    145154=== Secure Sockets (https) === #ssl