MAC upgrade to 10.10 (OS X Yosemite) apache+php configuration issues

Source: Internet
Author: User

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

1 sudo apachectl restart

That's what you can access.

http://localhost/~zhuzi/

MAC upgrade to 10.10 (OS X Yosemite) apache+php configuration issues

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.