Steps to setup non-Drupal Site on Mac with Acquia Dev Desktop 2

I use Acquia Dev Desktop 2 on my Mac for all Drupal related sites. It allows you to create Drupal sites locally on your Mac or Windows PC and if needed, publish, develop, and synchronize your local Drupal sites on the Web using Acquia Cloud.

Recently I started working on migrating a non-Drupal site to D8 so I needed to set up that non-Drupal site on my local system. I started wondering how I can do this as http://localhost or http://local:8083 was not returning any page. This happens because all the Drupal sites were set up using Dev Desktop 2 and it creates a virtual host like http://d8.local:8083 for each of the site.

Here is how I got a non-Drupal site running:

1) Make an entry in /etc/hosts file 

A line like the one below allows you to access your site by the domain name "sitename.local"
127.0.0.1       sitename.local

2) Add a virtualhost entry for the site

I looked at /Applications/DevDesktop/apache/conf/vhosts.conf file but it says
"#!!!!!! PLEASE DO NOT EDIT THIS FILE, IT IS AUTOGENERATED BY ACQUIA DEV DESKTOP !!!!!!".
So I created a new /Applications/DevDesktop/apache/conf/sites.conf and specified the vhost entry there. It was quite similar to one of the vhost entries in vhosts.conf file. E.g.,
<VirtualHost *>
  ServerName sitename.local
  DocumentRoot "/Users/amit.goyal/Sites/devdesktop/sitefolder"
  <IfModule fcgid_module>
    FcgidInitialEnv PHPRC "/Applications/DevDesktop/php5_5/bin"
    FcgidWrapper "\"/Applications/DevDesktop/php5_5/bin/php-cgi\""
  </IfModule>
  <Directory "/Users/amit.goyal/Sites/devdesktop/sitefolder">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride All
    Require local
  </Directory>
</VirtualHost>

3) Tell Apache about the new sites.conf file

Add a new line at the end of httpd.conf:

Include conf/sites.conf

4) Restart the Apache web server

You can do this from the Dev Desktop user interface.

You can now access your new site at http://sitename.local:8083.



Although most of these steps are specific to Mac, the same can be applied to Windows with Acquia Dev Desktop. You just need to look for "hosts" and "httpd.conf" files.

You may refer to this forum post for more information.

Comments

Anonymous said…
Thank You!!

Popular posts from this blog

Simple Meditation

Custom MySQL Database to Drupal 8 Migration