Original link: http://www.cnblogs.com/dragonbattlesun/p/4039706.html
Mac upgrade to the latest system after the local test site does not work properly, because the MAC system after the upgrade of his Apache version number has also been upgraded with the version number
Server version:apache/2.4.9 (Unix)
Server built:sep 9 2014 14:48:20
The version number before the upgrade is 10.9
Server version:apache/2.2.26 (Unix) Server Built:dec 10 2013 22:09:38 Basically, the blocks that were configured are overwritten, so that the Web site does not work properly. The workaround is 1 again to enable PHP to avoid PHP script files are displayed directly on the Web page
1 |
sudo mvim /etc/apache2/httpd.conf |
/loadmodule Php5_module libexec/apache2/libphp5.so
Then find the line in the file to remove the previous # save can be 2, open the support user-level folder http://localhost/~username/ user-level folder can not access to ask
Not foundthe requested the URL/~zhuzi/was not found on the this server.
Configure the. conf of the user-level folder (typically a ~/sites under the root folder of the user level) the folder is a user-level Web site without the need to create a sudo mkdir again ~/sites then you need to configure zhuzi.conf
Add for example the following code (10.10) How to configure
12345 |
<Directory "/Users/zhuzi/Sites/" > Options Indexes MultiViews AllowOverride None Require all granted </Directory> |
Then change folder permissions
sudo chmod 775/etc/apache2/users/zhuzi.conf
Also need to configure httpd.conf
sudo mvim/etc/apache2/httpd.conf
Find a few blocks with Vim's find command to remove the previous #
LoadModule authz_core_module libexec/apache2/mod_authz_core.soloadmodule authz_host_module libexec/apache2/mod_ Authz_host.soloadmodule Userdir_module libexec/apache2/mod_userdir.soinclude/private/etc/apache2/extra/ Httpd-userdir.conf
Configure httpd-userdir.conf
1 |
sudo nano /etc/apache2/extra/httpd-userdir.conf |
Remove the # from the front of the block
1 |
Include / private /etc/apache2/users/*.conf |
Re-launch Apache
That's what you can access.
http://localhost/~zhuzi/
MAC upgrade to 10.10 (OS X Yosemite) apache+php configuration issues