Itsa me, Pablo
Itsa me, Pablo
  • Code
  • Blog
  • GitHub
  • CV
Itsa me, Pablo
  • Code
  • Blog
  • GitHub
  • CV
  • Posts in category "Development"


  • Upgrading to OSX El Capitan - Getting Virtual Hosts working with Apache

    Published 02/10/2015 11:40:00, by Pablo de la Peña

    Today I upgraded my MacBook to El Capitan. The first thing I noticed (other than wiggling the cursor around - best feature ever) was that all my development Virtual Hosts had stopped working. To be honest, I kind of expected this.

    El Capitan ships with Apache 2.4.16, and it looks like it overwrites your previous httpd.conf file.

    Getting things working for me was easy though, this is more of a write up for my collegues than a definitive guide, so there's a few extra steps at the end aimed towards them.

    Enable Virtual Hosts

    1. Open up httpd.conf, this is located at /private/etc/apache2/
    2. Uncomment the line which includes virtual hosts: Include /private/etc/apache2/extra/httpd-vhosts.conf
      1. Alternatively, just whack that at the end of the file, amounts to the same thing.
    3. Restart Apache: sudo apachectl restart

    That is it, as far as enabling virtual hosts goes. Read on for some Shed specific (but generic at the same time) next steps.

    Enable PHP and ModRewrite

    1. Open up httpd.conf, this is located at /private/etc/apache2/
    2. Uncomment the line which loads PHP: LoadModule php5_module libexec/apache2/libphp5.so
      1. Shed use homebrew managed PHP, so leave that line commented and place this line underneath instead: LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so​
    3. Uncomment the line which laods mod_rewrite: LoadModule rewrite_module libexec/apache2/mod_rewrite.so
    4. Allow .htaccess files by setting AllowOverride All in the <Directory /> block
    5. Restart Apache: sudo apachectl restart

    Some other Apache Configs

    The following are completely my preference, but I'd still recommend them anyway.

    1. Open up httpd.conf, this is located at /private/etc/apache2/
    2. Update the user and group parameters to match your OSX login (in my case pablo and staff)
      1. This will cause apache to write as you, which generally makes delaing with reading/writing files a little less torublesome
    3. Restart Apache: sudo apachectl restart

  • Latest Posts

    • Upgrading to OSX El Capitan - Getting Virtual Hosts working with Apache
      Published 02/10/2015 11:40:00
    • How I restored my iCloud Calendar
      Published 25/08/2015 00:30:00
    • HelloBlog
      Published 18/06/2015 16:28:54

  • Categories

    • Development (1)
    • OSX (1)
    • PHP (1)

  • Tags

    • iCloud (1)

  • Popular Posts

    • HelloBlog
      Published 18/06/2015 16:28:54
    • How I restored my iCloud Calendar
      Published 25/08/2015 00:30:00
    • Upgrading to OSX El Capitan - Getting Virtual Hosts working with Apache
      Published 02/10/2015 11:40:00

  • RSS
© Pablo de la Peña 2022 – @hellopablo