Skip to content

Instantly share code, notes, and snippets.

@krisrybak
Last active August 29, 2015 14:07
Show Gist options
  • Select an option

  • Save krisrybak/93f3e034e557bb4c7dea to your computer and use it in GitHub Desktop.

Select an option

Save krisrybak/93f3e034e557bb4c7dea to your computer and use it in GitHub Desktop.
Updating your apache settings after migration to Yosemite

Yosemite

Yosemite is using new version of apache 2.4 (finally!), therefore all your previous settings have been whipped off and we need to re initialise apache.

Home directory

Let's start with re-instantiating your home folder:

cd / && ls -la

You will noticed that your home folder no longer exists, instead everything has been moved to home-preserved.

Let's start with checking if your home folder can be created:

sudo vi /etc/auto_master

And make sure that following line /home is commented out and looks like that:

#/home      auto_home   -nobrowse, hidefromfinder

If not you will have to comment that out and reboot your computer.

Now it's time to rename home-preserved back to home

cd / && sudo mv home-preserved/ home/

This should keep existing permissions on file structure (yourusername:staff), but if your not sure you can run:

cd /home && sudo chown -R {MAC_USER_NAME}:staff /home/.

Apache

Let's start by making sure that you are root as there will be a lot of sudo commands going:

sudo -i

Now time for setting apache. Open apache config file for editing:

nano /private/etc/apache2/httpd.conf

We need to enable two major modules: mod_userdir and php5_module. Scroll down untill you will find #LoadModule userdir_module libexec/apache2/mod_userdir.so and uncomment it:

LoadModule userdir_module libexec/apache2/mod_userdir.so

About 2 lines down you'll find #LoadModule rewrite_module libexec/apache2/mod_rewrite.so, you need to uncomment that line.

LoadModule rewrite_module libexec/apache2/mod_rewrite.so

And right below you should find #LoadModule php5_module libexec/apache2/libphp5.so and you need to uncomment that line too.

LoadModule php5_module libexec/apache2/libphp5.so

Scroll down (almost all the way) and you will find following line Include /private/etc/apache2/other/*.conf. Right beneeth that line paste following code:

Include /private/etc/apache2/users/*.conf
Include /private/etc/apache2/extra/httpd-userdir.conf
Include /home/vhosts/*.conf

Set default timezone for your apache

You need to set default timezone otherwise you will get Exception thrown every time you use date function:

  sudo vi /etc/php.ini

And paste following setting:

date.timezone = Europe/London

Save and restart your apache

  sudo apachectl restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment