Hello everyone!

We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.

If you want to turn your computer into a development machine by configuring apache server and virtual hosts, you can follow steps below.

Apache configuration

# /etc/apache2/httpd.conf

# Enable modules
LoadModule dir_module libexec/apache2/mod_dir.so
LoadModule alias_module libexec/apache2/mod_alias.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule php5_module libexec/apache2/libphp5.so

# Update <Directory "/Library/WebServer/Documents"> options as:
Options FollowSymLinks Multiviews Indexes
AllowOverride All

# Enable configs
Include /private/etc/apache2/extra/httpd-autoindex.conf
Include /private/etc/apache2/extra/httpd-languages.conf
Include /private/etc/apache2/extra/httpd-vhosts.conf

Vhosts configuration

Without entry below, http://localhost/ would give permissions error.

# /etc/apache2/extra/httpd-vhosts.conf

<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Library/WebServer/Documents/"