[site] = name of site [root dir] = path to site root [logs] = path to logs directory
Example: site = helloworld root dir = /Users/me/Sites/helloworld logs = /Users/me/Sites/logs
-
Add site directory to /etc/apache2/httpd.conf:
<Directory "[root dir]/"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all
-
Add configuration for vhost to /etc/apache2/extra/httpd-vhosts.conf:
<VirtualHost *> ServerAdmin [email protected] DocumentRoot "[root dir]" ServerName [site].local ErrorLog "[logs]/[site]" </VirtualHost>
-
Create dir for logs:
mkdir -p "[logs]/[site]/"
chmod 777 "[logs]/[site]"
-
Add domain to /etc/hosts:
127.0.0.1 [site].local
-
Restart Apache
sudo apachectl restart