How To Setup To Specify Which Site Is Visible Externally

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
jebbushell's picture

I have a Quickstart Drupal 7 Quickstart implementation and a domain that is directed at my router IP address.

I have forwarded HTTP to my rather cool permanently assigned local IP address . I'm using a bridged adapter in promiscuous (allow VMs) mode.

When I request my domain I get the phpinfo page. I have a site that I want to display instead called xxxx.dev but I do not have the smarts to configure it, except by messing with ports.conf. I want my site to be served on port 80 from within my VM.

Also, possibly related, I am unable to serve pages, even locally, that use the v2 Google Maps API because I get "This web site needs a different Google Maps API key" when I serve the page even though I've just configured a key in successfully using the Location Map module. Edit: Using a simple D7 environment on the host I do not get the problem.

If anyone can help I'd be very grateful indeed.

Comments

Fixed

jebbushell's picture

In websites/config/apache_sites_enabled, modify the file that has your development site's name on it, for instance example6.dev.

  1. Replace the asterisks in the VirtualHost tags with your guest IP address and save.
  2. Restart Apache
  3. Reconfigure your router to direct port 80 traffic to your guest IP address.
  4. Start worrying about security because it works.

This also fixed my Google Maps API key problem.

Hat tip to FriendlyDrupal.com.

Edit: But it screwed phpMyAdmin until I configured a VirtualHost file call "phpmyadmin" in the apache_sites_available directory (with linked file in apache_sites_enabled) with the following content:

<VirtualHost *:80>
   DocumentRoot "/usr/share/phpmyadmin"
   ServerName phpmyadmin
   ServerAlias phpmyadmin
    <Directory "/usr/share/phpmyadmin">
        AllowOverride All
        Order allow,deny
        Allow from all
  </Directory>
</VirtualHost>

FYI my Hosts file is the default except the last four lines are now:

127.0.0.1 example.dev #quickstart
127.0.0.1 example6.dev #quickstart
192.168.1.999 tnpr.dev
127.0.0.1 phpmyadmin

where 192.168.1.999 is my permanent guest ip address.

Edit: But this, or the associated hacking, screwed my Google Maps API validation again. However, I can still manage my maps situation via the domain name. So now, in VirtualBox, I enter my domain name into the address box and behold I have a site that I can maintain Google Maps V2 API on. I just can't do it completely locally. This is good enough for me.