Broken Apache Virtual Hosts after Yosemite upgrade Broken Apache Virtual Hosts after Yosemite upgrade apache apache

Broken Apache Virtual Hosts after Yosemite upgrade


at first, you need to remove the “#” in some lines. espacially the vhost.conf file is not imported by default.

like :

#LoadModule php5_module libexec/apache2/libphp5.so#LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so#Include /private/etc/apache2/extra/httpd-vhosts.conf

to

LoadModule php5_module libexec/apache2/libphp5.soLoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.soInclude /private/etc/apache2/extra/httpd-vhosts.conf

and add some '#' in others

<Directory />     AllowOverride none     Require all denied</Directory>

to

<Directory />     #AllowOverride none     #Require all denied</Directory>

according to http://mallinson.ca/osx-web-development/


OS X 10.10 Yosemite comes with Apache 2.4 instead of Apache 2.2 in Mavericks.
The major difference in configuration is that you have to replace...

Order allow,denyAllow from all

...with...

Require all granted

See Apache doc's manual Upgrading to 2.4 from 2.2 for more details.

UPDATE:
Please be aware that after upgrading OS X you will usually find your old config files as backups next to the new ones written by Yosemite. They are labeled e.g. httpd.conf.pre-update and/or httpd.conf~previous and can be found in the same paths as the new configs (e.g. in /private/etc/apache2).