Broken Apache configuration after upgrading to Yosemite

Yesterday I upgraded to Yosemite, and now my local configuration for web development no longer works.

I managed to configure userdir under /Users/user/public_html , and I could access all websites through localhost/~user/websitename . Nothing special, but it took me a while to set up.

Having looked in the apache directory, I saw that many files were replaced, keeping a backup. I tried to return the files with my settings again, but still not working. I may be missing a file that I don’t remember.

This is httpd-userdir.conf:

 # Settings for user home directories # # Required module: mod_userdir # # UserDir: The name of the directory that is appended onto a user home # directory if a ~user request is received. Note that you must also set # the default access control for these directories, as in the example below. # UserDir public_html # # Users might not be in /Users/*/Sites, so use user-specific config files. # Include /private/etc/apache2/users/*.conf <IfModule bonjour_module> RegisterUserSite customized-users </IfModule> <Directory "/Users/*/public_html/"> AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Order allow,deny Allow from all </Directory> 

Then in http.conf I included some modules:

 Include /private/etc/apache2/extra/httpd-userdir.conf LoadModule userdir_module libexec/apache2/mod_userdir.so 

and this:

DocumentRoot "/ Users / user / public_html"

 Directory "/Users/user/public_html"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks MultiViews # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride all # # Controls who can get stuff from this server. # Order allow,deny Allow from all </Directory> 

If I'm just trying to access localhost , it displays the message "It works!". If I switch to localhost/user , it just does not load, and the same thing if I try to access one of the sites.

Am I missing a file? The apache logs do not even display any errors.

+7
php apache osx-yosemite macos
source share
2 answers

OS X 10.10 Yosemite ships with Apache 2.4 instead of Apache 2.2 in Mavericks.
The main difference in the configuration is that you need to replace ...

 Order allow,deny Allow from all 

... from...

 Require all granted 

See the Apache documentation guide for an upgrade to version 2.4 of 2.2 .

UPDATE:
Remember that after upgrading OS X, you will usually find your old configuration files as backups next to the new ones written by Yosemite. They are indicated, for example. httpd.conf.pre-update and / or httpd.conf ~ previous and can be found in the same ways as new configurations (for example, in / private / etc / apache2).

+18
source share

After trying to fix this problem for 6 hours, I was finally able to get it working. I edited httpd.conf, httpd-userdir.conf, httpd-vhosts.conf etc. To no avail. If you leave all these files unedited from the yosemite configuration, what ultimately helped me was to edit the httpd_server_app.conf located in /Library/Server/Web/Config/apache2/ , adding the following (for each site) as follows:

 <Directory /> Options +FollowSymLinks AllowOverride All Order deny,allow Deny from all </Directory> <Directory "/Library/Server/Web/Data/Sites/Default/"> Options +Indexes +FollowSymLinks +MultiViews AllowOverride All Order allow,deny Allow from all </Directory> <Directory "/Library/Server/Web/Data/Sites/[OTHER SITE DIRECTORY]/"> Options +Indexes +FollowSymLinks +MultiViews AllowOverride All Order allow,deny Allow from all </Directory> 

Make sure that if you use textedit to edit this file, you cancel the automatic insertion of oblique quotes, otherwise you will receive an Unicode error message.

Hope this helps!

+1
source share

All Articles