Changes between Version 6 and Version 7 of howto/Apache2
- Timestamp:
- Jan 4, 2015, 6:18:15 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
howto/Apache2
v6 v7 3 3 [wiki:howto <- Back to the HOWTO section] 4 4 5 This page describes the installation of the Apache2Web server under OSX (Yosemite 10.10.2) via MacPorts (version 2.3). Date 28 December 20145 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 6 6 7 7 For information on integration '''Apache''' with '''MySQL''' and '''PHP''', see:''' [[howto/MAMP]]''' … … 93 93 If desired, reboot your machine and point your browser again to http://localhost/ to confirm that Apache is again running. 94 94 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. 96 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".'' 97 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. 98 96 99 === User directories === #userdir 97 100 … … 107 110 Include conf/extra/httpd-userdir.conf 108 111 }}} 112 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. 109 113 110 Then edit `/opt/local/apache2/conf/extra/httpd-userdir.conf` add the following lines to the end of the file: 114 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. 111 115 112 116 {{{ 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 117 120 }}} 118 121 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. 122 You can then view your personal pages by accessing http://localhost/~username/, where "username" is your Mac OS X account's short name. 128 123 129 124 === Local Apache manual === #manual … … 141 136 }}} 142 137 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/. 138 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. 139 140 {{{ 141 $ /opt/local/apache2/bin/apachectl -t 142 $ sudo port unload apache2 143 $ sudo port load apache2 144 }}} 145 146 You can then view the manual by accessing http://localhost/manual/. 147 148 NOTE: 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 }}} 144 153 145 154 === Secure Sockets (https) === #ssl